The following describes how to perform the operation. Take my computer as an example to give a demonstration.
I also have two NICs, one is the Office intranet and the other is the Internet.
Connect to the Intranet Nic,IPSet:192.168.1.111, Gateway is set192.168.1.1
Nic connected to the Internet,IPSet:192.168.0.111, Gateway is set192.168.0.1
In the command line, useRoute printCommand to view the current default route table:
The bottom line:Default Gateway: 192.168.1.1
It means the default gateway. A computer has only one default gateway, and all data packets are sent to the gateway address first. According to the display,192.168.1.1It indicates my Intranet, that is, all data packets will automatically take precedence over the Internet line.
Add this command to the route table permanently.
Route-P add 0.0.0.0 mask 0.0.0.0 192.168.0.1( Note: All networks go through 192.168.0.1 Gateway ) (Internet)
Route-P add 192.0.0.0 mask route 0.0.0 192.168.1.1( Note: Only 192 Network 192.168.1.1 Gateway ) (Intranet)
It is also convenient to delete route records. Run the following command:
Route Delete 192.0.0.0