Linux配置防火墙 开启80端口 编辑配置文件/etc/sysconfig/iptables [root@weixinht ~]# vim /etc/sysconfig/iptables 1 # Firewall configuration written by system-config-firewall 2 # Manual customization of this file is not recommended. 3 *filter 4 :INPUT ACCEPT [0:0] 5 :F
vi /etc/sysconfig/iptables -A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT(允许80端口通过防火墙) 特别提示:很多网友把这条规则添加到防火墙配置的最后一行,导致防火墙启动失败,正确的应该是添加到默认的22端口这条规则的下面 /etc/init.d/iptables restart #最后重启防火墙使配置生效
CentOS6.5查看防火墙的状态: 1 [linuxidc@localhost ~]$service iptable status 显示结果: 1 2 3 4 5 [linuxidc@localhost ~]$service iptable status Redirecting to /bin/systemctl status iptable.service ● iptable.service Loaded: not-found (Reason: No such file or dir
CentOS6.5查看防火墙的状态: 1 [linuxidc@localhost ~]$service iptable status 显示结果: 1 2 3 4 5 [linuxidc@localhost ~]$service iptable status Redirecting to /bin/systemctl status iptable.service ● iptable.service Loaded: not-found (Reason: No such file or d
在虚拟机VMware上装好了centos6.9,并配好了nginx,但是本机就是无法访问.具体情况如下1.本机能ping通虚拟机2.虚拟机也能ping通本机3.虚拟机能访问自己的web4.本机无法访问虚拟己的web后来发现是防火墙将80端口屏蔽了的缘故.检查是不是服务器的80端口被防火墙堵了,可以通过命令:telnet server_ip 80 来测试. vi /etc/sysconfig/iptables -A INPUT -m state –state NEW -m tcp -p tcp –