X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=setup-egre-link;h=16c366acd0baf78d3fa5bcf138eaf08c834f47c9;hb=c7090be37dc8dbb73692b543e3a0a5e5a4d28d33;hp=829756df572993dda9d74493758319d1baa6f509;hpb=e4d85917a4dc6fe4cd3dd55abb8eb1f957468d15;p=nodemanager-topo.git diff --git a/setup-egre-link b/setup-egre-link index 829756d..16c366a 100755 --- a/setup-egre-link +++ b/setup-egre-link @@ -9,7 +9,9 @@ REMOTE=$3 KEY=$4 RATE=$5 VIRTIP=$6 +VIRTNET=$7 +SUBNET=`expr match "$VIRTNET" '.*\(/[0-9]*\)'` LINK=${KEY}x${NODEID} modprobe ip_gre @@ -38,12 +40,12 @@ ifconfig $BRIDGE up 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