LinuxSir.cn,穿越时空的Linuxsir!

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

route add -host的问题。

[复制链接]
发表于 2007-1-30 17:12:08 | 显示全部楼层 |阅读模式
[root@localhost root]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.161   192.168.0.238   255.255.255.255 UGH   0      0        0 eth1

这个是我的路由表。
192。168。1。161是一个主机。

我用route add -host 192.168.1.161 netmask 255。255。255。0 gw 192.168.0.238 dev eth1 添加。提示出错
route: netmask 000000ff doesn't make sense with host route

可是将netmask指定为0。0。0。0,即
route add -host 192.168.1.161 netmask 0.0.0.0 gw 192.168.0.238 dev eth1
就可以成功添加,并且可以ping同192.168.1.161

这个是为什么?难道-host时,不指定netmask么?谢谢
发表于 2007-1-30 17:42:03 | 显示全部楼层
man route
netmask NM
             when adding a network route, the netmask to be used.
回复 支持 反对

使用道具 举报

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

本版积分规则

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