# NetworkManager immediately disconnects after connecting

## djhyland

Hi all, I'm guessing this is a NetworkManager problem.

I recently switched internet providers and thus got a new wireless router. To make things as seamless as possible for myself and my family, I set the new router up with the same SSID and password as I had on the old router. Since then, however, I've been having problems connecting to the SSID I set up. I can connect to other SSIDs just fine, but when I try to connect with the SSID that shares the name with the one on my old router, it won't stay connected.

I've tried connecting using both the graphical nm-applet and the command line nmcli. nm-applet asks me for my password, accepts it, and connects to my SSID for a moment before immediately disconnecting, while nmcli goes through a cycle of connecting, disconnecting, and reconnecting. I assume that both methods do about the same thing, but since the command line is easier to duplicate in text than the gui, I'll post my commands and output below.

Connecting to the network seems to work:

```
araucaria ~ # nmcli device wifi connect GodEmperorDrothan password ********

Device 'wlan0' successfully activated with '44808227-84f0-43da-a8e8-74be6b6bae10'.
```

But it doesn't seem to stay working, and cycles between these statuses:

```
araucaria ~ # nmcli general status

STATE       CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN    

connecting  none          enabled  enabled  enabled  enabled 

araucaria ~ # nmcli general status

STATE      CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN    

connected  full          enabled  enabled  enabled  enabled 

araucaria ~ # nmcli general status

(process:19790): GLib-GIO-WARNING **: 18:46:11.638: /var/tmp/portage/dev-libs/glib-2.58.2/work/glib-2.58.2/gio/gdbusobjectmanagerclient.c:1589: Processing InterfaceRemoved signal for path /org/freedesktop/NetworkManager/DHCP4Config/51 but no object proxy exists

(process:19790): GLib-GIO-WARNING **: 18:46:11.639: /var/tmp/portage/dev-libs/glib-2.58.2/work/glib-2.58.2/gio/gdbusobjectmanagerclient.c:1589: Processing InterfaceRemoved signal for path /org/freedesktop/NetworkManager/DHCP6Config/43 but no object proxy exists

(process:19790): GLib-GIO-WARNING **: 18:46:11.858: /var/tmp/portage/dev-libs/glib-2.58.2/work/glib-2.58.2/gio/gdbusobjectmanagerclient.c:1589: Processing InterfaceRemoved signal for path /org/freedesktop/NetworkManager/IP4Config/60 but no object proxy exists

(process:19790): GLib-GIO-WARNING **: 18:46:11.858: /var/tmp/portage/dev-libs/glib-2.58.2/work/glib-2.58.2/gio/gdbusobjectmanagerclient.c:1589: Processing InterfaceRemoved signal for path /org/freedesktop/NetworkManager/IP6Config/60 but no object proxy exists

(process:19790): GLib-GIO-WARNING **: 18:46:11.863: /var/tmp/portage/dev-libs/glib-2.58.2/work/glib-2.58.2/gio/gdbusobjectmanagerclient.c:1589: Processing InterfaceRemoved signal for path /org/freedesktop/NetworkManager/AccessPoint/2116 but no object proxy exists

(process:19790): GLib-GIO-WARNING **: 18:46:11.863: /var/tmp/portage/dev-libs/glib-2.58.2/work/glib-2.58.2/gio/gdbusobjectmanagerclient.c:1589: Processing InterfaceRemoved signal for path /org/freedesktop/NetworkManager/AccessPoint/2117 but no object proxy exists

STATE         CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN    

disconnected  none          enabled  enabled  enabled  enabled
```

As far as I can tell, my Gentoo install is the only device affected by changing my router. I dual-boot with MacOS and Linux Mint on the same computer and both connect to the new router just fine without any changes whatsoever. The rest of the computers, phones, and devices in the house likewise see no difference. Is there some configuration file left over somewhere or something that's hanging on to my old router's information and interfering with my connection?

I am running a kernel compiled from gentoo-sources-4.19.10 and have networkmanager-1.14.4 and nm-applet-1.8.18 installed. I can supply logs and configuration files as requested.

Thanks in advance!

----------

## niku

Have you deleted the saved configuration for the connection and set it up afresh? You can easily do it from nmtui.

----------

## djhyland

 *niku wrote:*   

> Have you deleted the saved configuration for the connection and set it up afresh? You can easily do it from nmtui.

 

Yes, with nmtui, nmcli, and nm-applet. Deleting the saved connection doesn't seem to have any effect on the problem. When I connect anew, the problem is still there no matter how many times I delete the saved connections.

----------

## niku

Lots of questions then, but first, can you connect to any other network from Gentoo?

Anyway, time for the log files! NetworkManager has a rather voluminous log in syslog (in my system -- using mlog -- it is at /var/log/everything/current). But, there must be people here who would find even more detailed logs from NM useful. So, please increase the log level. To do that, create a file called /etc/NetworkManager/NetworkManager.conf, and put the following in it:

[logging]

level=DEBUG

#the default is INFO

