From 338673c29a3fa8fbd8fca9aebedf2ca5545e3215 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 4 Jul 2002 15:41:51 +0000 Subject: [PATCH] Improve handling of PREROUTING for NAT git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@102 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/firewall | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Shorewall/firewall b/Shorewall/firewall index b91fbccc9..454e4c18c 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -1206,7 +1206,7 @@ setup_nat() { -j DNAT --to-destination $internal fi else - run_iptables -t nat -A PREROUTING -i $interface \ + addnatrule `input_chain $interface` \ -d $external -j DNAT --to-destination $internal run_iptables -t nat -A POSTROUTING -o $interface \ -s $internal -j SNAT --to-source $external @@ -2843,6 +2843,13 @@ activate_rules() { multi_interfaces=`find_interfaces_by_option multi` + for interface in $all_interfaces; do + chain=`input_chain $interface` + + havenatchain $chain && \ + run_iptables -t nat -A PREROUTING -i $interface -j $chain + done + for zone in $zones; do eval source_hosts=\$${zone}_hosts