Basic firewall operation commands in CentOS

Source: Internet
Author: User
CentOS configures firewall operation instances (start, stop, open, and close ports): Note: basic firewall operation command: query firewall status: [root @ localhost ~] # Serviceiptablesstatus & lt; press enter & gt; stop firewall: [root @ localhost ~] # Service & nbsp

CentOS configures firewall operation instances (enable, stop, enable, and disable ports ):

 

Note: basic firewall operation commands:

Query the firewall status:

[Root @ localhost ~] # Service iptables status <回车>

 

Stop firewall:

[Root @ localhost ~] # Service iptables stop <回车>

 

Start firewall:

[Root @ localhost ~] # Service iptables start <回车>

 

Restart firewall:

[Root @ localhost ~] # Service iptables restart <回车>

 

Permanently disable the firewall:

[Root @ localhost ~] # Chkconfig iptables off <回车>

 

Enable after permanent shutdown:

[Root @ localhost ~] # Chkconfig iptables on <回车>

 

 

1. view the firewall status

[Root @ localhost ~] # Service iptables status <回车>

 

2. edit the/etc/sysconfig/iptables file. Port 8080 and Port 9990 must be enabled in our instance.

Open/etc/sysconfig/iptables in the editor

 

4. Save the/etc/sysconfig/iptables file and run the command on the terminal.

[Root @ localhost ~] # Service iptables restart <回车>

 

5. view the firewall status again

[Root @ localhost ~] # Service iptables status <回车>

 

6. at this time, ports 8080 and 9990 of the server can provide external services.

7. the open mode of other ports is similar to the open mode.

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.