How to Set Up Simultaneous Intranet and Internet Connections in Windows 7

How to Configure Dual Network Connections on Windows 7 for Intranet and Internet Simultaneously

In my current work environment, I cannot access the Internet directly. However, there are some wireless hotspots around, and I can use my laptop’s wireless connection to go online. But when I connect to the intranet, I lose Internet access, which is quite inconvenient. So I tried to find a way to solve this problem and connect to both the intranet and the Internet simultaneously (note: this will make the intranet insecure, so please don’t follow this example).

After searching online, I found that configuring persistent routes can solve this issue. I tried it, and indeed it worked.

Both the integrated network adapter and the wireless adapter do not need any special configuration. However, you should open the “Command Prompt” and type “route print” to view their information.

For example:

Interface List
12……00 26 82 37 90 a2 ……Broadcom 802.11g Network Adapter
11……00 26 9e 79 39 b9 ……Broadcom NetLink (TM) Fast Ethernet

Explanation: My wireless adapter interface number is 12, and my integrated adapter interface number is 11. This will be used later.

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.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

Explanation: Pay attention to the gateways here; the gateway is the key to this whole process. In my case, my intranet gateway is 10.111.128.11, and my 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 knowledge about the route command yourself.

route delete [Network Destination] (you can add parameters to filter, such as netmask, gateway, etc.)

For example: route delete 10.0.0.0 mask 255.255.0.0 deletes the route with the destination 10.0.0.0 and netmask 255.255.0.0.

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

And so on; the subsequent parameters are similar to the ‘add’ command.

Add the 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, so it survives restarts.

0.0.0.0 – The network destination for the wireless connection. We assign 0.0.0.0 to it to make the Internet the primary connection.

mask 0.0.0.0 – Same as above.

172.16.0.1 – The wireless connection’s gateway; this must be correct.

if 12 – The interface index for the wireless adapter, obtained above.

Add the 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 intranet’s destination network; as long as it’s not 0.0.0.0, it should work.

mask 255.255.255.0 – This is related to your specific intranet configuration; set it accordingly.

10.111.128.11 – The intranet connection’s gateway; this must be correct.

if 11 – The interface index for the integrated adapter, obtained above.

If both network adapters can access the Internet, you can manually change their priority levels:

Via connection properties:

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

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

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

It is crucial that the gateway and interface index are not wrong. The gateway is the key point. You must restart your computer after completing the setup; this step cannot be omitted.

route add -p 190.160.2.0 mask 255.255.255.0 157.121.1.1 if 13

My successful configuration steps:
1. Check network adapter identifiers
cmd> route print
Remember the identifiers for the wireless and integrated network adapters.

2. Delete

Leave a Comment

Your email address will not be published.