CentOS System Firewall Port configuration instance (starting, stopping, opening, closing)

Source: Internet
Author: User
Tags centos iptables

  Note: Basic operation commands for firewalls:

  code is as follows copy code
query Firewall status:
[root@localhost ~]# service   Status
 
To stop the firewall:
[root@localhost ~]# service   iptables stop
 
Start firewall:
[ Root@localhost ~]# service   iptables start
 
Restart firewall:
[root@localhost ~]#] service   iptables Restart
 
to permanently shut down the firewall:
[root@localhost ~]# chkconfig   off
Iptables;
Enable after permanent shutdown:
[root@localhost ~]# chkconfig   iptables on

 
strong> The following is an example operation:

1. View firewall status
[Root@localhost ~]# service iptables status
2, edit/etc/sysconfig/iptables file. In our case, we're going to open port 8080 and port 9990.
Open/etc/sysconfig/iptables with editor
3, according to gourd painting scoop, we add 8080 ports and 9990 ports
4, save the/etc/sysconfig/iptables file, and in the terminal implementation
[root@localhost ~]# Service iptables restart
5, the new view firewall status
[Root@localhost ~]# service iptables status

6, this time, the server's 8080 and 9990 ports can provide services to the outside.

7, other ports open mode is similar to this 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.