Commit a075e4b1 authored by David Johnson's avatar David Johnson

Route through the client-side peer address for net30* topos.

parent cfdfe57e
......@@ -341,6 +341,7 @@ EOF
cat <<EOF > /etc/openvpn/clients/$node-route-up.sh
#!/bin/sh
TOPO=$VPNTYPE
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'\`
......@@ -358,8 +359,12 @@ mkdir -p /etc/iproute2
echo $aggnum $aggprefix >> /etc/iproute2/rt_tables
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
server=$VPN_SERVER
if [ ! \$TOPO = "$TOPO_SUBNET" ]; then
server=`ip -br addr show tun-$aggprefix | sed -nre "s/^tun-$aggprefix[ \t]+.*peer ([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)\/.*$/\1/p"`
fi
ip route add $mlan_CIDR via \$server dev tun-$aggprefix table $aggprefix
ip route add 192.168.0.0/16 via \$server dev tun-$aggprefix table $aggprefix
ifconfig \$BRNAME $agg_gw netmask $agg_mask up
ip route add $agg_cidr dev \$BRNAME table $aggprefix
iptables -I FORWARD -o tun-$aggprefix -i \$BRNAME -j ACCEPT
......
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