"Fix" The problem that the CentOS firewall does not start

Source: Internet
Author: User

[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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.