目前我的笔记本使用无线网络访问互联网,使用有线网络访问办公网络
无线网络的网关是117.128.108.1
办公网络的网关是10.16.30.254
在命令行下,输入route print可查看到所有的route 列表
要设置,首先删除掉原来的0.0.0.0的路由。
C:\Documents and Settings\Administrator>route delete 0.0.0.0
然后添加如下:
C:\Documents and Settings\Administrator>route add 10.0.13.0 mask 255.255.255.0 1
0.16.30.254 -p
C:\Documents and Settings\Administrator>route add 0.0.0.0 mask 0.0.0.0 117.128.1
08.1 -p
这时候查看路由表,-p的参数可以保证机器在重启后设置仍然生效.
===========================================================================
Persistent Routes:
Network Address Netmask Gateway Address Metric
10.16.30.0 255.255.255.0 10.16.30.254 1
10.0.13.0 255.255.255.0 10.16.30.254 1
0.0.0.0 0.0.0.0 117.128.108.1 1
我们来测试一下:
访问办公网络
C:\Documents and Settings\Administrator>tracert 10.0.13.24
Tracing route to localhost [10.0.13.24]
over a maximum of 30 hops:
1 2 ms 1 ms 1 ms localhost [10.16.30.253]
2 9 ms 9 ms 10 ms localhost [10.3.255.33]
3 12 ms 9 ms 11 ms localhost [10.0.13.24]
Trace complete.
访问互联网:
C:\Documents and Settings\Administrator>tracert www.163.com
Tracing route to 163.xdwscache.glb0.lxdns.com [60.28.236.112]
over a maximum of 30 hops:
1 2 ms 1 ms 2 ms 117.128.108.1
2 23 ms 4 ms 6 ms 117.128.12.165
3 6 ms 8 ms 4 ms 117.128.8.4
4 17 ms 5 ms 5 ms 117.128.8.193