LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2403|回复: 7

没有指定192.168.0.255,为什么可以ping通???

[复制链接]
发表于 2005-6-23 12:47:51 | 显示全部楼层 |阅读模式
先说一下我的网络环境:

服务器用的是RHEL AS 4 做的NAT,指定IP地址为192.168.0.1,子网掩码是255.255.255.0

其余用192.168.0.2~192.168.0.220

子网掩码:255.255.255.0

我没有指定192.168.0.255,但是我的内网可以ping通192.168.0.255?
为什么?



C:\Documents and Settings\Player1>ping 192.168.0.255

Pinging 192.168.0.255 with 32 bytes of data:

Reply from 192.168.0.255: bytes=32 time<10ms TTL=64
Reply from 192.168.0.255: bytes=32 time<10ms TTL=64
Reply from 192.168.0.255: bytes=32 time<10ms TTL=64
Reply from 192.168.0.255: bytes=32 time<10ms TTL=64

群内有朋友告诉我用255.255.255.0的话,是应当可以ping通的,这是怎么回事??
发表于 2005-6-23 13:15:20 | 显示全部楼层

这是广播地址

没读过tcp/ip,但知道255结尾是广播地址,也就说所有的机器都响应。 对不???
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-23 13:25:57 | 显示全部楼层
网络基础方面的我太菜,也没有学过这些东西呀!!呵呵!!

还请大家给我说明白一点儿!!看书以后再补吧,先把这个问题搞掂再说!!

呵呵!感谢
回复 支持 反对

使用道具 举报

发表于 2005-6-23 13:40:45 | 显示全部楼层
Post by bombjams
没读过tcp/ip,但知道255结尾是广播地址,也就说所有的机器都响应。 对不???



我记得是的。

对应这个网段的,都响应。
回复 支持 反对

使用道具 举报

发表于 2005-6-23 15:45:08 | 显示全部楼层
你可以试一下给255地址一个包,你会发现每个在线的机器都会收到,但响不响应是不一定的.
当然这是再没有划分子网才成立的说
回复 支持 反对

使用道具 举报

发表于 2005-6-23 18:14:40 | 显示全部楼层
肯定可以ping通阿,因为它是BROADCAST啊
如果ping不通 才是有问题了呢
你的192.168.0.0/24 所以广播地址肯定是.255了,如果ping不通,当有广播的数据包时,怎么办了呢!
回复 支持 反对

使用道具 举报

发表于 2005-6-24 00:14:22 | 显示全部楼层
Post by genv
你可以试一下给255地址一个包,你会发现每个在线的机器都会收到,但响不响应是不一定的.
当然这是再没有划分子网才成立的说


在LINUX下ping广播地址回复是这样的,不知楼主回复怎么都是255的

# ping 192.168.37.255 -b
WARNING: pinging broadcast address
PING 192.168.37.255 (192.168.37.255) 56(84) bytes of data.
64 bytes from 192.168.36.182: icmp_seq=1 ttl=64 time=0.049 ms
64 bytes from 192.168.36.207: icmp_seq=1 ttl=64 time=0.742 ms (DUP!)
64 bytes from 192.168.36.90: icmp_seq=1 ttl=64 time=0.752 ms (DUP!)
64 bytes from 192.168.36.225: icmp_seq=1 ttl=64 time=0.881 ms (DUP!)
64 bytes from 192.168.37.14: icmp_seq=1 ttl=64 time=2.75 ms (DUP!)
64 bytes from 192.168.36.30: icmp_seq=1 ttl=64 time=2.88 ms (DUP!)
64 bytes from 192.168.36.182: icmp_seq=2 ttl=64 time=0.041 ms
64 bytes from 192.168.36.90: icmp_seq=2 ttl=64 time=0.729 ms (DUP!)
64 bytes from 192.168.36.207: icmp_seq=2 ttl=64 time=0.746 ms (DUP!)
64 bytes from 192.168.36.225: icmp_seq=2 ttl=64 time=0.904 ms (DUP!)
64 bytes from 192.168.37.14: icmp_seq=2 ttl=64 time=20.5 ms (DUP!)
64 bytes from 192.168.36.30: icmp_seq=2 ttl=64 time=20.7 ms (DUP!)
64 bytes from 192.168.36.182: icmp_seq=3 ttl=64 time=0.041 ms
64 bytes from 192.168.37.14: icmp_seq=3 ttl=64 time=0.428 ms (DUP!)
64 bytes from 192.168.36.90: icmp_seq=3 ttl=64 time=0.712 ms (DUP!)
64 bytes from 192.168.36.30: icmp_seq=3 ttl=64 time=0.721 ms (DUP!)
64 bytes from 192.168.36.207: icmp_seq=3 ttl=64 time=0.744 ms (DUP!)
64 bytes from 192.168.36.225: icmp_seq=3 ttl=64 time=0.874 ms (DUP!)

--- 192.168.37.255 ping statistics ---
3 packets transmitted, 3 received, +15 duplicates, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.041/3.072/20.790/6.261 ms
回复 支持 反对

使用道具 举报

发表于 2005-6-24 00:16:01 | 显示全部楼层
建议ping后用arp -a看看有没有对应192.168.0.255的网卡地址,如果有这个Ip可能有人在用了
# arp -a
? (192.168.36.31) at 4C:00:10:19:94:60 [ether] on eth0
? (192.168.37.3) at 00:30:1B:39:63:5E [ether] on eth0
? (192.168.36.124) at <incomplete> on eth0
? (192.168.36.43) at 00:30:F1:49:AB:0C [ether] on eth0
? (192.168.36.98) at 00:0A:EB:13:E1:E4 [ether] on eth0
? (192.168.36.142) at 00:E0:4C:A9:8D:99 [ether] on eth0
? (192.168.36.1) at 00:30:6D6:70:70 [ether] on eth0
? (192.168.37.2) at 00:B0:5C:40:3A:80 [ether] on eth0
? (192.168.36.195) at 02:BF:AC:10:15:72 [ether] on eth0
? (192.168.36.99) at 00:0A:EB:15:FF:A4 [ether] on eth0
? (192.168.37.104) at 00:11:11:1C:BC3 [ether] on eth0
? (192.168.36.61) at 00:0A:E6:57:E7:1F [ether] on eth0
? (192.168.36.41) at 4C:00:10:19:30:70 [ether] on eth0
? (192.168.37.254) at <incomplete> on eth0
? (192.168.37.20) at 00:E0:4D:05:7E:35 [ether] on eth0
? (192.168.36.230) at 00:0C:6E:AC:B8:CD [ether] on eth0
? (192.168.36.190) at 00:50:8D:55:EB:7E [ether] on eth0
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表