## List Current Firewall Rules
`iptables -L`
This command lists all the current firewall rules loaded into IPtables.
## Open a port in IPtables – CentOS 6
`iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT`
`service iptables save`
## Open a port in IPtables – CentOS 7
`firewall-cmd --zone=public --add-port=80/tcp --permanent`
`firewall-cmd --reload`
## Close a port in IPtables – CentOS 6
`iptables -I INPUT -p tcp -m tcp --dport 80 -j REJECT`
`service iptables save`
## Close a port in IPtables – CentOS 7
`firewall-cmd --zone=public --remove-port=80/tcp`
`firewall-cmd --runtime-to-permanent`
`firewall-cmd --reload`