[Author]: Kwu
The CentOS firewall cannot be started, and the online server needs to turn on the Firewall service, which is the most direct and effective way to protect Linux system security.
1. If there is
Service Iptables Start
Service Iptables Restart
When the firewall cannot be started/restarted.
2, the best way is to modify the configuration file
Vi/etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall# Manual customization of this file is not recommended.*filter:i Nput Accept [0:0]:forward Accept [0:0]:output Accept [0:0]-a input-m State--state established,related-j accept-a INPUT -p icmp -j ACCEPT-A INPUT -i lo -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT-A INPUT -j REJEC T--reject-with icmp-host-prohibited-a forward-j reject--reject-with icmp-host-prohibitedcommit
And then start the firewall.
Service Iptables Start
View Firewall Services
Service Iptables Status
3. If you need to open the exception port, add the following configuration:
Vi/etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall# Manual customization of this file is not recommended.*filter:i Nput Accept [0:0]:forward Accept [0:0]:output Accept [0:0]-a input-m State--state established,related-j accept-a INPUT -p icmp -j ACCEPT-A INPUT -i lo -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT-A INPUT -m state --state new-m tcp-p tcp--dport 3306-j accept-a input-j REJECT--reject-with icmp-host-prohibited-a forward-j REJECT --reject-with Icmp-host-prohibitedcommit
As above, 3306 service ports have been added
"Fix" The problem that the CentOS firewall does not start