aboutsummaryrefslogtreecommitdiffstats
path: root/package/iptables/files/firewall.user
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-10-13 22:51:49 +0200
committerFelix Fietkau <nbd@openwrt.org>2016-03-20 17:29:15 +0100
commit60c1f0f64d23003a19a07d6b9638542130f6641d (patch)
tree8fb2787f4c49baded97cd55e0c371fe1cffce2b6 /package/iptables/files/firewall.user
parentd58a09110ccfa95f06c983fe796806f2e035c9d2 (diff)
parentb3ce218b51746d3a576221ea542facf3a1703ab2 (diff)
downloadupstream-60c1f0f64d23003a19a07d6b9638542130f6641d.tar.gz
upstream-60c1f0f64d23003a19a07d6b9638542130f6641d.tar.bz2
upstream-60c1f0f64d23003a19a07d6b9638542130f6641d.zip
finally move buildroot-ng to trunk
Diffstat (limited to 'package/iptables/files/firewall.user')
-rw-r--r--package/iptables/files/firewall.user28
1 files changed, 28 insertions, 0 deletions
diff --git a/package/iptables/files/firewall.user b/package/iptables/files/firewall.user
new file mode 100644
index 0000000000..5f295babf2
--- /dev/null
+++ b/package/iptables/files/firewall.user
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Copyright (C) 2006 OpenWrt.org
+
+iptables -F input_rule
+iptables -F output_rule
+iptables -F forwarding_rule
+iptables -t nat -F prerouting_rule
+iptables -t nat -F postrouting_rule
+
+### BIG FAT DISCLAIMER
+## The "-i $WAN" is used to match packets that come in via the $WAN interface.
+## it WILL NOT MATCH packets sent from the $WAN ip address -- you won't be able
+## to see the effects from within the LAN.
+
+### Open port to WAN
+## -- This allows port 22 to be answered by (dropbear on) the router
+# iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j ACCEPT
+# iptables -A input_rule -i $WAN -p tcp --dport 22 -j ACCEPT
+
+### Port forwarding
+## -- This forwards port 8080 on the WAN to port 80 on 192.168.1.2
+# iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 8080 -j DNAT --to 192.168.1.2:80
+# iptables -A forwarding_rule -i $WAN -p tcp --dport 80 -d 192.168.1.2 -j ACCEPT
+
+### DMZ
+## -- Connections to ports not handled above will be forwarded to 192.168.1.2
+# iptables -t nat -A prerouting_rule -i $WAN -j DNAT --to 192.168.1.2
+# iptables -A forwarding_rule -i $WAN -d 192.168.1.2 -j ACCEPT