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

openwrt/package/comgt/files/wwan.iface

index fe3663e0ce1fea750a29eb126f03d410257eb750..4e9c1c2f799e26128e6d286fc722849851fa44f0 100644 (file)
@@ -1,9 +1,17 @@
 [ "$INTERFACE" = "wwan" ] && {
+       WWAN="$(nvram get wwan_ifname)"
        case "$ACTION" in
                ifup)
+                       iptables -I LAN_ACCEPT 1 -i "$WWAN" -j RETURN
+                       iptables -A FORWARD -o "$WWAN" -j ACCEPT
+                       iptables -t nat -A POSTROUTING -o "$WWAN" -j MASQUERADE 
                        echo 0 > /proc/diag/led/3g_blink
                ;;
                ifdown)
+                       iptables -D LAN_ACCEPT -i "$WWAN" -j RETURN
+                       iptables -D FORWARD -o "$WWAN" -j ACCEPT
+                       iptables -t nat -D POSTROUTING -o "$WWAN" -j MASQUERADE 
+                       echo 0 > /proc/diag/led/3g_blink
                        echo 0 > /proc/diag/led/3g_blue
                        echo 0 > /proc/diag/led/3g_green
                        echo 0 > /proc/diag/led/3g_blink