9 # OpenVPN uses addresses in 10.<nodeid>/16 block. Avoid collisions with
10 # this block. NAT interface is not advertised and so does not require
11 # unique address throughout the topology. But the address of each slice's
12 # NAT interface must be unique on a single node.
24 ip link add name $ETUN0 type veth peer name $ETUN1
25 ifconfig $ETUN1 $EXTNET up
27 ### Put a process in the vserver so we can move the interface there
28 su $SLICE -c "sleep 30 &"
29 PID=`su $SLICE -c "pgrep -n sleep"`
30 ip link set $ETUN0 netns $PID
31 naddress --add --nid $SLICEID --ip $INTNET
34 su $SLICE -c "sudo /sbin/ifconfig $ETUN0 $INTNET up; \
35 sudo /sbin/route add default gw $EXTIP; \
36 sudo /sbin/ifconfig lo 127.0.0.1/8 up"
38 ip rule add dev eth0 fwmark $KEY table $KEY
39 ip route add table $KEY default via $INTIP
40 iptables -t mangle -A PREROUTING -i $ETUN1 -j CONNMARK --set-mark $KEY