Simon Says : IPTables unix/linux firewall, simple commands
A weblog by Simon Woodside
IPTables unix/linux firewall, simple commands
Since all the iptables documentation out there is super complicated, here's something really simple.
To see all of the ports that are open, run:
sudo iptables --list
To add a new rule (to open a new port, e.g. 8080):
sudo iptables -A tcp_in -p tcp -d my.hostname.com --destination-port 8080 -j allowed
That's assuming you have a chain called "tcp_in" of course...
And to delete a rule, run iptables --list,
count the number of the rule (the index #) and then:
sudo iptables -D tcp_in [index]
Simple enough....