#/usr/share/gtk-doc/html/NetworkManager/NetworkManager.conf.html

----------

## djhyland

 *niku wrote:*   

> Lots of questions then, but first, can you connect to any other network from Gentoo?

 

First off, thanks for the help, niku!

I can connect to other wireless networks from Gentoo. I'm writing from one now, so I haven't hosed the entirety of my connectivity at least.

I've set the logging to DEBUG level. What logs can I post to help? I can start with /var/log/messages grepped for NetworkManager through four connection/disconnection cycles on SSID GodEmperorDrothan:

Pastebin

Please let me know if you need other logs or more information.

----------

## niku

Actually, you need someone more knowledgeable than me to understand the issue from the log file. (I didn't gain anything useful from it.) In the meantime, the easy stuff:

Given that you can connect to other networks from the same installation, and to the same network from other installations, there is something wrong with the way your version of NM and your router are interacting.

What if it is a bug in your version of NetworkManager? If you are using the latest version of NM, try downgrading.

----------

## Fitzcarraldo

```
      /* Let the manager try to fill in the SSID from seen-bssids lists */

      ssid = nm_wifi_ap_get_ssid (ap);

      if (!ssid || _nm_utils_is_empty_ssid (ssid)) {

         /* Try to fill the SSID from the AP database */

         try_fill_ssid_for_hidden_ap (self, ap);

         ssid = nm_wifi_ap_get_ssid (ap);

         if (   ssid

             && !_nm_utils_is_empty_ssid (ssid)) {

            gs_free char *s = NULL;

            /* Yay, matched it, no longer treat as hidden */

            _LOGD (LOGD_WIFI, "matched hidden AP %s => %s",

                   nm_wifi_ap_get_address (ap),

                   (s = _nm_utils_ssid_to_string (ssid)));

         } else {

            /* Didn't have an entry for this AP in the database */

            _LOGD (LOGD_WIFI, "failed to match hidden AP %s",

                   nm_wifi_ap_get_address (ap));

         }

      }
```

Source: https://github.com/NetworkManager/NetworkManager/blob/master/src/devices/wifi/nm-device-wifi.c

djhyland, from the /var/log/messages output you posted it looks to my inexpert eyes like your machine may be associating the SSID with the BSSID of the old router (or something along those lines). I would try connecting to the new BSSID using nmcli, to see if that works, and, perhaps, re-associates the SSID with the new BSSID permanently. The following link shows how to use nmcli to find the BSSID and how to connect to it: https://askubuntu.com/a/833918

----------

## djhyland

 *Fitzcarraldo wrote:*   

> djhyland, from the /var/log/messages output you posted it looks to my inexpert eyes like your machine may be associating the SSID with the BSSID of the old router (or something along those lines). I would try connecting to the new BSSID using nmcli, to see if that works, and, perhaps, re-associates the SSID with the new BSSID permanently. The following link shows how to use nmcli to find the BSSID and how to connect to it: https://askubuntu.com/a/833918

 

Thanks for helping out, Fitzcarraldo!

Using nmcli to connect via BSSID leads to the same problem as all the other methods: a successful connection, an almost immediate disconnection, and a cycle of reconnection and disconnection.

One thing I noted is that there are two SSIDs with the same name (GodEmperorDrothan) as the one I'm trying to use. I can connect to both (and then get disconnected...) using the same password. They have almost identical BSSIDs: only the last digit is different between the two. I don't think that this is a problem, because my Mint install shows both as well and automatically connects to the second one (8C:0F:6F:04:56:18) just fine. Still, could this hint towards the underlying problem?

For the record, my old router is not powered on, so it's not interfering.

```
djhyland@araucaria ~ $ nmcli -f in-use,ssid,bssid,signal,bars dev wifi

IN-USE  SSID                  BSSID              SIGNAL  BARS 

        GodEmperorDrothan     8C:0F:6F:04:56:10  100     ▂▄▆█ 

        --                    9A:0F:6F:04:56:10  100     ▂▄▆█ 

        GodEmperorDrothan     8C:0F:6F:04:56:18  100     ▂▄▆█ 

        --                    96:0F:6F:04:56:18  100     ▂▄▆█ 

        --                    92:0F:6F:04:56:18  100     ▂▄▆█ 

        NTGR_VMB_1521827683   9C:3D:CF:14:99:84  65      ▂▄▆_ 

        Motor1884-2.4         10:05:01:A5:48:18  57      ▂▄▆_ 

        xfinitywifi           1A:05:01:A5:48:18  55      ▂▄__ 

        xfinitywifi           16:05:01:A5:48:20  54      ▂▄__ 

        Motor1884-5.0         10:05:01:A5:48:20  52      ▂▄__ 

        XFINITY               1E:05:01:A5:48:20  52      ▂▄__ 

        --                    1A:05:01:A5:48:20  52      ▂▄__ 

        DIRECTV_WVB_2336EB98  B4:2A:0E:BA:60:46  39      ▂▄__ 

        Loading...            BC:9B:68:72:A3:37  35      ▂▄__ 

        --                    BC:9B:68:72:A3:38  35      ▂▄__ 

        --                    BC:9B:68:72:A3:3C  35      ▂▄__ 

        xfinitywifi           BC:9B:68:72:A3:39  35      ▂▄__ 

        --                    FA:8F:CA:5D:07:E8  34      ▂▄__ 

djhyland@araucaria ~ $ nmcli d wifi connect 8C:0F:6F:04:56:18

Device 'wlan0' successfully activated with '9388fc1e-d7fa-4c8e-ae21-0ff488ce59b3'.

djhyland@araucaria ~ $ nmcli d wifi connect 8C:0F:6F:04:56:10

Device 'wlan0' successfully activated with 'bb91fd9b-319e-427a-aa09-f07362d63804'.
```

----------

## NeddySeagoon

djhyland,

You probably have a 5GHz and a 2.4GHz WiFi.

Cycling connect/disconnect usually means that you have several things trying to control your wifi.

If you stop NetworkManager and reboot, does it just work anyway?

----------

## Fitzcarraldo

djhyland,

If what NeddySeagoon suggested does not resolve the problem, what files are in the directory /etc/NetworkManager/system-connections?:

```
$ ls /etc/NetworkManager/system-connections
```

Also, what are the contents of the file /etc/NetworkManager/system-connections/GodEmperorDrothan?:

```
$ sudo cat /etc/NetworkManager/system-connections/GodEmperorDrothan
```

Also, what are the contents of the file /etc/NetworkManager/NetworkManager.conf?:

```
$ cat /etc/NetworkManager/NetworkManager.conf
```

You wrote that Linux Mint on the same machine connects OK via NetworkManager, so have you compared the contents of the directory /etc/NetworkManager/system-connections/ in each distribution, the contents of the file /etc/NetworkManager/system-connections/GodEmperorDrothan in each distribution, and the contents of the file /etc/NetworkManager/NetworkManager.conf in each distribution?

----------

## djhyland

Thanks for helping me out, Neddy Seagoon!

 *NeddySeagoon wrote:*   

> You probably have a 5GHz and a 2.4GHz WiFi.

 

Oh, yeah, that makes sense.

 *Quote:*   

> Cycling connect/disconnect usually means that you have several things trying to control your wifi.
> 
> If you stop NetworkManager and reboot, does it just work anyway?

 

No luck here, either. After stopping the NetworkManager service and rebooting, NetworkManager automatically connects, disconnects, and goes back through the cycle again. It seems to default to this network, even if I log out while connected to a different network.

 *Fitzcarraido wrote:*   

> If what NeddySeagoon suggested does not resolve the problem, what files are in the directory /etc/NetworkManager/system-connections?

 

```
araucaria ~ # ls /etc/NetworkManager/system-connections/

'Auto Zoom'                         'GodEmperorDrothan 2.nmconnection'

 CenturyLink1787                    'GodEmperorDrothan 3.nmconnection'

'County Inn & Suites'                GodEmperorDrothan.nmconnection

'GodEmperorDrothan 1.nmconnection'   xfinitywifi.nmconnection
```

Uh, that looks possibly suspicious. Should there should be multiple GodEmperorDrothan connections there? nm-applet shows these four as options under GodEmperorDrothan as well. I've been using xfinitywifi.nmconnection to connect while I've been trying to figure this problem out, and there's only one of those.

 *Quote:*   

> Also, what are the contents of the file /etc/NetworkManager/system-connections/GodEmperorDrothan?

 

I'm posting GodEmperorDrothan.nmconnection since I don't have a file without the extension:

```
araucaria ~ # cat /etc/NetworkManager/system-connections/GodEmperorDrothan.nmconnection 

[connection]

id=GodEmperorDrothan

uuid=dc8603d7-2ace-4b82-a96a-a1282853ab50

type=wifi

permissions=

[wifi]

mac-address=18:56:80:70:95:BD

mac-address-blacklist=

mode=infrastructure

ssid=GodEmperorDrothan

[wifi-security]

auth-alg=open

key-mgmt=wpa-psk

psk=********

[ipv4]

dns-search=

method=auto

[ipv6]

addr-gen-mode=stable-privacy

dns-search=

method=auto
```

The other versions of GodEmperorDrothan *.nmconnection look to be the same, except for having different UUIDs.

If it helps, here's the contents of the working GodEmperorDrothan (this one doesn't have the .nmconnection extension) from my Mint, uh, Ubuntu install (I know I said Mint before...I remembered incorrectly):

