You are not logged in.

#1 2024-02-06 03:14:10

z9s8efkjnsf
Member
Registered: 2024-02-06
Posts: 13

[SOLVED] iwd works but NetworkManager doesn't

Semi-n00b here with almost 20 years of Linux experience but only a couple weeks of Arch. I successfully installed Arch on my desktop computer, which connects to a router via a USB wifi dongle, using iwd to get networking started easily per the instructions. That's been working reliably but I would like to switch to NetworkManager for compatibility with various other software, and NetworkManager isn't working on the same system.

Basic diagnostic:

# iwctl
NetworkConfigurationEnabled: disabled
StateDirectory: /var/lib/iwd
Version: 2.13
[iwd]# device list
                                    Devices                                   *
--------------------------------------------------------------------------------
  Name                  Address               Powered     Adapter     Mode      
--------------------------------------------------------------------------------
  wlan0                 [redacted]            on          phy10       station   

[iwd]# station wlan0 show
                                 Station: wlan0                               *
--------------------------------------------------------------------------------
  Settable  Property              Value                                          
--------------------------------------------------------------------------------
            Scanning              no                                               
            State                 connected                                        
            Connected network     [redacted]                                              
            IPv4 address          [redacted]                                   
            ConnectedBss          [redacted]                                
            Frequency             5200                                             
            Security              WPA2-Personal                                    
            RSSI                  -48 dBm                                          
            AverageRSSI           -48 dBm                                          
            RxMode                802.11ac                                         
            RxMCS                 7                                                
            TxMode                802.11ac                                         
            TxMCS                 7                                                
            TxBitrate             292500 Kbit/s                                    
            RxBitrate             292500 Kbit/s      

Trying to disable iwd and enable NetworkManager:

# systemctl stop iwd
# systemctl start NetworkManager
# nmcli device wifi list
[redacted, but shows a list of nearby access points as expected]

Trying to connect to the access point (yes I am very sure the name and password are correct):

# nmcli device wifi connect [redacted] password [redacted]
Error: Connection activation failed: The Wi-Fi network could not be found.

Logs:

# dmesg
[truncated to new lines after attempting to connect]
[87408.178122] wlan0: authenticate with [redacted] (local address=[redacted])
[87408.222085] wlan0: send auth to [redacted] (try 1/3)
[87408.225083] wlan0: authenticated

Confirming we are offline:

# ping 1.1
ping: connect: Network is unreachable
# nmcli device show wlan0
GENERAL.DEVICE:                         wlan0
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         [redacted]
GENERAL.MTU:                            1500
GENERAL.STATE:                          30 (disconnected)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
IP4.GATEWAY:                            --
IP6.GATEWAY:                            --

The wiki says it's important to avoid running conflicting services so here's the loadout after that:

# systemctl --type=service
  UNIT                                                   LOAD   ACTIVE SUB     DESCRIPTION                                                >
  accounts-daemon.service                                loaded active running Accounts Service
  bluetooth.service                                      loaded active running Bluetooth service
  colord.service                                         loaded active running Manage, Install and Generate Color Profiles
  dbus-broker.service                                    loaded active running D-Bus System Message Bus
  dhcpcd.service                                         loaded active running DHCP/ IPv4LL/ IPv6RA/ DHCPv6 client on all interfaces
  gdm.service                                            loaded active running GNOME Display Manager
  geoclue.service                                        loaded active running Location Lookup Service
  kmod-static-nodes.service                              loaded active exited  Create List of Static Device Nodes
  ldconfig.service                                       loaded active exited  Rebuild Dynamic Linker Cache
  lvm2-monitor.service                                   loaded active exited  Monitoring of LVM2 mirrors, snapshots etc. using dmeventd o>
  NetworkManager.service                                 loaded active running Network Manager
  polkit.service                                         loaded active running Authorization Manager
  rtkit-daemon.service                                   loaded active running RealtimeKit Scheduling Policy Service
  systemd-binfmt.service                                 loaded active exited  Set Up Additional Binary Formats
  systemd-fsck@dev-disk-by\x2ddiskseq-1\x2dpart4.service loaded active exited  File System Check on /dev/disk/by-diskseq/1-part4
  systemd-journal-catalog-update.service                 loaded active exited  Rebuild Journal Catalog
  systemd-journal-flush.service                          loaded active exited  Flush Journal to Persistent Storage
  systemd-journald.service                               loaded active running Journal Service
  systemd-logind.service                                 loaded active running User Login Management
  systemd-modules-load.service                           loaded active exited  Load Kernel Modules
  systemd-random-seed.service                            loaded active exited  Load/Save OS Random Seed
  systemd-remount-fs.service                             loaded active exited  Remount Root and Kernel File Systems
  systemd-resolved.service                               loaded active running Network Name Resolution
  systemd-sysctl.service                                 loaded active exited  Apply Kernel Variables
  systemd-sysusers.service                               loaded active exited  Create System Users
  systemd-tmpfiles-setup-dev-early.service               loaded active exited  Create Static Device Nodes in /dev gracefully
  systemd-tmpfiles-setup-dev.service                     loaded active exited  Create Static Device Nodes in /dev
  systemd-tmpfiles-setup.service                         loaded active exited  Create Volatile Files and Directories
  systemd-udev-trigger.service                           loaded active exited  Coldplug All udev Devices
  systemd-udevd.service                                  loaded active running Rule-based Manager for Device Events and Files
  systemd-update-done.service                            loaded active exited  Update is Completed
  systemd-update-utmp.service                            loaded active exited  Record System Boot/Shutdown in UTMP
  systemd-user-sessions.service                          loaded active exited  Permit User Sessions
  systemd-vconsole-setup.service                         loaded active exited  Virtual Console Setup
  udisks2.service                                        loaded active running Disk Manager
  upower.service                                         loaded active running Daemon for power management
  user-runtime-dir@1000.service                          loaded active exited  User Runtime Directory /run/user/1000
  user@1000.service                                      loaded active running User Manager for UID 1000
  wpa_supplicant.service                                 loaded active running WPA supplicant

