Chinaunix

标题: 如何使用route命令添加到本机的路由 [打印本页]

作者: 飞机塞进菊花    时间: 2014-11-04 16:30
标题: 如何使用route命令添加到本机的路由
比如ip route add local 192.168.99.2 dev lo

如何使用route命令实现相同的效果
作者: cryboy2001    时间: 2014-11-05 08:12
本帖最后由 cryboy2001 于 2014-11-05 08:12 编辑

[root@ksrk ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
68.21.162.32   *               255.255.255.240 U     0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
169.254.0.0     *               255.255.0.0     U     0      0        0 eth1
default         68.21.162.33   0.0.0.0         UG    0      0        0 eth1
[root@ksrk ~]# route add -net 192.168.10.0 netmask 255.255.255.0 dev eth0
[root@ksrk ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
68.21.162.32   *               255.255.255.240 U     0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
192.168.10.0    *               255.255.255.0   U     0      0        0 eth0
169.254.0.0     *               255.255.0.0     U     0      0        0 eth1
default         68.21.162.33   0.0.0.0         UG    0      0        0 eth1

作者: yestreenstars    时间: 2014-11-05 09:59
可以看一下我这篇文章
http://blog.chinaunix.net/uid-26669282-id-3972445.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2