Currently, my laptop uses wireless networks to access the Internet and wired networks to access the office network.
The Wireless Network Gateway is 117.128.108.1
The Office Network Gateway is 10.16.30.254.
In the command line, enter route print to view all the route lists.
First, delete the original route 0.0.0.0.
C: \ Documents ents and Settings \ Administrator> route Delete 0.0.0.0
Then add the following:
C: \ Documents ents and Settings \ Administrator> route add 10.0.20.mask limit 255.0 1
0.16.30.254-P
C: \ Documents ents and Settings \ Administrator> route add 0.0.0.0 mask 0.0.0.0 117.128.1
08.1-P
Check the route table at this time. The-p parameter can ensure that the setting still takes effect after the machine is restarted.
========================================================== ==========================================
Persistent routes:
Network Address netmask gateway address Metric
10.16.30.0 255.255.255.0 10.16.30.254 1
10.0.20.255.255.255.0 10.16.30.254 1
0.0.0.0 0.0.0.0 117.128.108.1 1
Let's test:
Access the office network
C: \ Documents ents 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.20.33]
3 12 MS 9 MS 11 MS localhost [10.0.13.24]
Trace complete.
Access the Internet:
C: \ Documents ents 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