You are not logged in.

#1 2020-09-08 17:48:42

E3LDDfrK
Member
Registered: 2019-10-24
Posts: 73

iwd doesn't automatically reconnect after restarting the router

I needed to restart iwd.service to reconnect after I turned on the router again. 
With wpa_supplicant, it reconnects automatically. 

The wiki only mentions about disabling auto-connect: https://wiki.archlinux.org/index.php/Iw … ar_network

My configs:

$ cat /etc/systemd/network/25-wireless.network 
[Match]
Name=wl*

[Network]
DHCP=yes

[DHCP]
RouteMetric=20
$ cat /etc/systemd/resolved.conf
[Resolve]
DNS= 1.1.1.1#one.one.one.one
FallbackDNS=1.0.0.1 9.9.9.10 8.8.8.8 2606:4700:4700::1111 2620:fe::10 2001:4860:4860::8888
Domains=~.
DNSSEC=true
DNSOverTLS=yes
# cat /var/lib/iwd/SSID.psk
[Security]
PreSharedKey=*****
Passphrase=*****
$ cat /etc/wpa_supplicant/wpa_supplicant-wlp0s20f3.conf 
ctrl_interface=/var/run/wpa_supplicant
update_config=1

network={
	ssid="SSID"
	psk="passphrase"
	proto=RSN
	key_mgmt=WPA-PSK
	pairwise=CCMP
	auth_alg=OPEN
}

Any idea what's wrong?

Offline

#2 2020-09-08 19:34:06

Mortimer Houghton
Member
Registered: 2014-09-28
Posts: 89

Re: iwd doesn't automatically reconnect after restarting the router

You shouldn't be running wpa_supplicant and iwd at the same time, they do the same thing and the conflict will interfere with each other.

iwd can also handl dhcp.

Last edited by Mortimer Houghton (2020-09-08 19:34:54)

Offline

#3 2020-09-08 21:48:10

E3LDDfrK
Member
Registered: 2019-10-24
Posts: 73

Re: iwd doesn't automatically reconnect after restarting the router

I don't run both at the same time. And just extra info, I used iwctl when setting up iwd.

Offline

#4 2020-09-09 16:39:22

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: iwd doesn't automatically reconnect after restarting the router

You could try increasing RoamThreshold in /etc/iwd/main.conf (under the [General] section), see iwd.config(5) for the details.

How long have you waited for it to reconnect? Periodic scanning should be enabled by default but I'm not sure how regular the scans are.

EDIT: and check the journal during a restart of the router:

journalctl -f -u iwd

EDIT2: have you tried using iwd by itself (ie, without systemd-networkd)?

Last edited by Head_on_a_Stick (2020-09-09 16:46:07)


Jin, Jîyan, Azadî

Offline

#5 2020-09-09 18:37:43

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 636

Re: iwd doesn't automatically reconnect after restarting the router

Because I didn't know I fiddled around with this. I have two routers here with 2 different ssids.

What I have found is that it seems to be tied to iwd scanning for available networks to connect to and if they are a "known network".

If both of the networks are known and I reboot the one I am connected to I loose connectivity until iwd scans, and this is where it seems a little funny, scanning doesn't seem to be done on a regular basis.

So, both networks are known and I am connected to network 1.

reboot network1 and I loose connection. IWD, in some amount of time, will scan and then connect to network 2.

Network 1 comes back up so I reboot network 2 and loose connection. Now I'm waiting for iwd to show that its scanning in iwctl. and Im waiting. and I'm still waiting. So, if I am in iwctl and tell it to scan it will see network 1 is up and connect to it.

To sum up, what needs to happen is scanning is *not* disabled, the psk file for the network(s) need to exist in /var/lib/iwd and be correct. And auto connecting should *not* be disabled.

Auto scanning seems a little erratic so be prepared to use iwctl to start a scan if you are sure you're router is up but iwd is hesitating to connect.

In other words, physically restarting iwd through systemctl should not be required.

Offline

#6 2020-09-09 23:20:20

E3LDDfrK
Member
Registered: 2019-10-24
Posts: 73

Re: iwd doesn't automatically reconnect after restarting the router

Thanks for the responses, guys. I gonna try them. Kinda busy right now.

Offline

#7 2020-09-12 10:34:25

E3LDDfrK
Member
Registered: 2019-10-24
Posts: 73

