2 # Copyright (C) 2006 OpenWrt.org
10 iptables
-F output_rule
11 iptables
-F forwarding_rule
12 iptables
-t nat
-F prerouting_rule
13 iptables
-t nat
-F postrouting_rule
15 ### BIG FAT DISCLAIMER
16 ## The "-i $WAN" is used to match packets that come in via the $WAN interface.
17 ## it WILL NOT MATCH packets sent from the $WAN ip address -- you won't be able
18 ## to see the effects from within the LAN.
21 ## -- This allows port 22 to be answered by (dropbear on) the router
22 # iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j ACCEPT
23 # iptables -A input_rule -i $WAN -p tcp --dport 22 -j ACCEPT
26 ## -- This forwards port 8080 on the WAN to port 80 on 192.168.1.2
27 # iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 8080 -j DNAT --to 192.168.1.2:80
28 # iptables -A forwarding_rule -i $WAN -p tcp --dport 80 -d 192.168.1.2 -j ACCEPT
31 ## -- Connections to ports not handled above will be forwarded to 192.168.1.2
32 # iptables -t nat -A prerouting_rule -i $WAN -j DNAT --to 192.168.1.2
33 # iptables -A forwarding_rule -i $WAN -d 192.168.1.2 -j ACCEPT
This page took 0.044629 seconds and 5 git commands to generate.