Configure Firewall operation instances (enable, stop, enable, and disable ports) in centos)

Source: Internet
Author: User

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 <press enter>

 

Stop Firewall:

[Root @ localhost ~] # Service iptables stop <press enter>

 

Start Firewall:

[Root @ localhost ~] # Service iptables start <press enter>

 

Restart Firewall:

[Root @ localhost ~] # Service iptables restart <press enter>

 

Permanently disable the Firewall:

[Root @ localhost ~] # Chkconfig iptables off <press enter>

 

Enable after permanent shutdown:

[Root @ localhost ~] # Chkconfig iptables on <press enter>

 

 

1. view the Firewall Status

[Root @ localhost ~] # Service iptables status <press enter>

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

3. Add port 8080 and port 9990 as needed

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

[Root @ localhost ~] # Service iptables restart <press enter>

5. view the firewall status again

[Root @ localhost ~] # Service iptables status <press enter>

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.

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.