How to configure CentOSiptables firewall

Source: Internet
Author: User
After installing LNMP, centos found that Port 80 on the webpage could not be accessed. it was not very familiar with the CentOS system, but there were also a lot of VPS that I encountered for the first time. Calm down and think about it. Will it be the reason for the firewall? The iptables method is successfully configured to solve the problem from where du Niang learned. The following are several commands for later viewing. Root@centoscn.com ~ #/Etc/init. d/iptablesstatus # Check ip centos. after LNMP is installed, it is found that Port 80 on the webpage cannot be accessed. it is not very familiar with the CentOS system, but there are also a lot of VPS, the first time I encountered such a problem.
Calm down and think about it. Will it be the reason for the firewall? The iptables method is successfully configured to solve the problem from where du Niang learned. The following are several commands for later viewing.
Root@centoscn.com ~ #/Etc/init. d/iptables status # View iptables firewall configuration information (it seems that you can also check whether the firewall is enabled)
Root@centoscn.com ~ #/Sbin/iptables-I INPUT-p tcp -- dport 80-j ACCEPT # Add port 80
Root@centoscn.com ~ # Service iptables save # save configuration information
Root@centoscn.com ~ # Service iptables restart/start/stop # restart/enable/disable the iptables firewall service
Root@centoscn.com ~ #/Etc/init. d/iptables stop # Disable the CentOs iptables firewall
Root@centoscn.com ~ # Chkconfig-level 35 iptables off # permanently disable the CentOs iptables firewall and cancel the automatic startup of the CentOs iptables firewall
Remember to save service iptables after adding firewall rules.

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.