Add an exception port to the centos Firewall

Source: Internet
Author: User

Step 2: Connect to the centos system by using the local machine or SSH, run the "/sbin/iptables-I input-P TCP -- dport 3306-J accept" command, and confirm.

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. Respect Original reprinted web site http://www.pc811.com/6/7/26004.html

Step 2: Run the "/etc/init. d/iptables startus" command to view the port information that has just been added to the firewall exception.

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: Execute the "service iptables restart" command and make sure that the firewall is started after four OK prompts are displayed. Then, all the exceptional port numbers added in step 1st of this article will take effect.

Add an exception port to the centos Firewall

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.