```
araucaria ~ # cat /media/ubuntu/etc/NetworkManager/system-connections/GodEmperorDrothan

[connection]

id=GodEmperorDrothan

uuid=45cd4ebb-1885-4386-a1aa-916d3805a940

type=wifi

permissions=user:ubuntu-mate:;

[wifi]

mac-address=18:56:80:70:95:BD

mac-address-blacklist=

mode=infrastructure

ssid=GodEmperorDrothan

[wifi-security]

auth-alg=open

key-mgmt=wpa-psk

psk=********

[ipv4]

dns-search=

method=auto

[ipv6]

addr-gen-mode=stable-privacy

dns-search=

method=auto
```

The difference, besides having a different UUID, looks to be that the working configuration has "permissions=user:ubuntu-mate:;", whereas the non-working configuration has "permissions=". Somehow, did I lose the needed authorization when I changed routers?

And from the working xfinitywifi.nmconnection on my Gentoo install, that I'm using to connect while trying to fix GodEmperorDrothan:

```
araucaria ~ # cat /etc/NetworkManager/system-connections/xfinitywifi.nmconnection 

[connection]

id=xfinitywifi

uuid=94831f07-bb14-46b4-8595-8ce5bd1ea668

type=wifi

permissions=user:djhyland:;

[wifi]

mac-address=18:56:80:70:95:BD

mac-address-blacklist=

mode=infrastructure

ssid=xfinitywifi

[ipv4]

dns-search=

method=auto

[ipv6]

addr-gen-mode=stable-privacy

dns-search=

method=auto
```

