Centos Firewall open ports

80, 8080 linux system and other open ports, firewall settings


after us a lot of time to install the web service application on liunx systems (such as tomcat, apache, etc.), you need to let other computers access to the application, while the Linux system (centos, redhat etc.) firewall is open by default only 22 ports.
1. Turn off the firewall
with the root login, perform service iptables stop - stop 
 but in practical applications, turn off the firewall security to reduce server can not turn off the firewall.
 If telnet virtual machine host in the dos window 8080 window, it will fail, which can determine whether the virtual machine window of 8080 there is a problem, it should be blocked by the firewall. So you can modify firewall settings. 
Method 2. Modify centos firewall configuration file
to modify Linux system firewall configuration need to modify / etc / sysconfig / iptables this document, which port if you want to open, add an inside
 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT on it, which is to open 8080 port number, and then restart the linux firewall services,
 /etc/init.d/iptables restart. 
3. The method of using the open command
on the command line to add the external network port to allow access to external networks linux open LINUX open access port to allow access to the external network port LINUX can open to allow access to the external network port by the following commands:
 / sbin / iptables -I INPUT -p tcp --dport 8000 -j ACCEPT 
# Enable port 8000, the Save the /etc/rc.d/init.d/iptables script. 
# Save the configuration restart the /etc/rc.d/init.d/iptables script.
# Restart the service to see if the port is already open /etc/init.d/iptables status

More technical information may be concerned about: itheimaGZ get

Published 581 original articles · won praise 3 · Views 100,000 +

Guess you like

Origin blog.csdn.net/u010395024/article/details/104376225