14 echo $ETUN0,$ETUN1 > /sys/module/etun/parameters/newif
15 ifconfig $ETUN1 10.0.$KEY.1 up
17 /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
18 /sbin/iptables -A FORWARD -i eth0 -o $ETUN1 -m state --state RELATED,ESTABLISHED -j ACCEPT
19 /sbin/iptables -A FORWARD -i $ETUN1 -o eth0 -j ACCEPT
21 ### Create "grab link" script
22 GRAB=/vsys/local_grab-$ETUN0
23 echo $SLICE > $GRAB.acl
30 chcontext --ctx 1 -- echo \$PID > /sys/class/net/$ETUN0/new_ns_pid
34 ### Create "delete link" script
35 DELETE=/vsys/local_delete-$ETUN0
36 echo $SLICE > $DELETE.acl
43 # Remove iptables rules
44 /sbin/iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
45 /sbin/iptables -D FORWARD -i eth0 -o $ETUN1 -m state --state RELATED,ESTABLISHED -j ACCEPT
46 /sbin/iptables -D FORWARD -i $ETUN1 -o eth0 -j ACCEPT
48 # Get rid of etun devices, only need name of one of them
49 echo $ETUN1 > /sys/module/etun/parameters/delif
53 rm -f $DELETE $DELETE.acl