This network has no security, and so no password information, but I notice that it has a non-empty permissions line as well: "permissions=user:djhyland:;".

 *Quote:*   

> Also, what are the contents of the file /etc/NetworkManager/NetworkManager.conf?

 

It's just what I put in to enable debug-level logging as per niku's suggestion upthread. Before that, I didn't have a /etc/NetworkManager/NetworkManager.conf file.

```
araucaria ~ # cat /etc/NetworkManager/NetworkManager.conf 

[logging]

level=DEBUG

#the default is INFO

#/usr/share/gtk-doc/html/NetworkManager/NetworkManager.conf.html
```

----------

## djhyland

 *Fitzcarraldo wrote:*   

> You wrote that Linux Mint on the same machine connects OK via NetworkManager, so have you compared the contents of the directory /etc/NetworkManager/system-connections/ in each distribution, the contents of the file /etc/NetworkManager/system-connections/GodEmperorDrothan in each distribution, and the contents of the file /etc/NetworkManager/NetworkManager.conf in each distribution?

 

I've posted /etc/NetworkManager/system-connections/GodEmperorDrothan* from both distros in my last post, and the only appreciable difference was the permissions line. After backing up the original GodEmperorDrothan.nmconnection and changing the permissions to correspond to the permissions in the working xfinitywifi.nmconnection (e.g. "permissions=user:djhyland:;), I tried again but found no change in behavior.

As for the other two, here's what I have.

Gentoo, not working:

```
araucaria ~ # ls /etc/NetworkManager/system-connections/

'Auto Zoom'                         'GodEmperorDrothan 3.nmconnection'

 CenturyLink1787                     GodEmperorDrothan.nmconnection

'County Inn & Suites'                GodEmperorDrothan.nmconnection.backup

'GodEmperorDrothan 1.nmconnection'   xfinitywifi.nmconnection

'GodEmperorDrothan 2.nmconnection'
```

```
araucaria ~ # cat /etc/NetworkManager/NetworkManager.conf 

[logging]

level=DEBUG

#the default is INFO

#/usr/share/gtk-doc/html/NetworkManager/NetworkManager.conf.html
```

Ubuntu, working:

```
araucaria ~ # ls /media/ubuntu/etc/NetworkManager/system-connections/

 GodEmperorDrothan  'GodEmperorDrothan 1'  'GodEmperorDrothan 2'
```

```
araucaria ~ # cat /media/ubuntu/etc/NetworkManager/NetworkManager.conf 

[main]

plugins=ifupdown,keyfile

[ifupdown]

managed=false

[device]

wifi.scan-rand-mac-address=no
```

----------

## Fitzcarraldo

I would suggest you delete all the GodEmperorDrothan* connections and create a single new one via the nm-applet GUI:

```
# rm /etc/NetworkManager/system-connections/GodEmperorDrothan*
```

----------

## djhyland

 *Fitzcarraldo wrote:*   

> I would suggest you delete all the GodEmperorDrothan* connections and create a single new one via the nm-applet GUI:
> 
> ```
> # rm /etc/NetworkManager/system-connections/GodEmperorDrothan*
> ```
> ...

 

All right, it's a small change, but maybe it points to the problem: I deleted all of the GodEmperorDrothan connections, rebooted the computer, and tried connecting again via nm-applet. As before, it connected, then disconnected. However, this time, it stayed disconnected and did not cycle through reconnecting and disconnecting. I looked at the new /etc/NetworkManager/system-connections/GodEmperorDrothan.nmconnect file, and it seems that it does have permissions this time around:

