Please provide a mechanism whereby Wi-Fi networks can be prioritized

Bug #366780 reported by Vasily Kulikov on 2009-04-25
This bug affects 104 people
Affects Status Importance Assigned to Milestone
Network Manager Applet
Fix Released
Won't Fix
network-manager (Ubuntu)
network-manager-applet (Ubuntu)
networkmanagement (Ubuntu)

Bug Description

Binary package hint: network-manager

I've got few wifi network profiles. NM connects to 1st available network in alphabetical order. But at my home NM connects to slow and unstable free network and I want to connect to my own wifi router. I suggest to add some priorities to different networks to set the order which network to connect to.

Version: (using KDE 4.2.3)
Installed from: Ubuntu Packages

The networkmanager applet should offer to sort the configured networks by priorities and connect to the one with the highest priority.

Alexander Sack (asac) wrote :

nm is using the last one you were connected to. There are bugs wrt to system connections (e.g. available to all users), but in general it should work like that. does that work for you?

Changed in network-manager (Ubuntu):
status: New → Incomplete
Vasily Kulikov (segooon) wrote :

No, not exactly that I want. I've got a list of networks, e.g.
1) home - my router, fast and reliable network
2) beeline-wifi-free - free, but slow network
3) work - router at work, as good as 1st

So, when I am at my home, I can see 1st and 2nd networks. Home is preferred, not beeline.
Similar situation at work, I can see 2nd and 3rd nets. Work is preferred.
But when I am at the street or another unknown place, I want to use free network. But it should not influence on the connection order at other places. E.g. if I use some free net, NM should connect only to my «home» network, not last connected free net.

The new logic is:

In the main popup, only show connections that are currently connectable - eg there is a configuration for this network and the access point(s) providing this is currently found via scan. Networks that are configured but where the access point is not present are not shown.

The other, unconfigured scanned networks are in a submenu. Is this an acceptable prioritisation?

Actually I a meant something different. I want the list of already configured networks sorted by priority, no matter if they are available or not. For example I want to put cable network as first. If cable is available then disconnect wireless. If I have the choice between Wireless A and B, B is my choice and so on

It's not possible with NetworkManager - the policies the daemon uses are quite inflexible. The only way you can influence this is to set some connections as 'never default' (which sucks when the cable connection is not present) or change the timestamp on wireless connection B so it is newer than A and NM will prefer it.

It also tries to keep as many 'connect automatically' connections up as possible so the 'disable wireless when connected to cable' idea is not possible. Sorry. Please try and convince NM to add client policy control and then I'lll implement it in the KDE UI.

Joe Amenta (airbreather) wrote :

I am looking for exactly the same thing that segooon is looking for. My situation:

1) home - my router
2) school - routers in classes
3) school+1 - routers at work and in other classes

If "school" is in range, then I would like to connect to it if and only if "home" is not in range and "school+1" is not in range.

I'd like to add that I experience a related (annoying) behavior (I am not sure if I should submit this as bug or here):

If two wireless networks have been configured with autoconnect, knetworkmanager seems to choose the weaker connection instead of the stronger - this should be fixed.

Is this also an issue of nm policies? Please advice if I should file a bug report elsewhere. Thank you!

Nikos (okin7) wrote :

I'm in this exact situation too.
Alphabetic order (when the last connected one at work is gone) is not the order I want when back home
Any idea to configure NM for us ?

Rolf Leggewie (r0lf) wrote :

As Alexander pointed out, you should usually be connecting to the last active connection. Is that not happening for you?

I'm not sure but I can see how things would be less than perfect if you alternate between two good connections. Let's say three connections "free-but-slow", "home" and "work". I cannot test now but I could imagine that when I alternate between "home" and "work" nm may drop back to alphabetical preference and try to connect to "free-but-slow" first. Is that what you are describing?

description: updated
Launchpad Janitor (janitor) wrote :

[Expired for network-manager (Ubuntu) because there has been no activity for 60 days.]

Changed in network-manager (Ubuntu):
status: Incomplete → Expired
Olivier Mengué (dolmen) wrote :

@Rolf: yes this is the problem.
The problem is also when we alternate between not just "home" and "work" but also "free-but-slow".
Use case:
- I'm at home with "home"
- I go out in a public place and use "free-but-slow"
- I go back at home. I expect to be connected to "home" instead of "free-but-slow".

So the "last used connection" is not an appropriate algorithm for a laptop that frequently changes of connection.

In Windows, the connection list is ordered, independently of the connection name. So I can put in order "work", "home", "free-but-slow" and "free-but-slow" will only be used if none of the others two are available.

Changed in network-manager (Ubuntu):
status: Expired → Confirmed

There five "most used" or preconfigured connections should be showing up in the menu before it's split out with the rest of all the connections.

The exception to this will be if you're moving to a different place while suspended and the same name network will be available, then you'll probably see it try to connect to that first. You can somewhat mitigate this issue by setting the free network to remove "Connect automatically".

I think all the cases are already well covered by NM in its current state; could we finally close this bug?

If not, please provide further rationale as to what exactly is wrong, with suggestions on how to fix it. This would be very helpful.


Changed in network-manager (Ubuntu):
status: Confirmed → Incomplete
Yann Salmon (yannsalmon) wrote :

What is wrong is that it is only possible to set whether nm should automatically connect to a network or not. It would be much preferable if we could also tell it a preference relationship between these network that we automatically connect to.

This would mean we could order the list of networks ourselves, and not letting it be ordered by recency.

This is valuable because networks have different speed, security, reliability, level of service.

For example, at my university exist several wifi networks : a closed one and a "free access" one. I prefer accessing to the closed one whenever it is available, but when the closed one is not available (as is on some parts of the campus), I would still like to connect automatically to the free access one.

With the current behaviour, if I go to a part of the campus where only the free access network is available, this one will become the most recently used. As a result, if I later find myself powering up my laptop in a part where both networks are available, nm will connect to the free access network, which is not what I want.

The requested behaviour seems easier to implement than the existing one, because there is no need to track the recency of the usage of the networks. The GUI would have to be a little modified, for example to show a list of networks that we do not automatically connect to, and a list of networks that we do automatically connect to, the latter having "Move up" and "Move down" buttons.

Changed in network-manager (Ubuntu):
status: Incomplete → New
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed
Kal Palatov (lambda25) wrote :

I agree with user YS1. I have a similar problem.

They had this basic functionality in windows xp...

Changed in network-manager (Ubuntu):
importance: Undecided → Wishlist
Adam Porter (alphapapa) wrote :

This is a very frustrating problem. When I am on my university campus, I use the campus wireless. When I'm at home, I use my own router. But sometimes when I'm at home, my system picks up the fringe of the campus wireless signal--but not strongly enough to connect to it. But it's strong enough for NM to try to connect to it instead of my own router--so then I have to manually choose my own router, or it will sit there forever trying to connect to the campus wireless.

It seems like adding priority settings should be a straightforward thing to do. I hope the importance of this issue will be recognized.

8200 (8200) wrote :

Hi folks,

I'm also searching for the possibility to set my wifi connections prioritys (as it is in Windows 7).

Where can we make a feature request?


Thomas Hood (jdthood) on 2012-06-24
summary: - wifi network priority
+ Please provide a mechanism whereby Wi-Fi networks can be prioritized

Same here, University WIFI should have priority but if that WIFI is not available the automatic connection should fallback to my ad-hoc connection

Any workaround?

Mariano Dupont (marianomd) wrote :

The problem is not so simple:

Once I've ordered the list of networks (A, B, C), suppose I'm connected to network A, and nm detects there is no connectivity (i.e. no ping to gateway, or DNS), then it should fallback to network B.

The problem here is how to decide when to go back to network A without interrupting connectivity.

1) The easy way is interrupting it, say, 30 minutes later and check. All connections will be lost.
2) Other possibility is stay on B until it loses connectivity.
3) The hard way, and I guess is not possible yet, is that the NIC and the driver support virtual STAtions, this way it can associate to multiple APs simultaneously. In that case we could even round robin connections and have bandwidth incremented.


Joe Amenta (airbreather) wrote :


I do not believe that users such as myself are requesting that NM should "upgrade" an active connection from B to A when it detects that this is possible.

The request is to allow users to configure the order in which NM automatically tries to connect to networks. If I have a T3 line to my house behind a wireless router, I don't want NM to choose anything else when that is in range.

Similarly, if I carry around a portable hotspot device with metered bandwidth, I don't want NM choose that unless no other known wireless networks are in range.

