Set LAN to take network priority before Wi-Fi on Windows 7

9

5

So far I've tried to prioritize LAN the following:

Sadly that didn't change anything. I have to deactivate my wireless adapter to get Windows to use the LAN connection. Any ideas?

I am running Windows 7 Ultimate on a Lenovo G580 with a Broadcom 802.11n network adapter and a "Atheros AR8162/8166/8168 PCI-E Fast Ethernet Controller (NDIS 6.20)".

My router supports 54 MBit/s which should be beaten by the 10/100 Base-T standard ethernet, right?

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.178.1   192.168.178.57      2
          0.0.0.0          0.0.0.0    192.168.178.1   192.168.178.46      4
        127.0.0.0        255.0.0.0   Auf Verbindung (German: on-link) 127.0.0.1    306
        127.0.0.1  255.255.255.255   Auf Verbindung         127.0.0.1    306
  127.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    306
    192.168.178.0    255.255.255.0   Auf Verbindung    192.168.178.57    257
    192.168.178.0    255.255.255.0   Auf Verbindung    192.168.178.46    258
   192.168.178.46  255.255.255.255   Auf Verbindung    192.168.178.46    258
   192.168.178.57  255.255.255.255   Auf Verbindung    192.168.178.57    257
  192.168.178.255  255.255.255.255   Auf Verbindung    192.168.178.57    257
  192.168.178.255  255.255.255.255   Auf Verbindung    192.168.178.46    258
        224.0.0.0        240.0.0.0   Auf Verbindung         127.0.0.1    306
        224.0.0.0        240.0.0.0   Auf Verbindung    192.168.178.57    257
        224.0.0.0        240.0.0.0   Auf Verbindung    192.168.178.46    258
  255.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    306
  255.255.255.255  255.255.255.255   Auf Verbindung    192.168.178.57    257
  255.255.255.255  255.255.255.255   Auf Verbindung    192.168.178.46    258
===========================================================================
Persistent Routes:
  None

and heres the same with 100 wlan metric:

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.178.1   192.168.178.57      2
          0.0.0.0          0.0.0.0    192.168.178.1   192.168.178.46    102
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
    192.168.178.0    255.255.255.0         On-link    192.168.178.57    257
    192.168.178.0    255.255.255.0         On-link    192.168.178.46    356
   192.168.178.46  255.255.255.255         On-link    192.168.178.46    356
   192.168.178.57  255.255.255.255         On-link    192.168.178.57    257
  192.168.178.255  255.255.255.255         On-link    192.168.178.57    257
  192.168.178.255  255.255.255.255         On-link    192.168.178.46    356
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link    192.168.178.57    257
        224.0.0.0        240.0.0.0         On-link    192.168.178.46    356
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link    192.168.178.57    257
  255.255.255.255  255.255.255.255         On-link    192.168.178.46    356
===========================================================================
Persistent Routes:
  None

Any idea why the one and two become metric two and four and one and 100 become two and 102?

Both wired and wireless adapters connected are connected to the same subnet. The only thing that runs on startup is my anti-virus program. At least from what I can control in msconfig.

qwertz

Posted 2014-01-29T16:27:44.773

Reputation: 91

Answers

7

To make the wired LAN connection take priority you need to change the metric for the WIFI connection in the advanced settings pane of the WIFI connections' properties.

enter image description here

Untick the 'Automatic metric' and set the metric to 9999 manually

enter image description here

Next open a commandline with admin rights and submit this command to clear the routing tables:

route /f

After this step reboot windows to make sure the new metric value gets used.

Upon rebooting the routing tables will be rebuilt using ARP-discovery, causing the new metrics to be assigned to the routes. The net effect will be that to your TCP/IP stack it will look as if hosts/devices connected to the wired LAN have a more efficient route than those connecting via WIFI only.

https://support.microsoft.com/en-us/kb/299540

Jake

Posted 2014-01-29T16:27:44.773

Reputation: 398

2A note for anyone else who hits this - set the metric for IP6 and IP4. – miltonb – 2014-11-11T01:02:17.507

@Jake, Any way to do this using cmd? – Pacerier – 2015-10-09T06:38:41.637

1More detail would improve this answer. – Dave M – 2014-01-30T17:59:57.567

Added extra info, this is to my limited knowledge (had the same problem, this fixed it) but if someone has a more in-depth technical explanation of why Windows behaves this way please add. – Jake – 2014-01-30T20:35:09.050

Windows is still using the wlan connection. – qwertz – 2014-02-02T13:53:15.937

Did your clear the routing tables after setting the metric? – Jake – 2014-02-02T14:21:23.080

Should have added the command: route /f ---Also do a reboot after this, this is Windows after all.. – Jake – 2014-02-02T14:58:47.470

1

The automatic metrics are based on connection speed, so while a 100Mbps LAN connection beats a 54Mbps 802.11g network, a 150 or 300Mbps 802.11n network will win.

The adapter binding order in your first bullet is unlikely to be useful here. The interface metrics in your second bullet should have done the trick... Perhaps a more extreme value is needed (say 1 for LAN, 100 for WLAN).

Can you provide the "IPv4 Route Table" section of a netstat -rn command? Those are the final metrics as the TCP/IP stack actually evaluates them and should be the source of truth.

BowlesCR

Posted 2014-01-29T16:27:44.773

Reputation: 2 607

@BowlesCR, He's asking how to change them, not read them. – Pacerier – 2015-10-09T06:18:12.827

the route tables ares too large for a comment... – qwertz – 2014-01-30T17:01:36.933

0

On Windows 7

  1. type in "ncpa.cpl" at the run dialog
  2. press alt / F10 if the menu bar is not visible
  3. Advanced > Advanced Settings > Adapters and Bindings Tab > use up-down arrow key to set priority of selected connection

reference: LNN howtogeek

Martin

Posted 2014-01-29T16:27:44.773

Reputation: 131