Re: iwd doesn't automatically reconnect after restarting the router

@Head_on_a_Stick I'll try increasing RoamThreshold later. And I couldn't manage to connect to internet without both systemd-networkd and systemd-resolved. As I understand it, iwd has everything included. But I don't know enough to make it work. 

I have waited for ~10 mins, but it still won't connect to the wifi. My non-linux devices and wpa_supplicant on linux connect instantly as soon as the router is ready.

$ journalctl -f -u iwd
-- Logs begin at Fri 2020-01-17 17:35:42 CET. --
Sep 12 00:13:24 hostname iwd[393]: Wireless daemon version 1.9
Sep 12 00:13:24 hostname systemd[1]: Started Wireless service.
Sep 12 00:13:24 hostname iwd[393]: station: Network configuration is disabled.
Sep 12 00:13:24 hostname iwd[393]: Wiphy: 0, Name: phy0
Sep 12 00:13:24 hostname iwd[393]:         Permanent Address: 04:ed:33:dd:c3:a9
Sep 12 00:13:24 hostname iwd[393]:         Bands: 2.4 GHz 5 GHz
Sep 12 00:13:24 hostname iwd[393]:         Ciphers: CCMP TKIP BIP
Sep 12 00:13:24 hostname iwd[393]:         Supported iftypes: ad-hoc station ap p2p-client p2p-go p2p-device
Sep 12 03:00:02 hostname iwd[393]: Received Deauthentication event, reason: 3, from_ap: true
Sep 12 11:12:57 hostname iwd[393]: Received Deauthentication event, reason: 4, from_ap: false
Sep 12 12:25:56 hostname iwd[393]: Terminate
Sep 12 12:25:56 hostname iwd[393]: Removing scan context for wdev 2
Sep 12 12:25:56 hostname systemd[1]: Stopping Wireless service...
Sep 12 12:25:57 hostname iwd[393]: Removing scan context for wdev 3
Sep 12 12:25:57 hostname iwd[393]: D-Bus disconnected, quitting...
Sep 12 12:25:57 hostname systemd[1]: iwd.service: Succeeded.
Sep 12 12:25:57 hostname systemd[1]: Stopped Wireless service.
Sep 12 12:25:57 hostname systemd[1]: Starting Wireless service...
Sep 12 12:25:57 hostname iwd[72151]: Wireless daemon version 1.9
Sep 12 12:25:57 hostname systemd[1]: Started Wireless service.
Sep 12 12:25:57 hostname iwd[72151]: station: Network configuration is disabled.
Sep 12 12:25:57 hostname iwd[72151]: Wiphy: 0, Name: phy0
Sep 12 12:25:57 hostname iwd[72151]:         Permanent Address: 04:ed:33:dd:c3:a9
Sep 12 12:25:57 hostname iwd[72151]:         Bands: 2.4 GHz 5 GHz
Sep 12 12:25:57 hostname iwd[72151]:         Ciphers: CCMP TKIP BIP
Sep 12 12:25:57 hostname iwd[72151]:         Supported iftypes: ad-hoc station ap p2p-client p2p-go p2p-device

@Zod I don't understand 100%. But I think you meant there is no need to restart the service. And I can use iwctl to rescan and reconnect to wifi.

Last edited by E3LDDfrK (2020-09-12 10:35:40)

Offline

#8 2020-09-12 10:36:46

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: iwd doesn't automatically reconnect after restarting the router

E3LDDfrK wrote:

I couldn't manage to connect to internet without both systemd-networkd and systemd-resolved. As I understand it, iwd has everything included. But I don't know enough to make it work

https://wiki.archlinux.org/index.php/Iw … figuration


Jin, Jîyan, Azadî

Offline

#9 2020-09-12 10:44:58

E3LDDfrK
Member
Registered: 2019-10-24
Posts: 73

Re: iwd doesn't automatically reconnect after restarting the router

I personally couldn't connect to internet with just iwd after following those steps. But again, don't know much about this stuff. Perhaps missing something obvious.

Offline

#10 2020-09-12 10:57:31

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: iwd doesn't automatically reconnect after restarting the router

E3LDDfrK wrote:

Perhaps missing something obvious.

You should post the actual configuration files rather than a vague description so that we can spot any mistakes. And did you remember to stop & disable systemd-networkd?


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB