Home

IPTables unix/linux firewall, simple commands

Posted by Simon on April 02, 2007 at 09:56 PM

Categories: unix

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....

Missing

Comments

There are 0 comments on this post. Post yours →

Post a comment

Required fields in bold.

 

Browse Old Articles

Categories:

Subscribe to:

Blogroll: