Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A similar question was asked for windows Automatically prefer Ethernet over WLAN but I'm on linux and am using NetworkManager.

Right now if the ethernet cable is plugged in and is available while wifi connections are also available NetworkManager chooses the wifi connection. How can I tell it to always choose the wired connection if available?

I'm on Fedora 17 using NetworkManager-

share|improve this question
I'm in Fedora 20, and have the same problem. Toggling WiFi off seems to be a workaround. At least this can be done from the top panel (drop-down user menu). – Brady Trainor Mar 2 '14 at 21:17

Just a couple things:

You could try these commands in your environment to see if they work and bring desired results:

  • auto Ethernet
  • auto ethX (Replace X with whatever number your kernel assigns (run ifconfig to check))

Alternatively, you can have a look at your IP routes found by issuing:

sudo route -n

By looking at the output, see if wlan0 is on all routes.

Several other questions have been asked with this and the only way to get Linux to favour an interface (by default it is eth0 but in your case, something went awry) is to manipulate the metrics.

You can configure the metric for an interface using ifmetric which manipulates the metric on an interface you specify. I haven't tested this on Fedora per se, but I can see it is in the repositories. So, issue:

yum install ifmetric

Then when it is installed, you will want to go to:


Use vi, nano, emacs, whatever editor you use and then add underneath whichever interface you want to configure (in this case eth0):

up ifmetric eth0 X

X relates to a number determining the priority, 0 by default is the highest priority, but to avoid hitting static/default routes, use something above 2. Then you will want to add a higher number to wlan0. So:

up ifmetric eth0 10

and under wlan0:

up ifmetric wlan0 20

Your file should be looking like this:

 iface eth0 inet dhcp
    up ifmetric eth0 10

iface wlan0 inet dhcp
    up ifmetric wlan0 20

Let us know if it helps!

EDIT: Just come across a few links:

How do I configure a linux machine to ignore wifi when connected via LAN?

How do I set the priority of network connections in Ubuntu?


There is also a metric field in Network Manager GUI!

share|improve this answer

You must log in to answer this question.

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