18 $IP tunnel add $EGRE mode gre/eth remote $REMOTE key $KEY
24 echo $ETUN0,$ETUN1 > /sys/module/etun/parameters/newif
25 ifconfig $ETUN0 mtu 1458 up
31 brctl addif $BRIDGE $EGRE
32 brctl addif $BRIDGE $ETUN1
35 ### Setup iptables so that packets are visible in the vserver
36 iptables -t mangle -A FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID
38 ### Create "grab link" script
39 GRAB=/vsys/grab-$ETUN0
40 echo $SLICE > $GRAB.acl
47 chcontext --ctx 1 -- echo \$PID > /sys/class/net/$ETUN0/new_ns_pid
51 ### Create "bind link" script
52 BIND=/vsys/bind-link-$ETUN0
53 echo $SLICE > $BIND.acl
62 tc qdisc add dev $EGRE root tbf rate \$rt latency \$lt burst \$burs
70 ### Create "unbind link" script
71 UNBIND=/vsys/unbind-link-$ETUN0
77 tc qdisc del root dev $EGRE
82 ### Create "delete link" script
83 DELETE=/vsys/delete-$ETUN0
84 echo $SLICE > $DELETE.acl
91 # Remove iptables rule
92 iptables -t mangle -D FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID
94 # Get rid of etun devices, only need name of one of them
95 echo $ETUN1 > /sys/module/etun/parameters/delif
101 # Get rid of EGRE tunnel
105 rm -f $GRAB $GRAB.acl
106 rm -f $DELETE $DELETE.acl
107 rm -f $BIND $BIND.acl
108 rm -f $UNBIND $UNBIND.acl