LINUX服务器启动防火墙后ping外网ip可以通,但ping域名不通(原因:防火墙未开放DNS解析端口)
1.重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2.即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
2.查看防火墙开放端口
#cat /etc/sysconfig/iptables
查看是否开放53端口,53号端口是DNS服务使用的,你启动了DNS服务,自然就会监听53号端口。如果没有则修改配置文件
#vi /etc/sysconfig/iptables 将以下信息加入其中
-A INPUT -p udp --sport 53 -j ACCEPT
-A OUTPUT -p udp --dport 53 -j ACCEPT
-A INPUT -p udp --dport 53 -j ACCEPT
-A OUTPUT -p udp --sport 53 -j ACCEPT
4 .修改完后重启防火墙
service iptables restart
还没有评论,来说两句吧...