Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

[SOLVED] laptop does not rejoin wifi

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
12 posts • Page 1 of 1
Author
Message
o5gmmob8
l33t
l33t
Posts: 737
Joined: Fri Oct 17, 2003 9:17 pm

[SOLVED] laptop does not rejoin wifi

  • Quote

Post by o5gmmob8 » Wed Apr 02, 2025 1:45 pm

I turn off my WIFI nightly when I'm asleep for the perception of reducing the attack surface (separate topic).

My phones and tablets all reconnect fine, but my Gentoo laptop does not unless I restart the networking service. It seems like the wifi service is a single shot service meaning whatever it sees at the time it starts is what it uses and does not appear to attempt connecting after that.

I have symlinked my wifi interface to net.lo and configured my wifi to use wpa_supplicant and DHCP. I have briefly tried to migrate toward iwd, but didn't have much luck.

I would prefer not to write a script(s) to monitor the network status and restart wifi if it does not have an IP. Is there another utility that I can use that would support this functionality? Or perhaps, I'm missing a configuration?

EDIT:
I use ifplugd for the ethernet and see that I should be able to use that for wifi too:
https://wiki.gentoo.org/wiki/Handbook:A ... ng/Dynamic
Last edited by o5gmmob8 on Sun Apr 06, 2025 12:14 pm, edited 1 time in total.
Top
grknight
Retired Dev
Retired Dev
Posts: 2568
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Wed Apr 02, 2025 2:28 pm

o5gmmob8 wrote:I use ifplugd for the ethernet and see that I should be able to use that for wifi too:
https://wiki.gentoo.org/wiki/Handbook:A ... ng/Dynamic
Note that ifplugd uses the ancient, deprecated WEXT method for wifi support. This may not be a reliable source of info and could get dropped from the kernel at any point.
(ifplugd itself is ancient and hasn't been updated in 20 years)

Edit: Notably WiFi-7 devices, 802.11be the successor to 802.11ax, will never work with wireless extensions at all even in a compatibility mode.
Last edited by grknight on Wed Apr 02, 2025 2:51 pm, edited 1 time in total.
Top
o5gmmob8
l33t
l33t
Posts: 737
Joined: Fri Oct 17, 2003 9:17 pm

  • Quote

Post by o5gmmob8 » Wed Apr 02, 2025 2:33 pm

Ah ok, should I use something else then for both wired and wireless?

I can write a shell script, but there must be something out there that I have not stumbled upon that also does the same thing, but better.
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Wed Apr 02, 2025 3:38 pm

There is sys-apps/netplug, which is considerably more recent at only 15 years since its last update (2010-06-26). ;) I cannot comment on whether it can handle your wireless as desired.
Top
miket
Guru
Guru
Posts: 513
Joined: Sat Apr 28, 2007 2:45 am
Location: Gainesville, FL, USA

  • Quote

Post by miket » Wed Apr 02, 2025 5:58 pm

Try the easy things first. Is wpa_supplicant configured to scan for networks? Be sure this line is near the top of /etc/wpa_supplicant/wpa_supplicant.conf:

Code: Select all

ap_scan=1
I can tell you I don't get an automatic connection unless I specify that directive.
Top
o5gmmob8
l33t
l33t
Posts: 737
Joined: Fri Oct 17, 2003 9:17 pm

  • Quote

Post by o5gmmob8 » Thu Apr 03, 2025 12:11 am

Ah, good catch. I was looking at scan_ssid=1 for each network.

Which one is preferred?
Top
miket
Guru
Guru
Posts: 513
Joined: Sat Apr 28, 2007 2:45 am
Location: Gainesville, FL, USA

  • Quote

Post by miket » Thu Apr 03, 2025 5:16 am

It's taken a pretty good dive into the wpa_supplicant source code, but now I've got an answer.

Yes, you want ap_scan=1. This setting instructs wpa_supplicant to do the scanning; the other legal values, 0 and 2, leave the scanning to the driver. Many drivers (including evidently yours) do not have a scanning function. The scan_ssid setting applies only for drivers that can do the scanning.


There is no nice, cogent documention for these settings: they are described in block comments in the source files. Here is where to look:

* Global settings for the network interface (ap_scan, update_config, etc.): comments describing the members of struct wpa_config declared in wpa_supplicant/config.h. The names of the members of this structure are the same as the corresponding keyword in the configuration value. These comments often don't show the legal values; for this, consult the entries in the global_fields array in wpa_supplicant/config.c.

