Add 'manual' topology mode for manually specifying rspecs
[nodemanager-topo.git] / teardown-nat
index c1029b4..2d09d55 100644 (file)
@@ -3,13 +3,12 @@
 KEY=$1
 ETUN1=natx$KEY
 
-# Remove iptables rules
-/sbin/iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
-/sbin/iptables -D FORWARD -i eth0 -o $ETUN1 -m state --state RELATED,ESTABLISHED -j ACCEPT
-/sbin/iptables -D FORWARD -i $ETUN1 -o eth0 -j ACCEPT
+iptables -t mangle -D PREROUTING -i $ETUN1 -j CONNMARK --set-mark $KEY
+
+ip rule del dev eth0 fwmark $KEY table $KEY
 
 # Get rid of etun devices, only need name of one of them
-echo $ETUN1 > /sys/module/etun/parameters/delif
+ip link delete dev $ETUN1