#!/bin/sh
#

del_portfwd () {
DESTPORT=$1
DESTIP=$2
SRCPORT=$3
SRCIP=$4
SRCIFACE=$5

iptables -t nat -D PREROUTING -p tcp -i $SRCIFACE --dport $SRCPORT -j DNAT --to-destination $DESTIP:$DESTPORT
iptables -D FORWARD -p tcp -d $SRCIP --dport $SRCPORT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

}

del_portfwd 80 192.168.0.100 81 192.168.7.2 usb0
del_portfwd 80 192.168.0.100 81 `ifconfig eth0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'` eth0
del_portfwd 80 192.168.0.100 81 `ifconfig tun5 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'` tun5
