iptables -t filter -N MINIUPNPD 2>/dev/null
iptables -t nat -N MINIUPNPD 2>/dev/null
+iptables -t nat -N MINIUPNPD-POSTROUTING 2>/dev/null
[ -x $IP6TABLES ] && $IP6TABLES -t filter -N MINIUPNPD 2>/dev/null
# IPv4 - due to NAT, need to add both to nat and filter table
iptables -t filter -I zone_${ext_zone}_forward -j MINIUPNPD
iptables -t nat -I zone_${ext_zone}_prerouting -j MINIUPNPD
+ iptables -t nat -I zone_${ext_zone}_postrouting -j MINIUPNPD-POSTROUTING
# IPv6 if available - filter only
[ -x $IP6TABLES ] && {
add_extzone_rules $(fw3 -q network "$ext_iface")
done
+add_extzone_rules $(uci -q get upnpd.config.external_zone)
+
[ ! $ADDED = 0 ] && exit 0
-# If it's not available, resort to network_find_wan{,6} and
+
+# If really nothing is available, resort to network_find_wan{,6} and
# assume external interfaces all have same firewall zone.
+# (This heuristic may fail horribly, in case of e.g. multihoming, so
+# please set external_zone in that case!)
+
network_find_wan wan_iface
network_find_wan6 wan6_iface