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 220.127.116.11
iptables -A RH-Firewall-1-INPUT -p tcp -s 18.104.22.168 --dport 5432 -j ACCEPT
This rule inserts the rule at the start of the chain.
iptables -I RH-Firewall-INPUT -s 22.214.171.124 -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: