|
发表于 2005-3-30 17:23:54
|
显示全部楼层
拿我的机器举个例子吧:
[code:1]
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
172.30.200.0 * 255.255.255.0 U 0 0 0 eth3
172.30.0.0 172.30.200.1 255.255.0.0 UG 0 0 0 eth3
169.254.0.0 * 255.255.0.0 U 0 0 0 eth3
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
[/code:1]
上面是我机器的路由表, 意思是访问172.30.0.0/16时从网关172.30.200.1获得路由表, 除此之外的任何地址从默认网关192.168.1.1获得路由表
在我的机子上172.30.200.1是医保网, 192.168.1.1是ADSL路由器, 这样设置后就能同时访问因特网和医保网, 不用切换网卡了
route命令的用法请参照man route |
|