Set up IP Tables

IP Tables is software that ships with most linux OS’s and is used as a firewall to control the flow of traffic in and out of the machine. Its design is meant to allow for chaining rules so that rules that appear farther down take precedence over the rules that appear at the top. Editing these rules can be a bit scary, and there is usually a gui tool that can be used to configure this. In fact the file itself recommends use of the visual tool for creating rules. In case you have a healthy dose of confidence, here’s how to open up ports manually with a text editor.

[root@bedrock ~]# vi /etc/sysconfig/iptables

You’ll see a bunch of text. I’m not 100% sure what each line means but I understand that its somehow based of a chained set of rules that modify/allow/affect all network traffic. We’re going to add 2 rules here:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

You’ll want to add these near other ACCEPT commands are placed. Location is important because of the way the rules chain. Don’t quote me on that. Basically, these are rules that open up and allow network access across 2 ports – 8080 and 5432, jboss and postgres respectively. Finally, you’re going to need to restart iptables for the changes to take effect:

[root@bedrock ~]# service iptables restart

 
    Twitter
  • del.icio.us
  • Reddit
  • Technorati
  • Google Bookmarks
  • Blogplay
  • Yahoo! Buzz
  • LinkedIn
  • Facebook
  • Digg

Related posts:

  1. Configre Sendmail
  2. Set up multiple IPs on a single NIC
  3. Set up Jboss 5.1 as a service
Posted on January 2, 2010 at 8:30 pm by Ant · Permalink
In: Fedora · Tagged with: , ,

Leave a Reply