8

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.

marked as duplicate by random Jun 13 '12 at 16:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

migrated from serverfault.com Jun 13 '12 at 11:50

This question came from our site for system and network administrators.

  • 6
    What os/platform ? – rkosegi Jun 13 '12 at 11:51
11
  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.
  • thanx... this works. – stoic Jun 14 '12 at 11:55
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.

  • 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-- Jun 13 '12 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 Dec 31 '17 at 2:34
3

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.

2

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

  • 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 Oct 11 '16 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 Oct 12 '16 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 or ask your own question.