comgt: make firewalling changes when umts goes up or down
authorFelix Fietkau <nbd@openwrt.org>
Thu, 9 Nov 2006 05:40:27 +0000 (05:40 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 9 Nov 2006 05:40:27 +0000 (05:40 +0000)
SVN-Revision: 5476

package/comgt/files/3g.iface

index a8476ca..cd4e4cc 100644 (file)
@@ -3,8 +3,19 @@ config_load network
 scan_interfaces
 config_get proto "$INTERFACE" proto
 [ "$proto" = "3g" ] && {
+       config_get iface "$INTERFACE" ifname
        case "$ACTION" in
-               ifup) set_3g_led 1 1 0;;
-               ifdown) set_3g_led 0 0 0;;
+               ifup)
+                       iptables -I LAN_ACCEPT 1 -i "$iface" -j RETURN
+                       iptables -A FORWARD -o "$iface" -j ACCEPT
+                       iptables -t nat -A POSTROUTING -o "$iface" -j MASQUERADE 
+                       set_3g_led 1 1 0
+               ;;
+               ifdown)
+                       iptables -D LAN_ACCEPT -i "$iface" -j RETURN
+                       iptables -D FORWARD -o "$iface" -j ACCEPT
+                       iptables -t nat -D POSTROUTING -o "$iface" -j MASQUERADE 
+                       set_3g_led 0 0 0
+               ;;
        esac
 }