What am I doing wrong? There's a good chance I missed something simple in the installation. If it's truly necessary to remove wifi from the equation for troubleshooting, I can physically move my desktop into the same room as the router and plug it in with an ethernet cable, but that's a lot of work so I'd rather not do it without a good hunch.

Last edited by z9s8efkjnsf (2024-02-08 00:43:53)

Offline

#2 2024-02-06 03:36:17

dakota
Member
Registered: 2016-05-20
Posts: 417

Re: [SOLVED] iwd works but NetworkManager doesn't

I think dhcpcd and networkmanager are conflicting services. Try stopping dhcpcd and trying again.

Cheers,


"Before Enlightenment chop wood, carry water. After Enlightenment chop wood, carry water." -- Zen proverb

Offline

#3 2024-02-06 04:23:57

z9s8efkjnsf
Member
Registered: 2024-02-06
Posts: 13

Re: [SOLVED] iwd works but NetworkManager doesn't

Thanks for the quick reply. On closer inspection the wiki does seem to say they conflict. But that didn't solve the problem:

# systemctl stop iwd
# systemctl stop dhcpcd
# systemctl start NetworkManager
# nmcli device wifi connect [redacted] password [redacted]
Error: Connection activation failed: The Wi-Fi network could not be found.

Offline

#4 2024-02-06 06:52:26

dogknowsnx
Guest

Re: [SOLVED] iwd works but NetworkManager doesn't

You also have to "tell" NM to use 'iwd' as backend:
https://wiki.archlinux.org/title/Networ … Fi_backend

(Stop and) disable 'iwd' (NM will start it) and 'dhcpcd' (properly enable NM as well), then reboot to make sure only those services you need/want are running ...

Last edited by dogknowsnx (2024-02-06 07:11:33)

#5 2024-02-06 09:11:21

z9s8efkjnsf
Member
Registered: 2024-02-06
Posts: 13

Re: [SOLVED] iwd works but NetworkManager doesn't

OK, I tried that and it was successful - I'm able to use NetworkManager with iwd as the backend. In fact it simply remembered the connection I already had before so I didn't need to re-select the access point or re-enter credentials; it just started working.

However, my original post wasn't clear: I meant that I want to switch to NetworkManager + wpa_supplicant, which I understand to be better supported, and stop using iwd altogether. If I do the same thing but without telling NetworkManager to use iwd, then that's how I get the original problem. So it seems the problem is specifically wpa_supplicant, and NetworkManager can work otherwise. Any other ideas to troubleshoot that problem now that it's narrowed down? Or what would be the actual disadvantages of just staying with NetworkManager + iwd as a workaround?

Also, I don't know what this means but I find that the wpa_supplicant service is still running even when I freshly boot the system with the original iwd-only configuration and the wpa_supplicant service disabled by systemctl.

Last edited by z9s8efkjnsf (2024-02-06 09:14:59)

Offline

#6 2024-02-06 09:51:38

dogknowsnx
Guest

Re: [SOLVED] iwd works but NetworkManager doesn't

Yeah sorry, that wasn't clear to me.