```
araucaria ~ # ls /etc/NetworkManager/system-connections/

'Auto Zoom'       'County Inn & Suites'             xfinitywifi.nmconnection

 CenturyLink1787   GodEmperorDrothan.nmconnection

araucaria ~ # cat /etc/NetworkManager/system-connections/GodEmperorDrothan.nmconnection 

[connection]

id=GodEmperorDrothan

uuid=f5cfe2b2-3d6a-4326-a800-71c5849114bd

type=wifi

permissions=user:djhyland:;

[wifi]

mac-address=18:56:80:70:95:BD

mac-address-blacklist=

mode=infrastructure

ssid=GodEmperorDrothan

[wifi-security]

auth-alg=open

key-mgmt=wpa-psk

psk=********

[ipv4]

dns-search=

method=auto

[ipv6]

addr-gen-mode=stable-privacy

dns-search=

method=auto
```

So there's that, at least.

I did get an error message when first trying to connect to GodEmperorDrothan after deleting its connection files: a popup with "Connection failure" in the title bar, "Failed to add/activate connection (2) Active connection removed before it was initialized" in the main window, and a "Close" button. After clicking close and retrying, I got the connection and subsequent disconnection described above. I'd guess that this was because there was no longer a connection file on the first try, but I guess it could point to a different problem.

----------

## niku

Could it be that some other program, as is here, is trying to control the same interface? (Though why would the problem show up only after changing your hardware?) Even so, what is the output of 

```
rc-update show default
```

By the way, if downgrading, it may make sense to first downgrade to the exact version Ubuntu is using. (If that works, you could next try the next-to-the-highest version available.) I am not certain of the canonical way to do this in Gentoo, but this would work: If the version of NetworkManager you are using in Ubuntu is 1.12.0, you'd add `>net-misc/networkmanager-1.12.0' to /etc/portarge/package.mask.

----------

## djhyland

 *niku wrote:*   

> Could it be that some other program, as is here, is trying to control the same interface? (Though why would the problem show up only after changing your hardware?) Even so, what is the output of 
> 
> ```
> rc-update show default
> ```
> ...

 

I don't think that any of the other services running are interfering with NetworkManager. At least, none of the usual suspects listed in the Arch forum thread you linked are there, and the others ones I do have running seem unrelated:

```
araucaria ~ # rc-update show default

       NetworkManager | default

                acpid | default

                  atd | default

           consolekit | default

                cupsd | default

                 dbus | default

          laptop_mode | default

                local | default

             netmount | default

               pommed | default

            syslog-ng | default

           vixie-cron | default

                  xdm | default
```

I looked and saw that my Ubuntu install has version 1.10.6 of network-manager. Gentoo doesn't seem to have anything older than the currently-installed net-misc/networkmanager-1.14.4 available in its official repos, though, so I haven't tried downgrading.

----------

## NeddySeagoon

djhyland,

Remove NetworkManager from the default runlevel, reboot and see what happens.

Your dmesg from that restart will be very useful.

----------

## djhyland

 *NeddySeagoon wrote:*   

> djhyland,
> 
> Remove NetworkManager from the default runlevel, reboot and see what happens.
> 
> Your dmesg from that restart will be very useful.

 

Here's my /var/log/dmesg after rebooting with NetworkManager removed from the default runlevel:

Pastebin

----------

## niku

1) Keep networkmanager disabled, and have wpa_supplicant directly control the interface.

Check this or this, and there is a gui for that too! (wpa_gui)

It would, at least, simplify the problem.

