Firewall configuration_centos firewall iptables operation usage

Source: Internet
Author: User
The firewall in centos is a very powerful function, but it has been upgraded in the firewall in centos. Let's take a look at the usage of the firewall in centos in detail.

Basic firewall operationsCommand

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

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 <回车>

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.

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.