12

Possible Duplicate:
Automatically prefer Ethernet over WLAN

I sit in an office environment with LAN, the LAN cable is always plugged into my machine, so by default all traffic is routed via the wired network. Traffic on the network is limited to specific sites only.

On the other hand we have a WiFi router in the office for developers, so as soon as you want to access anything that is blocked, you simply enable your WiFi and disconnect your LAN cable.

I would like to avoid getting under the table and unplug my LAN cable every time I switch on the WiFi.

Can I set up my WiFi to take priority, for example, if I leave my LAN cable plugged in, and switch on my WiFi, all traffic is now routed via WiFi instead of wired network?

I know there is a priority setting on network device properties, but it doesn't seem to take effect, the wired connection always takes preference.

1
  • 7
    What os/platform ?
    – rkosegi
    Commented Jun 13, 2012 at 11:51

5 Answers 5

12
  1. Click the Start Button
  2. Right Click "Network" and then left Click Properties
  3. From the "Network And Sharing Center" window click "Change Adapter Settings"
  4. On the "Network Connections" window, press the ALT + F key on your keyboard to being up the menu bar
  5. Click the "Advanced" menu and then "Advanced Settings"
  6. In the "Advanced Settings" window you will see the "Adapters and Bindings" tab and under "Connections" you will see the order they are in, you can use the arrows to the side to move the connection priority up and down.
2
  • thanx... this works.
    – stoic
    Commented Jun 14, 2012 at 11:55
  • Adapters and Bindings tab is missing! Commented Dec 27, 2021 at 11:18
4

You can deal with this by fiddling with your routing table. You don't say what OS you're running - but on Linux you could do:

# Dump kernel routing table:
route -n
# Delete the default gateway which uses your ethernet cable:
route del default gw 1.2.3.4

now you'll likely be left with just the default route for the wireless connection (assuming it got one), but all traffic to your LAN will still be sent over your wired connection.

There's probably better ways of doing this using network-manager (or whatever you have), which will make it persistent - but the goal remains the same, you want to remove the default route from your wired connection and leave just that of the wireless.

2
  • Instead of changing the default route, I'd rather add host or net routes that go thru the wlan. Another approach instead of the wlan is the use of httptunnel.
    – ott--
    Commented Jun 13, 2012 at 12:13
  • shivams answer to How do I set the priority of network connections in Ubuntu? is good for novices: check configuration with route -n as above, then install and use the ifmetric command line tool to change the priorities. Google
    – WillC
    Commented Dec 31, 2017 at 2:34
4

You can prioritize network connections by doing the following.

  1. Open up Network and Sharing center
  2. Click on Change adapter settings
  3. Hit ALT
  4. Go to the advanced menu
    enter image description here

  5. Now you can order your network connections. The more higher your network adapter is, the more Windows will prioritize it.
    LAN order

This image is from Windows XP but should look more or less the same in Windows 7.

3

You can simply disable the wired connection in the Device Manager. This will automatically let the wireless do the job. Enable when finished.

2
  • 1
    The thing is sometimes you want the wired connection to be up and running because it is connected to another device but not to the internet. This post is old but the problem still exists in windows 10.
    – lowtech
    Commented Oct 11, 2016 at 14:34
  • I'm aware that I have not provided a "complete" solution, just a workaround. There are several different things that can create to auto-selection problem, including bad setup in GPO for business computers.
    – Roger M
    Commented Oct 12, 2016 at 7:55
0

By default on most OSes, traffic traversing a wireless interface has a higher route cost than traffic traversing a wired interface. This makes traffic "prefer" the wired interface.

You can modify this behaviour fairly easily, but you don't mention which OS you use, so no one can give you specific directions.

Not the answer you're looking for? Browse other questions tagged .