2

I upgraded Xubuntu to 14.04 a few months ago and ignored that problem for a while, but it's getting ridiculous.

My NetworkManager connects to some random (configured) network, instead of the last active one, like it used to be. So when I plug in the Ethernet cable it connects to one of the 10 fixed IP configurations I have instead of DHCP like it did last time. When I come home it often doesn't automatically connect to my home WiFi, but to some WiFi with the same name like one I configured years ago and haven't really used in ages.

How can I fix this to get the old behaviour back?

Edit: This is my expected behaviour and how I remember before the update:

  • "MyHomeNetwork" is the one I last connected to 1 day ago
  • "dlink" I connected to last 5 months ago and might do so again in the future
  • I can see a "dlink" network in my neighbourhood besides the "MyHomeNetwork"
  • I want NetworkManager to connect to "MyHomeNetwork" because it was the most recently active one
  • See slight edit to the best answer you've got (I agree on removing unused, but now there is an option to "remember but not connect" as well.) If you want to automatise this except for "MyHomeNetwork" leave a comment @Fabby. – Fabby Feb 09 '15 at 08:02

2 Answers2

2

Having several wireless SSIDs with the same name is fairly common in University dorms and other living arrangements where wifi is provided as part of the rent or lease. The first step I suggest is to check here from the terminal:

ls /etc/NetworkManager/system-connections/

You will see connection information for many previous networks; for example:

GBR1 USRP CMC-guest MAHB motel-guest

You may remove any that you are certain you will not be using in the future:

sudo rm -rf /etc/NetworkManager/system-connections/MAHB

Next, if you have two wireless access points with the same name, I suggest you bind to the preferred network as in this answer: Ubuntu connect drops. Worked for a while then started dropping again

For the connections that you want to remember but not connect to:

sudo nano /etc/NetworkManager/system-connections/NameOfNetwork

and set autoconnect=true to autoconnect=false

chili555
  • 60,188
  • 1
    If I see your name on any question , its damn sure that there is answer from you. Chili you are awesome. – Raja G Feb 04 '15 at 15:39
  • I can't see how my wired connections would be affected by this. Also, no, I still need the connection (and password of it), so I can't just delete it, I just haven't used it in the last few months. The binding to an essig won't work either, since I have more than one access point and this is not the problem. So, yeah, nothing of your ideas really solve my problem. – dailycoffee Feb 04 '15 at 15:57
  • So, yeah. Aren't there networks you configured years ago that can safely be deleted? Aren't wired connections also stored there? – chili555 Feb 04 '15 at 16:18
  • if you need the passwords for those you could just mv /etc/NetworkManager/system-connections/EXAMPLE /etc/Network/Manager/system-connections/EXAMPLE.bak You will still be able to read that file's contents, i.e. configuration for that network, and copy as necessary. – Sergiy Kolodyazhnyy Feb 04 '15 at 18:12
  • Ah, great, selected dhcp as the only automatic option, now that crapware has to think half a minute if it really really wants to connect to it. I give up. – dailycoffee Feb 09 '15 at 18:32
1

First of all, open "Edit Network Connections" dialogue or call it through terminal with nm-connection-editor. Then open the dlink connection, and under General, uncheck " Automatically connect to this network "

What else you could do is edit the /etc/NetworkManager/NetworkManager.conf file, by adding no-auto-default=* , which should prevent Network Manager creating a default wired connection.

Also, don't forget that changes take effect upon restarting network manager with sudo service network-manager restart

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497