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.