Automatically prefer Ethernet over WLAN

9,909

Solution 1

You can set your laptop to "prefer" the Ethernet connection over the wireless. TechNet has a quick overview:

The short answer is that Windows (Vista, 7, 2008, and I’m pretty sure XP and 2003 does as well) [or should do] this by default. The key here is the network interface metric. When you have more than one default gateway defined [...] then the internet bound packets go out the interface with the lowest metric.

[...] You can, of course, permanently alter your metrics by editing your TCP/IP settings on your network adapter’s advanced settings.

[...] You should know that Vista made a change to how we handle existing sockets – after plugging in, connections will not be switched over, you must re-establish the connection in order to make use of a wired connection. For example, if you’re downloading something from a website and realize that it would go faster by plugging in, you’d have to cancel and start over after plugging in. This is a change from XP and 2003.

For how to change these settings, have a look at this Microsoft KB article.

Solution 2

The wireless network is not entirely disabled, but windows is already configured to prefer your wired network when available. This happens via the routing table. Your routing table will have an entry for both interfaces, but the metric for routes on the wired interface has a lower default than routes on the wireless, such that the wired network is checked first when evaluating where to send a packet. You can view your routing table by opening a command prompt and entering route print.

Solution 3

I found a different MS Support article helpful fixing this issue in Windows 7.

It basically explains that you can:

  1. Go to the Start menu.
  2. Type view network connections in the Search programs and files box.
  3. Choose View network connections in the search results.
  4. Press Alt and go to the Advanced Options > Advanced Settings... menu item.
  5. In the Advanced Settings window that opens, look for the Connections list at the top of the Adapters and Bindings tab, and use the up/down arrows to the right of it to change the priorities of your connections (from highest priority to lowest priority).
  6. Click OK to save your changes.

Below is a screenshot of a typical Advanced Settings window with a connection selected in the Connections list and the up/down arrows to the right of the list enabled accordingly:

Windows 7 'View network connections' -- 'Advanced Settings'

Share:
9,909

Related videos on Youtube

EricSchaefer
Author by

EricSchaefer

Hello, my name is Eric Schaefer. I am a husband, father, grandfather, and software engineer living near Munich/Germany. I am developing software for all kinds of systems and tiers, always on the hunt for ways to become a better developer. I specialize in OOP with sprinkles of DDD and FP. Since the early 2000s I am a firm proponent of Test Driven Development. When I am not developing software, I teach my fellow engineers. https://www.ericschaefer.dev is my home base.

Updated on September 17, 2022

Comments

  • EricSchaefer
    EricSchaefer almost 2 years

    Is is possible to force IP connections over the wired ethernet if it is connected and over wireless LAN if the wired ethernet is unavailabe (e.g. cable disconnected). Both network connections would be part of the same subnet.

  • EricSchaefer
    EricSchaefer over 13 years
    Works like a charm...
  • tombull89
    tombull89 over 13 years
    Thanks for the feedback. I know it takes a bit of tweaking but in the end it works.
  • Peter Tirrell
    Peter Tirrell almost 9 years
    Does this actually work? Mine is set up correctly and I have seen this instruction all over the Internet yet my laptop still is connected to WiFi even if the ethernet is plugged in.
  • J0e3gan
    J0e3gan over 8 years
    @PeterTirrell: It worked for me on a Win 7 Pro 64-bit machine back when I answered; but I just noticed a situation on another Win 7 Enterprise 64-bit where it did not work: the routing metric was 20 for both the LAN and WLAN interfaces even though the LAN interface was bumped up in the Advanced Settings > Adapters and Bindings > Connections list as shown. To fix the problem I had to set the WLAN interface's routing metric to 30 (i.e. higher than 20). So your mileage may vary I guess.
  • Khalil Al Hooti
    Khalil Al Hooti over 2 years
    Adapters and Bindings tab is missing!