- 论坛徽章:
- 0
|
本帖最后由 Clownunix 于 2015-05-27 11:36 编辑
关于在本地搭建DNS服务后,iptables这样写后不能ping自己的域名,而其他的计算机可以ping通。这是什么原因呢?
以下是iptables的全部配置:
[root@centos ~]# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT icmp -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp spt:http
ACCEPT tcp -- anywhere anywhere tcp spt:https
ACCEPT tcp -- anywhere anywhere tcp spt:domain
ACCEPT udp -- anywhere anywhere udp spt:domain
ACCEPT icmp -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp spt:ssh
在本地ping的话,不能ping成功:(域名不能发,就用#####来代替吧,晕)
[root@centos ~]# ping #####
ping: unknown host #####
而在其他计算机中使用ping,却可以成功ping进去:
C:\Users\Administrator>ping #####
正在 Ping ##### [17.17.17.5] 具有 32 字节的数据:
来自 17.17.17.5 的回复: 字节=32 时间<1ms TTL=64
来自 17.17.17.5 的回复: 字节=32 时间<1ms TTL=64
来自 17.17.17.5 的回复: 字节=32 时间<1ms TTL=64
来自 17.17.17.5 的回复: 字节=32 时间<1ms TTL=64
17.17.17.5 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms |
|