add masquerading rules in olsrd init if hna for lan is not present
authorFelix Fietkau <nbd@openwrt.org>
Mon, 9 Oct 2006 18:06:31 +0000 (18:06 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 9 Oct 2006 18:06:31 +0000 (18:06 +0000)
SVN-Revision: 4995

openwrt/package/olsrd/files/olsrd.init

index a72353d7caee0cb8bcb6142ebbf7e434822d0c84..1f99097f7011d1fd586a4ea7543c4d7279b6f348 100644 (file)
@@ -31,9 +31,13 @@ EOF
                        cat /etc/olsrd.conf
                ) | awk -f /usr/lib/parse-config.awk > /tmp/olsrd.conf
                iptables -D forwarding_rule -i "$wifi_ifname" -j ACCEPT 2>/dev/null >/dev/null # no duplicates please
-               iptables -D forwarding_rule -o "$wifi_ifname" -j ACCEPT 2>/dev/null >/dev/null # no duplicates please
+               iptables -D forwarding_rule -o "$wifi_ifname" -j ACCEPT 2>/dev/null >/dev/null 
                iptables -A forwarding_rule -i "$wifi_ifname" -j ACCEPT
                iptables -A forwarding_rule -o "$wifi_ifname" -j ACCEPT
+               [ -z "$HNA_IP" ] && {
+                       iptables -t nat -D POSTROUTING -o "$wifi_ifname" -j MASQUERADE 2>/dev/null >/dev/null
+                       iptables -t nat -A POSTROUTING -o "$wifi_ifname" -j MASQUERADE
+               }
                olsrd $OPTIONS
   ;;
  *)