I don't want NM to automatically interrupt my Call of Duty session (or whatever the kids are playing these days) to connect to a different network if the currently connected network is working just fine.

Eero (eero+launchpad) wrote :

Yeah as AirBreather wrote, nobody here suggested changing the active connection. Just setting the basic priorities when a new connection is formed. This should be pretty basic stuff that has been implemented everywhere else almost 10 years ago.

Thomas Hood (jdthood) wrote :

Quote from upstream report (

There won't ever be user-defined priorities in NM. NM connects to the last
network you've connected to that it can find. When you connect, NM timestamps
the network, and it will first connect to the most recent network you have
chosen. NM 0.7 also matches security settings, so if you have a WPA-enabled
'linksys' and an open 'linksys' saved it will pick the right one. 0.7 also has
a connection editor that will allow for easy removal of networks, but with
0.6.5 you can also use gconftool-2 --recursive-unset /path/to/your/network to
remove it.

If you dont' want NM connecting to a network, remove it from the network list
and dont' manually connect to it again.

Rolf Leggewie (r0lf) wrote :

that comment is from 2007 and hopefully things will be reconsidered

mvdkwast (mvdkwast) wrote :

> There won't ever be user-defined priorities in NM.

Old comment, no rationale. Time for a change ?

Instead of full-blown network prioritization which would involve a gui to sort connections and careful thinking to ensure that the connection selection stays predictable, would it be enough to add a boolean "preferred" field ?

In the original example, "home" and "work" would be marked as preferred, while "beeline-wifi-free" would not.

A quick glance at the NetworkManager source code makes me think that it shouldn't be too hard to add a "preferred" attribute to network connections, and to use it in the connection_sort function (nm-settings.c). It would be shown as a checkbox in nm-applet.

If more granularity is required, a numeric "priority" attribute could be used instead. If it seems to confusing to expose a numeric connection priority value to the users, it could still be shown as a "preferred" checkbox in nm-applet, leaving it to power users to edit the numeric value manually in the configuration file if required.

Steven Roose (stevenroose) wrote :

Why do essential features so often take so long to enter Ubuntu.

Did they really already give up their desktop OS because the money lies in phones and tablets?
They should first finalize their far-from-done desktop OS instead of messing around in other markets.

Claus Lensbøl (cmol) wrote :

As far as i know OSX has a list where you can drag-n-drop networks. The closer to the top, the higer the priority. The suggestion from #20 sounds good though.

Jeffrey Flaker (jflaker) wrote :

This is definitely necessary as opposed to a wishlist item. Here's why.

Cable providers offer WiFi hotspots now and coverage is growing rapidly.

While at home, I can use either one. However, when I am home, I WANT my network because it is faster. The old mindset was that the system would use an available network that you had set up......However, with HotSpot coverage, I get either one at home.

I would prefer an option to use the order of appearance in the network window with a move up/down to order the priority.

Mirar (launchpad-sort) wrote :

> There won't ever be user-defined priorities in NM.

Does that mean that someone needs to create something else than NM,
if NM never will solve the problems users have? That's kind of a sad statement.
Please confirm.

> NM connects to the last
> network you've connected to that it can find. When you connect, NM timestamps
> the network, and it will first connect to the most recent network you have
> chosen.

This doesn't solve the problem. One problem: I have two networks, 2.4GHz and 5GHz.
The 2.4 have better range (of course), but when the 5GHz is available, I want NM to switch to that one. But if it previously connected to the 2.4, it will NEVER switch to 5GHz again.

Similar for a wider (public) network that also covers your home. When you're home, you want that network to be picked. But when you leave home and use the public network (eduroam?), NM will never pick your home network again, because it's also covered by the public network. And the public network now have a "better" timestamp.

Anton (feenstra) wrote :

IMHO, I agree with the previous several posters: anno 2014, AP priorities are not a luxury, but necessity.

The thing could be solved with just one bit of "priority" thing. I already commented to the upstream bug and had no answers.

I imagine that using the NM scripts dispatcher you can implement some workaround, though:

Changed in network-manager:
importance: Unknown → Wishlist
status: Unknown → Confirmed
higuita (higuita) wrote :

I have my wireless at home. I also have a FON (fonera) account. The problem is that my neighbor have a FON router also and his signal strength is as strong as mine. Every time i turn on the computer, i have about 50% change of getting the right wireless, mine. Other times i have all networks reporting error and the browser showing the fon login page. I have either to login in the fon page or manually switch to the right wireless. very annoying!! At very least connect to the most used network!

Changed in network-manager:
status: Confirmed → In Progress
Marius B. Kotsbak (mariusko) wrote :

Hmm, are you unable to change the Wifi name?

@Marius I have exactly the same problem with the University network and the global EDUROAM network. And no, I can't change the name of any of them; I just want NM to connect to my local University network whenever available, even if last time I manually connected to the global EDUROAM --- because I was in another university campus.

Let me explain exactly the problem:

- I have a wifi account on my university network, let call it UNIWIFI. When I am connected to this network I can print (and more, but use that as an example).
- I have an account on EDUROAM, which is broadcast on hundreds of universities, included mine. When I am connected with EDUROAM, I cannot print.

Now I move between my campus and other campuses. So the last connection could well be EDUROAM, because I was, say, attending a meeting. Or because I entered the elevator in my campus and the UNIWIFI was lost and by chance exiting the elevator NM was trying to connect to EDUROAM, and succeeded.

Summary: I would like to have a way to say that if UNIWIFI is available, NM should switch to it even if the EDUROAM is available and was automatically connected (with automatically I mean after a connection loss or reboot or wake-up). I really think that just one bit of priority is all that is needed. Now I have to check and sometime change manually my connection every time I have to do a privileged (like printing) operation...

BTW, this is not a criticism of NM in general. NM is a really outstanding tool and works perfectly, out of the box, with no help from the user 98% of the time --- which is almost magical. Simply there are cases where the heuristic of connection does not work; it would be really nice if the UNIWIFI AP could send a "this network supersedes EDUROAM" info in the broadcast, but...

Changed in network-manager:
status: In Progress → Fix Released
Alf Haakon Lund (alf-c) wrote :

I love to see the "Fix released" message!

Now I just wonder how to make my system use the fixed version? Will this happen 'automagically' on my Ubuntu Studio 14.04 box?

Marius B. Kotsbak (mariusko) wrote :

Well, the fix must be released, and the fixed version be included into Ubuntu. Be awere that this is just a feature implemented with an API in the Network manager core with an API, so clients like nm-applet must expose this functionality for it to be easily used.

Changed in plasma-widget-networkmanagement:
importance: Unknown → Wishlist
status: Unknown → Won't Fix
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager-applet (Ubuntu):
status: New → Confirmed
Changed in networkmanagement (Ubuntu):
status: New → Confirmed
flohack (flori-bin) wrote :

Any progress on this? Specifically I would need this function in my Ubuntu Touch phone ;)

