How to give preference over one network connection over another?

19

8

Like most laptops, it has both ethernet and wireless networking options. Likewise, I have a wireless router with 10/100/1000 Mbs. 90% of the time, wireless speeds suffice. But once in a while, I have several gigs of data that needs transfering. In those times, I would physically walk over the router and plug in directly. The problem is that until I disable the wirelless network adapter, Windows still uses the wireless connection as opposed the ethernet connection. Is there a way to configure Windows to give preference to one network adapter once it becomes availabe instead of disabling the other altogether?

Chad Harrison

Posted 2012-07-31T19:24:21.467

Reputation: 5 759

Answers

17

You have to change the priority of the network adapters.

To do this, open the Network and Sharing Center and click on Change adapter settings in the left pane. you should see a list of network adapters. Press the Alt button (if the menu bar is not already visible) and click on the Advanced menu, and then choose Advanced settings.

A new control panel will pop up, and you should see it open to the Adapters and Bindings tab. In the top list should be a list of your network adapters, with an up and down arrow button to the right. This is the priority order of what adapter it will use when connecting to the Internet. Choose your Ethernet adapter and click the up arrow button until it shows at the top. Then click OK.

That should cause it to prioritize your wired connection over WiFi whenever it is connected.

Ben Richards

Posted 2012-07-31T19:24:21.467

Reputation: 11 662

In the mentioned menu it already shows my LAN network to have higher priority than my WLAN one. However, in the bottom right corner it still says it is connected to WLAN. Is this normal? Would it still show WLAN connectivity even if priorizing LAN? – kram1032 – 2014-11-27T18:52:22.620

1Two words: freakin' awesome! – Chad Harrison – 2012-07-31T19:42:32.627

23

(I know there is already accepted answer, but)...

First, from XP onwards, Windows has a feature called automatic metric. This feature should automatically prioritize traffic on adapter with highest throughput. When you enable 'better' NIC (eg. by plugging in cable) Windows should automatically route traffic via that interface. Obviously yours incorrectly thinks WiFi is faster (which seems to be reported for some of WiFi cards)

What is a metric anyway and how it's used by network software? Well,a metric is used in routing when there are multiple paths to a destination and a decision needs to be made which one is the best. The lower, the better. Imagine you're at exit gates in a stadium. There are several gates and each will eventually allow you to get out - you need to select which one is the best, eg. by looking at how many people queue at each. Windows does the same, but bases it's decision on link speed.

Your gate to 'outside' is called default route. Let's look at output from route print command, which shows you ip routing table:

> (output ommited) 
Network Destination        Netmask          Gateway     Interface        Metric
>           0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.12       25
>           0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.22       10  
(output ommited)

Those entries with 0.0.0.0 are default routes (sometimes also called quad 0 routes). Obviously I have two (with both cable and WiFi active), which one will be selected? The one with lower metric. In my case - 0.22 which happens to be my cable connection.

Now important thing - changing adapter priority via adapter setting does not change metric. This means it will not change routing decisions!

To actually change metric you need to to to open each adapter properties, then TCP/IP properties, Advanced, uncheck automatic metric and enter your own value. Adapter with lowest metric wins.

You can quickly check which interface is actually used - open Task Manager - Network, start download/upload and look at interface usage. If you need more detail - use Perfmon.

wmz

Posted 2012-07-31T19:24:21.467

Reputation: 6 132

This was the piece I was missing! Thank you! – not_a_generic_user – 2016-08-30T23:18:27.993

Yes - a wireless card reporting at 130 Mbit or 300 or 600 (HAH!) is going to beat a wired nic at 100 Mbit. – Criggie – 2016-12-21T02:26:32.523

0

Easier and faster, you can just delete the entire 0.0.0.0 route.

route delete 0.0.0.0

And adding back only the preferable route to the internet.

route add 0.0.0.0 mask 0.0.0.0 192.168.43.1 METRIC 1

Also ensure that legitimate traffic meant for the second route is added to the routing table so that all traffic meant for that route is not routed through the default route.

route add 10.1.0.0 mask 255.255.0.0 10.1.18.41 METRIC 1

Ralekeo

Posted 2012-07-31T19:24:21.467

Reputation: 1