centOS6.9 Firewall shutdown and open

Source: Internet
Author: User

Sometimes, we need to operate the firewall of the system, and today we will explain how to turn on and off the firewall under the CentOS6.9 system.

Input: Cat/etc/issue view version


(i) Through service orders

Service command on and off firewall for immediate effect, the next time you restart the machine will automatically recover.

View firewall Status: Service iptables status, remember in CentOS6.9 is input iptables, some online tutorials using service iptable Status command is not feasible.



Shutdown Firewall: Service iptables stop



Open firewall: Service iptables start

Summarize:

Open firewall: Service iptables start

Shutdown Firewall: Service iptables stop

View firewall Status: Service iptables status


(ii) through:/etc/init.d/iptables operation

View firewall Status:/etc/init.d/iptables/status


Shutdown firewall:/etc/init.d/iptables Stop (this is a temporary shutdown, shutdown is currently running the firewall, reboot after the firewall will start, because it is boot-initiated)


This is a temporary shutdown, shutdown is currently running the firewall, reboot after the firewall will start, because it is boot, it is equivalent to/etc/init.d/iptables start

(iii) need to turn on the boot does not start, using the Chkconfig command

Permanently open firewall: Chkconfig iptables on

View status: Chkconfig--list iptables


To permanently shut down the firewall:

Chkconfig iptables off



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.