Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NetworkManager immediately disconnects after connecting
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54212
Location: 56N 3W

PostPosted: Thu Jan 03, 2019 3:38 pm    Post subject: Reply with quote

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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
djhyland
n00b
n00b


Joined: 26 Nov 2008
Posts: 67
Location: St. Paul MN

PostPosted: Fri Jan 04, 2019 2:29 am    Post subject: Reply with quote

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.

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


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.
Code:
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.
Back to top
View user's profile Send private message
niku
n00b
n00b


Joined: 23 Dec 2018
Posts: 38

PostPosted: Fri Jan 04, 2019 8:18 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
djhyland
n00b
n00b


Joined: 26 Nov 2008
Posts: 67
Location: St. Paul MN

PostPosted: Fri Jan 04, 2019 7:43 pm    Post subject: Reply with quote

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:

Code:
/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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54212
Location: 56N 3W

PostPosted: Fri Jan 04, 2019 8:23 pm    Post subject: Reply with quote

djhyland,

Your
Code:
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
Code:
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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
djhyland
n00b
n00b


Joined: 26 Nov 2008
Posts: 67
Location: St. Paul MN

PostPosted: Sat Jan 05, 2019 2:03 am    Post subject: Reply with quote

NeddySeagoon wrote:
What does
Code:
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.


Code:
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
Back to top
View user's profile Send private message
niku
n00b
n00b


Joined: 23 Dec 2018
Posts: 38

PostPosted: Sat Jan 05, 2019 11:58 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54212
Location: 56N 3W

PostPosted: Sat Jan 05, 2019 2:23 pm    Post subject: Reply with quote

djhyland,

Code:
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.
Code:
wlan0: using IPvLL address 169.254.41.136


I bet it works with IPv6, when you boot with NetworkManager in the default runlevel.
Try
Code:
ping6 google.com
ping6 2a00:1450:4009:814::200e


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

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Sun Jan 06, 2019 1:10 am    Post subject: Reply with quote

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):

Code:
[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:

Code:
$ 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


Code:
$ 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?
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
niku
n00b
n00b


Joined: 23 Dec 2018
Posts: 38

PostPosted: Sun Jan 06, 2019 2:28 am    Post subject: Reply with quote

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
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


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)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum