What if centos 6.5 does not have a firewall file ?, Centos6.5

Source: Internet
Author: User

What if centos 6.5 does not have a firewall file ?, Centos6.5

1. The general cause is that no firewall is configured and the firewall has been disabled when the CentOS system is installed.

In this way, the firewall cannot be started using the service iptables start statement.

2. Write an iptables command to configure a firewall rule: (execute this command anywhere)

Iptables-P OUTPUT ACCEPT

3. Save iptables changes

Service iptables save

4. Now you can see the/etc/sysconfig/iptables file.

5. Run vim/etc/sysconfig/iptables to open the file, add port 22 of ssh to it, and save

-A input-m state -- state NEW-m tcp-p tcp -- dport 22-j ACCEPT

6. Start the Firewall

Service iptables start

Note:

If you use SSH to connect and modify this configuration, add port 22 to start the firewall. Otherwise, the ssh connection may fail.

Write an iptables command to configure firewall rules:

Iptables-P OUTPUT ACCEPT

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.