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
46 chcontext --ctx 1 -- echo \$PID > /sys/class/net/$ETUN0/new_ns_pid
50 echo $SLICE > $GRAB.acl
52 ### Create "delete link" script
53 DELETE=/vsys/delete-$ETUN0
54 rm -f $DELETE $DELETE.acl
60 # Remove iptables rule
61 iptables -t mangle -D FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID
63 # Get rid of etun devices, only need name of one of them
64 echo $ETUN1 > /sys/module/etun/parameters/delif
70 # Get rid of EGRE tunnel
75 rm -f $DELETE $DELETE.acl
80 echo $SLICE > $DELETE.acl