KEY=$4
RATE=$5
VIRTIP=$6
+VIRTNET=$7
+SUBNET=`expr match "$VIRTNET" '.*\(/[0-9]*\)'`
LINK=${KEY}x${NODEID}
modprobe ip_gre
iptables -t mangle -A FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID
### Put a process in the vserver so we can move the interface there
-su $SLICE -c "sleep 60" &
+su $SLICE -c "sleep 30" &
sleep 1
PID=`su $SLICE -c "pgrep sleep"`
chcontext --ctx 1 -- echo $PID > /sys/class/net/$ETUN0/new_ns_pid
sleep 1
-su $SLICE -c "sudo /sbin/ifconfig $ETUN0 $VIRTIP/24 up"
+su $SLICE -c "sudo /sbin/ifconfig $ETUN0 ${VIRTIP}${SUBNET} up; sudo /sbin/route add -net $VIRTNET dev $ETUN0"
### Set rate
tc qdisc add dev $EGRE root handle 1: htb default 10