我的问题是由于防火墙的原因
centos7中的防火墙默认是Firewall,而不是iptables
如果你使用这类型的命令是没有作用的
service iptables status
service iptables stop
chkconfig iptables off
这是使用service iptables status查看的效果,其实防火墙是没关闭的,因为起效果的firewall防火墙
所以我们要使用
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld 类型的
这是使用systemctl status firewalld命令查看的状态,防火墙还没有关闭
所以我们使用systemctl stop firewalld命令将它关闭
这样就好了
如果你想使用iptables类型的命令,需要把firewall屏蔽掉
具体操作请看:https://blog.youkuaiyun.com/weixin_42896137/article/details/88680840