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