* Per-network settings (ssid, psk, etc): see the members of struct wpa_ssid declared in wpa_supplicant/config_ssid.h. Just as for the global settings, look to the entries of ssid_settings in wpa_supplicant/config.c to find the legal values for these entries.
Top
o5gmmob8
l33t
l33t
Posts: 737
Joined: Fri Oct 17, 2003 9:17 pm

  • Quote

Post by o5gmmob8 » Thu Apr 03, 2025 10:23 am

I switched from scan_ssid=1 to ap_scan=1 at the global level and that did not seem to work. This morning, my machine did have an ip address, so scan_ssid at the ssid level did appear to work.

EDIT:
I tried again back with my original configuration that appeared to have worked last night and it presently looks like it also did not work.

My router runs ifconfig wlan* down and then ifconfig wlan* up nightly. I did the same now manually, but for whatever reason, it seems the laptop doesn't want to get an IP now.
Top
miket
Guru
Guru
Posts: 513
Joined: Sat Apr 28, 2007 2:45 am
Location: Gainesville, FL, USA

  • Quote

Post by miket » Thu Apr 03, 2025 12:27 pm

o5gmmob8 wrote:I switched from scan_ssid=1 to ap_scan=1 at the global level and that did not seem to work. This morning, my machine did have an ip address, so scan_ssid at the ssid level did appear to work.
It seems to be a question of what hardware you have and what its driver will do. You've hit on what works for your setup.
Top
Ralphred
l33t
l33t
Posts: 822
Joined: Tue Dec 31, 2013 11:52 am

  • Quote

Post by Ralphred » Thu Apr 03, 2025 1:32 pm

o5gmmob8 wrote:I did the same now manually, but for whatever reason, it seems the laptop doesn't want to get an IP now.
Are you 100% this is a wireless connection issue and not your dhcp client messing up? Use wpa_cli status to check the status of the wifi side, look for wpa_state=COMPLETED. Once you are sure the wifi is "working" then move on to dhcpcd/dhclient.
Top
o5gmmob8
l33t
l33t
Posts: 737
Joined: Fri Oct 17, 2003 9:17 pm

  • Quote

Post by o5gmmob8 » Thu Apr 03, 2025 7:03 pm

Code: Select all

Failed to connect to non-global ctrl_ifname: (nil)  error: No such file or directory

Code: Select all

/etc/init.d/net.wlp3s0 status
* status: inactive

Code: Select all

dmesg -T
[Thu Apr  3 06:30:37 2025] wlp3s0: authenticate with e8:9f:80:aa:46:f0 (local address=)
[Thu Apr  3 06:30:37 2025] wlp3s0: send auth to  (try 1/3)
[Thu Apr  3 06:30:37 2025] wlp3s0: authenticated
[Thu Apr  3 06:30:37 2025] wlp3s0: associate with  (try 1/3)
[Thu Apr  3 06:30:37 2025] wlp3s0: RX AssocResp from (capab=0x11 status=0 aid=1)
[Thu Apr  3 06:30:37 2025] wlp3s0: associated
I tested this in the morning, but don't recall the precise timing. I will try again now.

EDIT:
It automatically connected to my upstairs wifi AP when I restarted the service. I ran wpa_cli disconnect to disconnect from it and it did, but should I expect it to automatically connect to the best AP at that point in time then?

EDIT:
I've used networkmanager in the past and believe that it will likely work in this case, but I feel it is a bit heavier and wanted a nuts and bolts type system. I'll give that a try and see what happens.
Top
o5gmmob8
l33t
l33t
Posts: 737
Joined: Fri Oct 17, 2003 9:17 pm

[solved]

  • Quote

Post by o5gmmob8 » Sun Apr 06, 2025 12:14 pm

I ended up migrating to iwd and as advertised, I think that works better in the sense, it is quicker to associate. I am using netifrc with iwd as the backend and it seems to work reliably, I don't need network manager which I think is overkill. I run a tiling WM, so I try to avoid fluff.

I tested turning my router wifi on and off and my laptop was able to quickly associate without any intervention on my behalf. Additionally, using dhcpcd allows me to easily hook into the events it triggers (as does network manager), so I can take action when the laptop joins a wifi network.
Top
Post Reply

12 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic