Add an exception port to the CentOS Firewall

Source: Internet
Author: User

Step 5: Use the local machine or ssh to connect to the centos system, run the "/sbin/iptables-I INPUT-p tcp -- dport 1st-j ACCEPT" command, and confirm the method.
Note: If you want to open any port, write the port directly in the command. Generally, the default port for a web site is port 80, tomcat is port 8080, and mysql database is port 3306, the specific port numbers can be modified in your own software. To view the port information that has just been added to the firewall, run the "route /etc/init.d/iptables startus" command at http://www.pc811.com/6/7/26004.html2. Step 2: This is not completed. You must execute the "/etc/rc. d/init. d/iptables save" command and confirm.
Note: If you do not execute this command, the port number added in step 1 will be invalid after the computer is restarted or the firewall is restarted, the exception port added at Step 1 does not take effect. Step 2: run the "service iptables restart" command and make sure that the firewall is started when four OK prompts are displayed. All the exceptional port numbers added in step 2 of this article will take effect.

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.