2) Check if you had added something at /etc/wpa_supplicant/* and /etc/conf.d/wpa_supplicant/* (and forgot about it).

For completion, try this too: temporarily change your router's name. (ESSID) (So that all saved configurations, everywhere, can be ruled out.)

3) The dmesg shows nothing useful.

----------

## NeddySeagoon

djhyland,

There are good points and bad points in dmesg.

The kernel driver and firmware load, as expected

The interface wlan0 never appears so it can't be brought up by anything.

That was unexpected.

I was half expecting this test to demonstrate that Wifi worked, thus there was something else trying to control it.

After 

```
[   10.983713] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
```

 wifi does not appear.

What does dmesg look like after a reboot and a couple of up/down wifi cycles with NetWorkManager back in the default runlevel?

----------

## niku

 *Quote:*   

> The interface wlan0 never appears so it can't be brought up by anything.

 

In my dmesg too, wlan0 never shows up by itself. After the ieee80211 line, the next reference to the wireless interface is:

```
[    4.811843] iwlwifi 0000:08:00.0 wlp8s0: renamed from wlan0
```

And the one after that is:

```
[   14.128013] IPv6: ADDRCONF(NETDEV_UP): wlp8s0: link is not ready
```

----------

## NeddySeagoon

niku,

```
[    4.811843] iwlwifi 0000:08:00.0 wlp8s0: renamed from wlan0
```

means that wlan0 was already there, or it could not have been renamed.

Are you sure you don't have a wlan0 at all?

I guess that djhyland is using one of the methods to prevent network interface renaming as his/her eth0 is not renamed.

eth0 is there. wlan0 should be too or it could not be used at all.

----------

## niku

 *NeddySeagoon wrote:*   

> niku,
> 
> ```
> [    4.811843] iwlwifi 0000:08:00.0 wlp8s0: renamed from wlan0
> ```
> ...

 

Yeah, verbatim:

```
[    4.591719] iwlwifi 0000:08:00.0: Detected Intel(R) Centrino(R) Wireless-N

 2230 BGN, REV=0xC8

[    4.627219] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs'

[    4.630150] r8169 0000:02:00.0 enp2s0: renamed from eth0

[    4.811843] iwlwifi 0000:08:00.0 wlp8s0: renamed from wlan0

```

----------

## NeddySeagoon

niku,

That's odd. Does your eth0 appear anywhere else, other than the renamed line?

----------

## niku

 *NeddySeagoon wrote:*   

> niku,
> 
> That's odd. Does your eth0 appear anywhere else, other than the renamed line?

 

Yes,

```
[    0.200453] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded

[    0.200466] r8169 0000:02:00.0: can't disable ASPM; OS doesn't have ASPM control

[    0.200987] r8169 0000:02:00.0 eth0: RTL8168evl/8111evl at 0xffffa61300059000, 2c:d4:44:90:71:2d, XID 0c900800 IRQ 26

[    0.200993] r8169 0000:02:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]

```

----------

## NeddySeagoon

niku,

Thank you.  I'm at a loss to explain why eth0 appears but wlan0 does not unless its the kernel log level settings.

Different drivers can tag their messages with different log levels.

----------

## djhyland

 *niku wrote:*   

> 1) Keep networkmanager disabled, and have wpa_supplicant directly control the interface.
> 
> Check this or this, and there is a gui for that too! (wpa_gui)
> 
> It would, at least, simplify the problem.
> ...

 

Yes, I can successfully connect to GodEmperorDrothan via wpa_supplicant and it stays connected. I ran an emerge --sync && emerge -NuDa world to test it, and it worked fine. Still, nm-applet still doesn't stay connected when I restart NetworkManager.

```
araucaria ~ # wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/example.conf

Successfully initialized wpa_supplicant

araucaria ~ # dhcpcd wlan0

DUID 00:01:00:01:19:41:0e:26:f8:1e:df:e3:dc:52

wlan0: IAID 87:49:ef:98

wlan0: soliciting an IPv6 router

wlan0: rebinding lease of 10.0.0.208

wlan0: Router Advertisement from fe80::2043:69ff:fe7b:587

wlan0: adding address 2601:446:580:3e4a:913d:5b5e:38a1:1017/64

wlan0: adding route to 2601:446:580:3e4a::/64

wlan0: adding default route via fe80::2043:69ff:fe7b:587

wlan0: no useable IA found in lease

wlan0: soliciting a DHCPv6 lease

wlan0: REPLY6 received from fe80::2043:69ff:fe7b:587

wlan0: adding address 2601:446:580:3e4a::65cd/128

wlan0: renew in 302400, rebind in 483840, expire in 604800 seconds

forked to background, child pid 15336

dhcp6_listen: Address already in use

araucaria ~ # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11  ESSID:"GodEmperorDrothan"  

          Mode:Managed  Frequency:5.805 GHz  Access Point: 8C:0F:6F:04:56:18   

          Bit Rate=866.7 Mb/s   Tx-Power=0 dBm   

          Retry short limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=70/70  Signal level=-33 dBm  

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:47   Missed beacon:0

bond0     no wireless extensions.
```

Despite having no wlan0 in my dmesg, I have no problem in connecting to wlan0 via wpa_supplicant.

I'll try changing my SSID later tonight when I won't disconnect everyone else in the house and see what happens.

----------

## niku

 *djhyland wrote:*   

> Still, nm-applet still doesn't stay connected when I restart NetworkManager.

 

This is expected. When NM comes online, it kicks off every process trying to control "its" interface. (A bad solution to the problem would be to ask NM to not control wlan0, and run wpa_supplicant directly as a service. It would be bad because it will needlessly complicate your setup.)

 *Quote:*   

> I'll try changing my SSID later tonight when I won't disconnect everyone else in the house and see what happens.

 

By the way, try grepping through /etc too. It often helps. (grep -r GodEmperorDrothan /etc)

----------

## djhyland

 *niku wrote:*   

> By the way, try grepping through /etc too. It often helps. (grep -r GodEmperorDrothan /etc)

 

Hmm, that sounds like a good idea.

Changing the SSID of the router didn't make a difference, after all. I can connect to an unsecured SSID, but not to my WPA2-secured one. I'm going to try unsecuring it and seeing what happens...maybe it's a problem with authentication? 

EDIT: jeez, still no luck even with an unsecured connection. Also, I found the following by grepping through /etc:

```
/etc/conf.d/net.bak:mac_GodEmperorDrothan="F8:1E:DF:E3:DC:52"

/etc/conf.d/net.bak:enable_ipv6_GodEmperorDrothan="true"

/etc/conf.d/net.bak:config_GodEmperorDrothan="

/etc/conf.d/net.bak:auto_GodEmperorDrothan="true"

/etc/conf.d/net:mac_GodEmperorDrothan="F8:1E:DF:E3:DC:52"

/etc/conf.d/net:auto_GodEmperorDrothan="true"

/etc/conf.d/net:uuid_GodEmperorDrothan="4cf83215-f567-48eb-97c4-e0310e22a7ba"

/etc/conf.d/net:config_GodEmperorDrothan="

/etc/conf.d/net:enable_ipv6_GodEmperorDrothan="true"

/etc/wpa_supplicant/example.conf:   ssid="GodEmperorDrothan"

/etc/NetworkManager/system-connections/GodEmperorDrothan.nmconnection:id=GodEmperorDrothan

/etc/NetworkManager/system-connections/GodEmperorDrothan.nmconnection:ssid=GodEmperorDrothan

/etc/NetworkManager/system-connections/GodEmperorDrothan 1.nmconnection:id=GodEmperorDrothan 1

/etc/NetworkManager/system-connections/GodEmperorDrothan 1.nmconnection:ssid=GodEmperorDrothan
```

Nothing too suspicious here, but I did rename /etc/conf.d/net to /etc/conf.d/net.backup and tried again to no success. I'll grep through the whole system starting at / next.Last edited by djhyland on Fri Jan 04, 2019 8:24 pm; edited 1 time in total

----------

## NeddySeagoon

djhyland,

Your 

```
dhcpcd wlan0
```

 output above is interesting,

Two different IPv6 addresses assigned by two different mechanisms but no attempt at IPv4 at all.

Your IPv6 addresses are global. That means your system is directly connected to the internet unless you have an IPv6 firewall configured somewhere.

It does tell that it worked long enough to get a Router Advertisement message and a dhcp allocated address too.

What does 

```
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/example.conf 

dhcpcd -4 wlan0
```

tell after a reboot with NetworkManager removed from the default runlevel.

-4 means IPv4 only.

The output of dmesg after that might me useful.

----------

## djhyland

 *NeddySeagoon wrote:*   

> What does 
> 
> ```
> wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/example.conf 
> 
> ...

 

```
araucaria ~ # wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/example.conf 

Successfully initiated wpa_supplicant

araucaria ~ # dhcpcd -4 wlan0

wlan0: /etc/wpa_supplicant.conf does not exist

wlan0: not interacting with wpa_supplicant(8)

wlan0: waiting for carrier

wlan0: new hardware address; da:8e:48:9e:fc:11

wlan0: carrier acquired

DUID 00:01:00:01:19:41:0e:26:f8:1e:df:e3:dc:52

wlan0: IAID 48:9e:fc:11

wlan0: rebinding lease of 10.0.0.208

wlan0: probing for an IPv4LL address

wlan0: DHCP lease expired

wlan0: soliciting a DHCP lease

wlan0: offered 10.0.0.93 from  10.0.0.1

wlan0: probing address 10.0.0.03/24

wlan0: using IPvLL address 169.254.41.136

wlan0: adding route to 169.254.0.0/16

wlan0: adding default route

forked to background, child pid 21061
```

This, again, got me a stable connection to GodEmperorDrothan that didn't disconnect.

 *Quote:*   

> The output of dmesg after that might me useful.

 

I don't think it'll help you: dmesg ends after adding my swap space, and long before I ran the commands above. I'll post it anyway, though:

Pastebin

----------

## niku

This (disabling mac spoofing) one is worth a try. (Apparently, some devices don't work well if you mac keeps changing.)Last edited by niku on Sun Jan 06, 2019 2:00 am; edited 1 time in total

----------

## NeddySeagoon

djhyland,

```
araucaria ~ # wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/example.conf

Successfully initiated wpa_supplicant

araucaria ~ # dhcpcd -4 wlan0

wlan0: /etc/wpa_supplicant.conf does not exist 
```

Odd. It can't read your wifi keys and things, so you get a link local address on IPv4.

```
wlan0: using IPvLL address 169.254.41.136
```

I bet it works with IPv6, when you boot with NetworkManager in the default runlevel.

Try 

```
ping6 google.com

ping6 2a00:1450:4009:814::200e
```

If you don't have ping6, its ping -6 ...

----------

## Fitzcarraldo

djhyland,

You could also try changing the contents of the file /etc/NetworkManager/system-connections/GodEmperorDrothan.nmconnection to the following (which is the same as mine except that I have changed the id, uuid, permissions, ssid, etc. to yours):

```
[connection]

id=GodEmperorDrothan

uuid=dc8603d7-2ace-4b82-a96a-a1282853ab50

type=wifi

autoconnect=false

permissions=user:djhyland:;

secondaries=

[wifi]

mac-address=18:56:80:70:95:BD

mac-address-blacklist=

mac-address-randomization=0

mode=infrastructure

seen-bssids=

ssid=GodEmperorDrothan

[wifi-security]

group=

key-mgmt=wpa-psk

pairwise=

proto=

psk-flags=1

[ipv4]

dns-search=

may-fail=false

method=auto

[ipv6]

addr-gen-mode=stable-privacy

dns-search=

method=ignore
```

Also, what USE flags are set in your installed NetworkManager? Here is what I have:

```
$ eix -I net-misc/networkmanager

[I] net-misc/networkmanager

     Available versions:  1.14.4 {audit bluetooth connection-sharing consolekit +dhclient dhcpcd elogind gnutls +introspection iwd json +modemmanager ncurses +nss ofono ovs policykit +ppp resolvconf selinux systemd teamd test vala +wext +wifi ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32" KERNEL="linux"}

     Installed versions:  1.14.4(00:00:36 19/12/18)(bluetooth dhclient elogind introspection modemmanager ncurses nss policykit ppp wext wifi -audit -connection-sharing -consolekit -dhcpcd -gnutls -iwd -json -ofono -ovs -resolvconf -selinux -systemd -teamd -test -vala ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" KERNEL="linux")

     Homepage:            https://wiki.gnome.org/Projects/NetworkManager

     Description:         A set of co-operative tools that make networking simple and straightforward

[I] net-misc/networkmanager-openvpn

     Available versions:  1.8.8 {gtk test}

     Installed versions:  1.8.8(00:08:32 19/12/18)(gtk -test)

     Homepage:            https://wiki.gnome.org/Projects/NetworkManager

     Description:         NetworkManager OpenVPN plugin

Found 2 matches
```

```
$ equery uses networkmanager

[ Legend : U - final flag setting for installation]

[        : I - package is installed with flag     ]

[ Colors : set, unset                             ]

 * Found these USE flags for net-misc/networkmanager-1.14.4:

 U I

 - - abi_x86_32         : 32-bit (x86) libraries

 - - audit              : Enable support for Linux audit subsystem using sys-process/audit

 + + bluetooth          : Enable Bluetooth Support

 - - connection-sharing : Use net-dns/dnsmasq and net-firewall/iptables for connection sharing

 - - consolekit         : Use sys-auth/consolekit for session tracking

 + + dhclient           : Use dhclient from net-misc/dhcp for getting ip

 - - dhcpcd             : Use net-misc/dhcpcd for getting ip

 + + elogind            : Use sys-auth/elogind for session tracking

 - - gnutls             : Prefer net-libs/gnutls as SSL/TLS provider (ineffective with USE=-ssl)

 + + introspection      : Add support for GObject based introspection

 - - json               : Enable JSON validation via dev-libs/jansson in libnm.

 + + modemmanager       : Enable support for mobile broadband devices using net-misc/modemmanager

 + + ncurses            : Add ncurses support (console display library)

 + + nss                : Use dev-libs/nss for cryptography

 - - ofono              : Use net-misc/ofono for telephony support.

 - - ovs                : Enable OpenVSwitch support

 + + ppp                : Enable support for mobile broadband and PPPoE connections using net-dialup/ppp

 - - resolvconf         : Use net-dns/openresolv for managing DNS information in /etc/resolv.conf.

                          Generally, a symlink to /run/NetworkManager/resolv.conf is simpler. On systems

                          running systemd-resolved, disable this flag and create a symlink to

                          /run/systemd/resolve/stub-resolv.conf.

 - - systemd            : Enable use of systemd-specific libraries and features like socket activation or

                          session tracking

 - - teamd              : Enable Teamd control support

 - - test               : Enable dependencies and/or preparations necessary to run tests (usually

                          controlled by FEATURES=test but can be toggled independently)

 - - vala               : Enable bindings for dev-lang/vala

 + + wext               : Enable support for the deprecated Wext (Wireless Extensions) API; needed for some

                          older drivers (e.g. ipw2200, ndiswrapper)

 + + wifi               : Enable support for wifi and 802.1x security
```

You are using ConsoleKit instead of elogind, whereas I am using elogind instead of ConsoleKit, so you would have USE="-elogind". But what other differences, if any, in set USE flags does your installed NetworkManager have from mine?

----------

## niku

 *djhyland wrote:*   

> 
> 
> EDIT: jeez, still no luck even with an unsecured connection.

 

If you can't connect even to an unsecured network, it is clearly a problem with network manager alone. (wpa_supplicant is innocent.)

The curious thing is, why is there a problem with only this router? (You can connect to other networks.) Try disabling mac spoofing, for one!

Edit: check if your router generates logs.

 *NeddySeagoon wrote:*   

> 
> 
> Your IPv6 addresses are global. That means your system is directly connected to the internet unless you have an IPv6 firewall configured somewhere.

 

The fe80 address is local. That is where the router is, and that is the default route. There is another address (starting with 2601). I don't know what that is for.

 *djhyland wrote:*   

> wlan0: soliciting an IPv6 router
> 
> wlan0: rebinding lease of 10.0.0.208
> 
> wlan0: Router Advertisement from fe80::2043:69ff:fe7b:587
> ...

 

Edit: You are probably right. The 2601:446:580:3e4a::/64 are the addresses to all the machines on the subnet (all the ones being managed by the router.) The two 2601::/128 addresses must be the global addresses of the router and the computer. (link)

----------