z9s8efkjnsf wrote:

wpa_supplicant, which I understand to be better supported

Idk if that's true - how did you come to that conclusion?
EDIT#2: As backend for NM that may very well be true: https://gitlab.freedesktop.org/NetworkM … ssues/1456

z9s8efkjnsf wrote:

Or what would be the actual disadvantages of just staying with NetworkManager + iwd as a workaround?

I can only speak from my own experience, and having used 'iwd' both with and w/o NM, I never had any problems (and personally I don't regard using 'iwd' (as backend) as a workaround...) <- you mean workaround for 'wpa_supplicant'-issue, got it.

EDIT: If in doubt: https://wiki.archlinux.org/title/Iwd

Last edited by dogknowsnx (2024-02-06 11:28:46)

#7 2024-02-06 10:04:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,034

Re: [SOLVED] iwd works but NetworkManager doesn't

The wiki wrote:

Consider existing issues before switching to iwd.

To enable the experimental iwd backend…

@z9s8efkjnsf, it's still perfectly ok to run NM w/ IWD as backend.
If you want to know why wpa_supplicant fails, have you tried to connect w/ wpa_supplicant manually and https://wiki.archlinux.org/title/Wpa_su … n_failures ?

Since you've dhcpcd running, let's have a brief sanity check:
Please post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Offline

#8 2024-02-06 10:16:08

dogknowsnx
Guest

Re: [SOLVED] iwd works but NetworkManager doesn't

seth wrote:
The wiki wrote:

Consider existing issues before switching to iwd.

Which links to https://gitlab.freedesktop.org/NetworkM … search=iwd ...

Last edited by dogknowsnx (2024-02-06 10:54:35)

#9 2024-02-06 16:38:25

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: [SOLVED] iwd works but NetworkManager doesn't

You can see if this package works for you: https://aur.archlinux.org/packages/networkmanager-iwd

Offline

#10 2024-02-06 16:42:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: [SOLVED] iwd works but NetworkManager doesn't

Eh, that package isn't all that useful. The normal package supports iwd just fine.

Offline

#11 2024-02-07 04:11:39

z9s8efkjnsf
Member
Registered: 2024-02-06
Posts: 13

Re: [SOLVED] iwd works but NetworkManager doesn't

Thanks all for the helpful replies. It sounds like NetworkManager + iwd is a perfectly good setup, so actually this is already solved.

But since people have helpfully posted more instructions to troubleshoot wpa_supplicant, I followed up on those in case the thread might become useful to someone else.

seth wrote:

If you want to know why wpa_supplicant fails, have you tried to connect w/ wpa_supplicant manually and https://wiki.archlinux.org/title/Wpa_su … n_failures ?

I think this is the section where wpa_supplicant attempts to connect, but I don't see anything that looks like an error message except "Getting wowlan status failed" and perhaps "reason=3":

wlan0: SME: Trying to authenticate with [redacted] (SSID='[redacted]' freq=5745 MHz)
EAPOL: External notification - portValid=0
wlan0: State: SCANNING -> AUTHENTICATING
Not configuring frame filtering - BSS 00:00:00:00:00:00 is not a Hotspot 2.0 network
wlan0: Determining shared radio frequencies (max len 1)
wlan0: Shared frequencies (len=0): completed iteration
nl80211: Authenticate (ifindex=7)
  * bssid=[redacted]
  * freq=5745
  * SSID=[redacted]
  * IEs - hexdump(len=0): [NULL]
  * Auth Type 0
nl80211: Authentication request send successfully
RTM_NEWLINK: ifi_index=7 ifname=wlan0 wext ifi_family=0 ifi_flags=0x1003 ([UP])
wlan0: Removing interface wlan0
nl80211: Getting wowlan status
nl80211: Getting wowlan status failed
wlan0: Request to deauthenticate - bssid=00:00:00:00:00:00 pending_bssid=[redacted] reason=3 (DEAUTH_LEAVING) state=AUTHENTICATING
TDLS: Tear down peers
wpa_driver_nl80211_deauthenticate(addr=[redacted] reason_code=3)
wlan0: Event DEAUTH (11) received
wlan0: Deauthentication notification
wlan0:  * reason 3 (DEAUTH_LEAVING) locally_generated=1
Deauthentication frame IE(s) - hexdump(len=0): [NULL]
wlan0: CTRL-EVENT-DISCONNECTED bssid=[redacted] reason=3 locally_generated=1
wlan0: Auto connect disabled: do not try to re-connect
wlan0: Radio work 'sme-connect'@[redacted] done in 12.842232 seconds
wlan0: radio_work_free('sme-connect'@[redacted]): num_active_works --> 0
wlan0: Ignore connection failure indication since interface has been put into disconnected state
TDLS: Remove peers on disassociation
wlan0: WPA: Clear old PMK and PTK
wlan0: Disconnect event - remove keys
nl80211: Data frame filter flags=0x0
wlan0: State: AUTHENTICATING -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=7 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
EAPOL: External notification - EAP success=0
wlan0: SME: Allow pending authentication to proceed after disconnection event
wlan0: State: DISCONNECTED -> AUTHENTICATING
nl80211: Data frame filter flags=0x0
wlan0: State: AUTHENTICATING -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
seth wrote:

Since you've dhcpcd running, let's have a brief sanity check:
Please post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

In my previous setup of iwd + dhcpcd but not NetworkManager:

bluetooth.service                        | bluetooth.target.wants
dbus-org.bluez.service                   | system
dbus-org.freedesktop.resolve1.service    | system
dhcpcd.service                           | multi-user.target.wants
display-manager.service                  | system
gcr-ssh-agent.socket                     | sockets.target.wants
getty@tty1.service                       | getty.target.wants
gnome-keyring-daemon.socket              | sockets.target.wants
iwd.service                              | multi-user.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire-pulse.socket                    | sockets.target.wants
pipewire-session-manager.service         | user
pipewire.socket                          | sockets.target.wants
remote-fs.target                         | multi-user.target.wants
systemd-resolved.service                 | sysinit.target.wants
wireplumber.service                      | pipewire.service.wants
xdg-user-dirs-update.service             | default.target.wants

In my new setup with NetworkManager (same output regardless which backend I use):

bluetooth.service                        | bluetooth.target.wants
dbus-org.bluez.service                   | system
dbus-org.freedesktop.nm-dispatcher.service | system
dbus-org.freedesktop.resolve1.service    | system
display-manager.service                  | system
gcr-ssh-agent.socket                     | sockets.target.wants
getty@tty1.service                       | getty.target.wants
gnome-keyring-daemon.socket              | sockets.target.wants
NetworkManager.service                   | multi-user.target.wants
NetworkManager-wait-online.service       | network-online.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire-pulse.socket                    | sockets.target.wants
pipewire-session-manager.service         | user
pipewire.socket                          | sockets.target.wants
remote-fs.target                         | multi-user.target.wants
systemd-resolved.service                 | sysinit.target.wants
wireplumber.service                      | pipewire.service.wants
xdg-user-dirs-update.service             | default.target.wants

Any clues in there?

Offline

#12 2024-02-07 07:08:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,034

Re: [SOLVED] iwd works but NetworkManager doesn't

Any clues in there?

No, a collision would have existed if on the transition you didn't stop dhcpcd and iwd before starting NM, but the new setup is "clean" (after a reboot at least)

wlan0: Request to deauthenticate - bssid=00:00:00:00:00:00 pending_bssid=[redacted] reason=3 (DEAUTH_LEAVING) state=AUTHENTICATING

however means exactly that: the local host ("you") triggered a disconnect, did you stop NM and iwd before testing the manula wpa_uspplicant connection?

Offline

#13 2024-02-07 07:12:09

dogknowsnx
Guest

Re: [SOLVED] iwd works but NetworkManager doesn't

z9s8efkjnsf wrote:

OK, I tried that and it was successful - I'm able to use NetworkManager with iwd as the backend. In fact it simply remembered the connection I already had before so I didn't need to re-select the access point or re-enter credentials; it just started working.

That's because the file (.psk, if network is e.g.WPA2-PSK secured) where credentials are stored has already been in place (for more details see the link in my second post to the 'iwd' wiki entry, and please make sure to have read especially the first note on that page...)

#14 2024-02-08 00:43:38

z9s8efkjnsf
Member
Registered: 2024-02-06
Posts: 13

Re: [SOLVED] iwd works but NetworkManager doesn't

seth wrote:

did you stop NM and iwd before testing the manula wpa_uspplicant connection?

Sorry, I misunderstood and tried to run wpa_supplicant manually while NetworkManager was still active. If I stop every service discussed in this thread and then run wpa_supplicant manually, it actually works. If I also start dhcpcd, I receive an IP address (same one as usual) and can connect to the internet. So maybe the problem is something subtler in the combination of wpa_supplicant and NetworkManager.

But NetworkManager + iwd has been working fine and I'm afraid I've run out of time to solve this mystery. Thanks everyone for the timely and specific help!

Offline

Board footer

Powered by FluxBB