centos默认开启的端口只有22端口,专供于SSH服务,其他端口都需要自行开启.
1.修改/etc/sysconfig/iptables文件,增加如下一行:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT
重启 iptables
service iptables restart
2.重启防火墙,这里有两种方式重启防火墙
service iptables start
3.或者用menu-system-administration-firewall ,去添加用户需要的端口。
By the way:
a. netstat -tanp 去显示端口状态。
/usr/sbin/lsof -i
b. telnet ipaddr port
to check if ip and port is available before making connection.