Commit b0a29950 authored by David Johnson's avatar David Johnson

More bugfixes.

parent 8f0b2869
......@@ -241,14 +241,14 @@ EOF
cat <<EOF > /etc/openvpn/clients/$node-route-up.sh
#!/bin/sh
VNODES=`/usr/local/etc/emulab/tmcc vnodelist | sed -nre 's/^VNODEID=(pcvm[0-9]*-[0-9]*) .*$/\1/p' | xargs`
for vnode in $VNODES ; do
VTAG=`/usr/local/etc/emulab/tmcc -n $vnode ifconfig | sed -nre 's/^.* LAN=$agglan .*VTAG=([0-9]*).*$/\1/p'`
if [ -n "$VTAG" ]; then
VNODES=\`/usr/local/etc/emulab/tmcc vnodelist | sed -nre 's/^VNODEID=(pcvm[0-9]*-[0-9]*) .*$/\1/p' | xargs\`
for vnode in \$VNODES ; do
VTAG=\`/usr/local/etc/emulab/tmcc -n $vnode ifconfig | sed -nre 's/^.* LAN=$agglan .*VTAG=([0-9]*).*$/\1/p'\`
if [ -n "\$VTAG" ]; then
break;
fi
done
if [ -z "$VTAG" ]; then
if [ -z "\$VTAG" ]; then
echo "ERROR: fatal: could not find bridge for $agglan"
exit 1
fi
......@@ -259,26 +259,38 @@ ip rule add from $agg_cidr table $aggprefix
ip rule add iif tun-$aggprefix to $agg_cidr table $aggprefix
ip route add $mlan_CIDR via $VPN_SERVER dev tun-$aggprefix table $aggprefix
ip route add 192.168.0.0/16 via $VPN_SERVER dev tun-$aggprefix table $aggprefix
ifconfig br$VTAG $agg_gw netmask $agg_mask up
ip route add $agg_cidr dev br$VTAG table $aggprefix
ifconfig br\$VTAG $agg_gw netmask $agg_mask up
ip route add $agg_cidr dev br\$VTAG table $aggprefix
EOF
chmod 755 /etc/openvpn/clients/$node-route-up.sh
cat <<EOF > /etc/openvpn/clients/$node-route-down.sh
#!/bin/sh
VNODES=\`/usr/local/etc/emulab/tmcc vnodelist | sed -nre 's/^VNODEID=(pcvm[0-9]*-[0-9]*) .*$/\1/p' | xargs\`
for vnode in \$VNODES ; do
VTAG=\`/usr/local/etc/emulab/tmcc -n $vnode ifconfig | sed -nre 's/^.* LAN=$agglan .*VTAG=([0-9]*).*$/\1/p'\`
if [ -n "\$VTAG" ]; then
break;
fi
done
if [ -z "\$VTAG" ]; then
echo "ERROR: fatal: could not find bridge for $agglan"
exit 1
fi
ip rule del from $agg_cidr table $aggprefix
ip rule del iif tun-$aggprefix to $agg_cidr table $aggprefix
ip route flush table $aggprefix
ifconfig br$VTAG 0 up
ifconfig br\$VTAG 0 up
EOF
chmod 755 /etc/openvpn/clients/$node-route-down.sh
#
# Ok, copy the key/crts/conf files to the agg host
#
rsync -avz -o StrictHostKeyChecking=no \
scp -p -o StrictHostKeyChecking=no \
/etc/openvpn/ca.crt $KEY_DIR/$node* $fqdn:$OURDIR
rsync -avz -o StrictHostKeyChecking=no \
scp -p -o StrictHostKeyChecking=no \
/etc/openvpn/clients/$node* $fqdn:$OURDIR
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment