踩了个坑:局域网内linux机器启动服务后怎么都telnet不通端口。
(2018-04-18 11:37:26)分类: Linux |
1、想到了防火墙需要关闭,用service iptable status .什么也没查出来,默认以为没开。
running
检查防火墙的状态:
2、想到会不会是hosts文件没有ip和localhost映射,添加后还是无效
3、端口怎么查看都是启动正常。
无解了。然后查资料才发现
原来是Centos6.5和Centos7.0以上版本的防火墙查看命令不一样。 http://www/uc/myshow/blog/misc/gif/E___6722EN00SIGG.gif
修改之后就可以telnet通了。。。
centos6.5
[root@localhost ~]#servcie iptables
stop
--临时关闭防火墙
[root@localhost ~]#chkconfig
iptables
off
--永久关闭防火墙
CentOS
7.0以后默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。
firewall-cmd --state
#查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
[root@localhost
~]#firewall-cmd --state
从centos7开始使用systemctl来管理服务和程序,包括了service和chkconfig。
关闭防火墙:
systemctl stop
firewalld.service #停止firewall
systemctl disable
firewalld.service #禁止firewall开机启动