aboutsummaryrefslogtreecommitdiffstats
path: root/package/iptables/files/firewall.awk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-12-20 05:58:41 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-12-20 05:58:41 +0000
commit86709475a5510b3b5b8a8ca89144f6296846c394 (patch)
tree0505a01d11bbf88fb083611f4af19504bb409a98 /package/iptables/files/firewall.awk
parent7a716184163e5143d66ba81f85be16936ebcffb0 (diff)
downloadupstream-86709475a5510b3b5b8a8ca89144f6296846c394.tar.gz
upstream-86709475a5510b3b5b8a8ca89144f6296846c394.tar.bz2
upstream-86709475a5510b3b5b8a8ca89144f6296846c394.zip
prepare for moving part of the firewall to hotplug. created new chains {input,forwarding,prerouting}_wan for wan port forwardings and updated the examples. syntax of /etc/config/firewall unchanged and old firewall.user files are still compatible
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5878 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/iptables/files/firewall.awk')
-rw-r--r--package/iptables/files/firewall.awk24
1 files changed, 5 insertions, 19 deletions
diff --git a/package/iptables/files/firewall.awk b/package/iptables/files/firewall.awk
index 902c7b1888..31dbae0f33 100644
--- a/package/iptables/files/firewall.awk
+++ b/package/iptables/files/firewall.awk
@@ -1,20 +1,6 @@
# Copyright (C) 2006 OpenWrt.org
BEGIN {
- print "ifname=\"$WAN\""
- print "[ -z \"$ifname\" ] && exit"
- print ""
- print "iptables -X input_$ifname 2>&- >&-"
- print "iptables -N input_$ifname"
- print "iptables -X forward_$ifname 2>&- >&-"
- print "iptables -N forward_$ifname"
- print "iptables -t nat -X prerouting_$ifname 2>&- >&-"
- print "iptables -t nat -N prerouting_$ifname"
- print ""
- print "iptables -A input_rule -i \"$ifname\" -j input_$ifname"
- print "iptables -A forwarding_rule -i \"$ifname\" -j forward_$ifname"
- print "iptables -t nat -A prerouting_rule -i \"$ifname\" -j prerouting_$ifname"
- print ""
FS=":"
}
@@ -32,15 +18,15 @@ BEGIN {
($1 == "accept") {
target = " -j ACCEPT"
for (o in _opt) {
- print "iptables -t nat -A prerouting_$ifname" _opt[o] str2ipt($2) target
- print "iptables -A input_$ifname " _opt[o] str2ipt($2) target
+ print "iptables -t nat -A prerouting_wan" _opt[o] str2ipt($2) target
+ print "iptables -A input_wan " _opt[o] str2ipt($2) target
print ""
}
}
($1 == "drop") {
for (o in _opt) {
- print "iptables -t nat -A prerouting_$ifname" _opt[o] str2ipt($2) " -j DROP"
+ print "iptables -t nat -A prerouting_wan" _opt[o] str2ipt($2) " -j DROP"
print ""
}
}
@@ -57,8 +43,8 @@ BEGIN {
else fwopts = ""
}
for (o in _opt) {
- print "iptables -t nat -A prerouting_$ifname" _opt[o] str2ipt($2) target
- print "iptables -A forward_$ifname " _opt[o] " -d " $3 fwopts " -j ACCEPT"
+ print "iptables -t nat -A prerouting_wan" _opt[o] str2ipt($2) target
+ print "iptables -A forwarding_wan " _opt[o] " -d " $3 fwopts " -j ACCEPT"
print ""
}
}