#!/system/bin/sh
/system/bin/iptables -F
/system/bin/iptables -t nat -F
/system/bin/iptables --delete-chain 
/system/bin/iptables --table nat --delete-chain
/system/bin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
/system/bin/iptables -A FORWARD -i ppp0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
/system/bin/iptables -A FORWARD -i wlan0 -o ppp0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
/system/bin/setprop "net.interfaces.defaultroute" "gprs";

# Use interface name if linkname is not available
NAME=${LINKNAME:-"$1"}

/system/bin/setprop "net.$NAME.dns1" "$DNS1"
/system/bin/setprop "net.$NAME.dns2" "$DNS2" 
/system/bin/setprop "net.$NAME.local-ip" "$IPLOCAL" 
/system/bin/setprop "net.$NAME.remote-ip" "$IPREMOTE" 

