How to Set Up Simultaneous Internal and External Network Connections on Windows 7

How to Set Up Simultaneous Intranet and Internet Routing on Windows 7

My current work environment doesn’t allow connections to the external internet. However, there are some wireless hotspots around, and I can use my laptop to connect to Wi-Fi and access the internet. The problem is, if I connect to the intranet, I can no longer access the external internet. This is quite inconvenient, so I tried to find a way to solve this problem and enable both intranet and internet connections simultaneously (this will make the intranet insecure鈥攌ids, don’t try this at home).

After some online research, I found that setting up persistent routes can solve the issue. I gave it a try, and it actually worked.

Neither the integrated NIC nor the wireless adapter needs any special configuration, but you need to open a “Command Prompt” window and type “route print” to check some of their information.

For example

Interface List12……00 26 82 37 90 a2 ……Broadcom 802.11g Network Adapter11……00 26 9e 79 39 b9 ……Broadcom NetLink (TM) Fast Ethernet

Note: My wireless adapter is 12, and the integrated NIC is 11. These will be used later.

IPv4 Route Table===========================================================================Active Routes:Network Destination Netmask Gateway Interface Metric0.0.0.0 0.0.0.0 172.16.0.1 172.16.0.63 41 0.0.0.0 0.0.0.0 10.111.128.11 10.131.18.141 276

Note: Pay attention to the gateways here. The gateway is the key point of the whole process. In my case, the intranet gateway is 10.111.128.11, and the wireless gateway is 172.16.0.1.

Now we can start the configuration.

First, go to “All Programs” -> “Accessories” -> “Command Prompt”, right-click and select “Run as administrator” to open the command window.

First, delete the network destination 0.0.0.0 by entering the command: route delete 0.0.0.0

You can look up the details of the route command yourself,

route delete Network Destination (you can add parameters to filter, like netmask, gateway, etc.)

E.g., route delete 10.0.0.0 mask 255.255.0.0 deletes the route with network destination 10.0.0.0 and mask 255.255.0.0.

route delete 10.0.0.0 mask 255.255.0.0 192.168.1.1 deletes the route with network destination 10.0.0.0, mask 255.255.0.0, and gateway 192.168.1.1.

And so on; the subsequent parameters are similar to those of the add command.

Add a static route for the wireless connection by entering the command: route add -p 0.0.0.0 mask 0.0.0.0 172.16.0.1 if 12

add Adds a route entry

-p Makes the added route persistent, meaning it survives reboots

0.0.0.0 The network destination for the wireless connection; to make the internet the primary one, we assign 0.0.0.0 to it

mask 0.0.0.0 Same as above

172.16.0.1 The gateway for the wireless connection; this must be correct

if 12 12 is the wireless adapter interface, as determined from the query above

Add a static route for the intranet by entering the command: route add -p 10.111.128.0 mask 255.255.255.0 10.111.128.11 if 11 10.111.128.0 The target network for the intranet; it seems as long as it’s not 0.0.0.0, it will work

mask 255.255.255.0 This relates to the specific intranet configuration; set it according to your specific situation

10.111.128.11 The gateway for the intranet connection; this must be correct

if 11 11 is the integrated NIC interface, as determined from the query above

If both network cards can access the external internet, you can manually change the priority:

Via connection properties:

Open “Network and Sharing Center”, find “Change adapter settings”, open the properties of “Local Area Connection”, and select the properties of “Internet Protocol Version 4”.

Then, at the bottom right of the pop-up page, find “Advanced”. Here you will see “Automatic metric”. Uncheck the box for “Automatic metric” and change it to a number, like 28.

The smaller the metric value, the higher the priority for using that gateway. Generally, the default seems to be 276. Adjust it according to your needs.

It’s crucial to note that the gateway and interface must be correct. The gateway is the key point. After configuration, you must restart; this step cannot be skipped.

route add -p 190.160.2.0 mask 255.255.255.0 157.121.1.1 if 13

My successful setup:Java Code

Leave a Comment

Your email address will not be published.