Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
networking:linux:iptables [20 years ago - 2005/11/30 03:24] aogailnetworking:linux:iptables [19 years ago - 2007/05/28 06:45] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== iptables ======
 +
 +===== Accept a Port/range =====
 +  # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
 +
 +
 +===== Forward a Port/range =====
 +  * **Add the forwarding rule**
 +
 +  # iptables -t nat -I PREROUTING -i ethExternal -p tcp --dport 4662 -j DNAT --to 192.168.0.11:4662
 +
 +  * **Enable forwarding rule**
 +
 +  # iptables -I FORWARD -i ethExternal -p tcp -d 192.168.0.11/32 --dport 4662 -j ACCEPT
 +
 +  * **Add forwarding rule for internal hosts**
 +
 +  # iptables -I FORWARD -i ethExternal -p tcp -s 192.168.0.11/32 --dport 4662 -j ACCEPT
 +
 +===== Reference Links =====
 +  * [[http://www.informit.com/articles/article.asp?p=421057&rl=1|InformIT iptables]]