Friday, March 23, 2012


Here is some basic iptable rules.  Thanks goes to the cloud support team at Rackspace.  

This rule appends the rule.  This particular rule  opens inbound port 5432 to the ipaddress 111.222.33.44


iptables -A RH-Firewall-1-INPUT -p tcp -s 111.222.33.44 --dport 5432 -j ACCEPT

This rule inserts the rule at the start of the chain.  

iptables -I RH-Firewall-INPUT -s 111.222.33.44 -p tcp -m tcp --dport 5432 -j ACCEPT

After adding rules you need to issue this command to save the rules.

service iptables save

After saving you need to issue the restart command
service iptables restart

If you want to see the available chains in your firewall use this command:
iptables -L