I currently have two network connections on my laptop:

  • A wireless connection to a LAN that is fast and allows internet traffic but not outgoing VPN connections.
  • A data dongle that is slow and expensive, but does allow me to make a VPN connection back to my office.

If I connect my VPN when only the data dongle is enabled everything works fine. I can then enable the wireless connection too and all traffic not destined for the VPN goes over the wireless connection.

However, if the VPN connection breaks and I try to reconnect it consistently fails to connect until I disable the wireless connection.

I am getting fed up with constantly having to disable and re-enable the wireless connection to bring back my VPN connection. Is there a way to force the VPN connection to be made only over the data dongle?


I have tried fiddling with both interface priority and metrics, but the best I could manage was getting ALL traffic to go over the dongle which is no good. Netsh appears to be unreliable on XP and didn't work for me. Devcon (a tool from MS) did work but required a little effort to get the device ID (run "devcon hwids *" and search the output for the connection name). Route also didn't want to work for me.

In the end I put together a batch script using the information in harrymc's answer to stop my wireless, connect to the VPN (using rasdial), and restart the wireless:

devcon disable *DEV_0024*
rasdial <VPN Name> <username> * /domain:<domain>
devcon enable *DEV_0024*

You could try to change the binding order of network adapters so that the dongle is first :

  • Click Start, click Run, type ncpa.cpl , and then click OK.
  • On the Advanced menu, click Advanced Settings, and then click the Adapters and Bindings tab.
  • In the Connections area, select the dongle
  • Use the up-arrow button to move the connection higher in priority.

If this is not enough, the same article shows how to change the interface metric. Make it higher on the wired connection than the wireless.

If this doesn't work, then I note that under newer versions than XP, one can't have two network adapters active at the same time, but in XP this might work. If both adapters are active and have Internet/LAN access with different IPs, then this is possible by using the route command to specify that the VPN IP address is on a route that is only supported by the wireless adapter.

If both adapters cannot be set both active at the same time, then what you ask for is simply made impossible by Windows itself. The most you could do is write scripts that will do the enabling of adapters for you.

One way of doing it is using the devcon command as shown in the article Enable/Disable Wireless Card from Command Line.

Another would be by using the netsh command :

netsh interface set interface <interface name> DISABLED / ENABLED

For example to disable an interface with its default name "Local Area Connection", run:

netsh interface set interface "Local Area Connection" DISABLED

To enable the interface, you'd then run:

netsh interface set interface "Local Area Connection" ENABLED
  • Thanks for this. Unfortunately the dongle was already at the top of the priority list. Changing the metric to 1 on the dongle did work, but it also caused all internet traffic to go over the dongle too :( – Dan Mar 8 '12 at 9:13
  • Manually setting both the wireless connection and the dongle to the same metric doesn't work either, whatever the order in the priority list. – Dan Mar 8 '12 at 9:22
  • I have added more info. – harrymc Mar 8 '12 at 10:17
  • Thanks, it seems that netsh is unreliable on XP so I had to use devcon to cobble something together. I'll add more details to the question later on. – Dan Mar 8 '12 at 11:40
  • Just to be clear, when I said that setting both adapter metrics the same doesn't work, I meant that I couldn't connect to the VPN with that configuration, not that anything new had gone wrong. – Dan Mar 8 '12 at 12:48

This should work but I can't test it from this computer.

Go to your Network Connections/Adaptor settings page from the Control Panel and find your VPN connection. Right click on it > Properties, click on IP v4 and then click Properties.

Then uncheck default gateway / change it from what you use for your WLAN, to your dondgle.

  • Thanks, but I don't have an IPv4 button/control in my VPN properties page? – Dan Mar 1 '12 at 16:16
  • What VPN client are you using and what options are listed on the VPN properties page? – Amicable Mar 1 '12 at 19:03
  • It's just a default Windows XP VPN connection, it has tabs for General, Options, Security, Networking, and Advanced – Dan Mar 1 '12 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.