13 VIRTNET=`echo $VIRTIP|sed "s/\.[23]$/.0/"`
21 $IP tunnel add $EGRE mode gre/eth remote $REMOTE key $KEY ttl 64
27 echo $ETUN0,$ETUN1 > /sys/module/etun/parameters/newif
28 ifconfig $ETUN0 mtu 1458 up
34 brctl addif $BRIDGE $EGRE
35 brctl addif $BRIDGE $ETUN1
38 ### Setup iptables so that packets are visible in the vserver
39 iptables -t mangle -A FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID
41 ### Put a process in the vserver so we can move the interface there
42 su $SLICE -c "sleep 30" &
44 PID=`su $SLICE -c "pgrep sleep"`
45 chcontext --ctx 1 -- echo $PID > /sys/class/net/$ETUN0/new_ns_pid
47 su $SLICE -c "sudo /sbin/ifconfig $ETUN0 $VIRTIP/24 up; sudo /sbin/route add -net $VIRTNET/24 dev $ETUN0"
50 tc qdisc add dev $EGRE root handle 1: htb default 10
51 tc class add dev $EGRE parent 1: classid 1:10 htb rate $RATE ceil $RATE