1. Enable and disable IPtables
1. Takes effect after restart
Enable: chkconfig iptables on
Close: chkconfig iptables off or chkconfig-level 35 iptables off
2. It takes effect immediately and becomes invalid after restart
Enable: service iptables start
Disable: service iptables stop
Temporarily disable the firewall:/etc/init. d/iptables stop
Restart iptables:/etc/init. d/iptables restart
2. View the firewall's iptables status:
/Etc/init. d/iptables status
3. Open ports 3306, 80, and in the IPtables firewall
/Sbin/iptables-I INPUT-p tcp-dport 80-j ACCEPT
/Sbin/iptables-I INPUT-p tcp-dport 22-j ACCEPT
/Sbin/iptables-I INPUT-p tcp-dport 3306-j ACCEPT
Then save:
/Etc/rc. d/init. d/iptables save
Well, the switch operation on the firewall in iptalbes is actually a very simple command with the same/sbin/iptables-I INPUT-p tcp-dport followed by a port, the other is simple acceptance. You can set it as needed.