Linux, open the specified port

Today Linux test server restart at the site resulted not open, ip can ping the Apache restarted successfully, telnet port 80 Rom results, which should be outside the network 80 is blocked by the firewall behind the 80-port development under it, the following steps:

1, modified vim / etc / sysconfig / iptables file, add the following line:

  Port -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport to open -j ACCEPT

2, restart iptables
    command: service iptables restart

 

Query whether ports are open:

netstat -an | grep port or netstat -tunlp | grep port
方法二:

1、# /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
2、# /etc/init.d/iptables restart
3、# /etc/rc.d/init.d/iptables save

Guess you like

Origin www.cnblogs.com/diandianquanquan/p/10956917.html