BR Florian

@flohack: If U want this as feature in Ubuntu-Touch - U should register a separate bug against this applicaction ->

U won't get any results/progress here, period - if U don't register a bug-report against the package in question.

torzsmokus (torzsmokus) wrote :

will this fix arrive to the current LTS or just the next one?

Rolf Leggewie (r0lf) wrote :

This should be fixed in at least Yakkety and Xenial with upstream commit a7c8e5c6e9aad. This being "
Please provide a mechanism whereby Wi-Fi networks can be prioritized" in Network-Manager. Clearly, there are still further possible improvements and upstream is already discussing a few in but wifi priorities has been implemented and thus this ticket shall be closed as fixed. It's good to see upstream reversing their initial stance. Too bad trusty most likely won't see this fix.

Changed in network-manager (Ubuntu):
status: Confirmed → Fix Released
Changed in networkmanagement (Ubuntu):
status: Confirmed → Won't Fix
Rolf Leggewie (r0lf) wrote :

For those on Xenial and later, can you please confirm if there is GUI-support for this or if it's cli-only?

Changed in network-manager-applet (Ubuntu):
status: Confirmed → Incomplete
Marius B. Kotsbak (mariusko) wrote :

In KDE, it is fixed. There is a priority field.

Changed in networkmanagement (Ubuntu):
assignee: nobody → Marius B. Kotsbak (mariusko)
assignee: Marius B. Kotsbak (mariusko) → nobody
Marius B. Kotsbak (mariusko) wrote :

Verified in 16.04 that there is no setting for priority in nm-applet.

Changed in network-manager-applet (Ubuntu):
status: Incomplete → Confirmed
Changed in network-manager-applet:
importance: Unknown → Wishlist
status: Unknown → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.