iptables firewall start, stop, and turn off port operation

Source: Internet
Author: User
Tags iptables
CentOS Configure the Firewall action instance (start, stop, open, closed port):
Note: Basic operation commands for firewalls:
Query firewall status: [root@localhost ~]# service iptables status
Stop firewall: [root@localhost ~]# service iptables stop
Start firewall: [root@localhost ~]# service iptables start
Reboot firewall: [root@localhost ~]# service iptables restart
Permanently shutdown firewall: [root@localhost ~]# chkconfig iptables off
Enable after permanent shutdown: [root@localhost ~]# chkconfig iptables on

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.


Shutdown-h now--shut down immediately shutdown-h 10:53 to 10:53 shutdown, if the time is less than the current time, then the next day shutdown-h +10--10 minutes after the automatic shutdown shutdown-r --Immediately reboot Shutdown-r +30 ' The System'll Reboot in mins '--reboot after 30 minutes and send a notification to other online users

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.