13 # OpenVPN uses addresses in 10.<nodeid>/16 block. Avoid collisions with
14 # this block. NAT interface is not advertised and so does not require
15 # unique address throughout the topology. But the address of each slice's
16 # NAT interface must be unique on a single node.
23 echo $ETUN0,$ETUN1 > /sys/module/etun/parameters/newif
24 ifconfig $ETUN1 $BASE.1/24 up
26 /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
27 /sbin/iptables -A FORWARD -i eth0 -o $ETUN1 -m state --state RELATED,ESTABLISHED -j ACCEPT
28 /sbin/iptables -A FORWARD -i $ETUN1 -o eth0 -j ACCEPT
30 ### Put a process in the vserver so we can move the interface there
31 su $SLICE -c "sleep 30" &
33 PID=`su $SLICE -c "pgrep sleep"`
34 chcontext --ctx 1 -- echo $PID > /sys/class/net/$ETUN0/new_ns_pid
37 su $SLICE -c "sudo /sbin/ifconfig $ETUN0 $BASE.2/24 up; \
38 sudo /sbin/route add -net $BASE.0/24 $ETUN0; \
39 sudo /sbin/route add default gw $BASE.1"