1. Basic operation
Check firewall status: service iptables status
Stop the firewall: service iptables stop
Start the firewall: service iptables start
Restart the firewall: service iptables restart
Permanently turn off the firewall: chkconfig iptables off
2. Check the firewall status, the firewall is on and only 22 ports are open
3. Open port 80
vim /etc/sysconfig/iptables
# Add the following code to compare two gourds:)
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
4. Restart the firewall after saving and exiting
service iptables restart
The same goes for opening other ports.