打开防火墙设置:以打开mysql为例
1. 在/etc/sysconfig/iptables里添加
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
2. 重启iptables
[root@localhost ~]# /etc/init.d/iptables restart
3. 看下状态
[root@localhost ~]# /etc/init.d/iptables status
如果打开其他端口,则将
-A INPUT -m state --state NEW -m tcp -p tcp --dport 端口号 -j ACCEPT
中的 “端口号” 改为想要打开的即可。
查看某个端口使用情况:
lsoft -i:端口号
如:lsoft -i:3306