TUI for Managing WiFi on Linux
github.com
github.com
I’ve been getting into Arch (with Sway) recently and resisted installing something like this initially since as they say, the manual install process is the tutorial.
Getting basic WiFi connected with DHCP on vanilla Arch requires enabling multiple services and conf file edits - you rage against the machine thinking why is it so hard but then realise you just learnt how to swap out any part of your network stack (or the other fun footgun of installing multiple conflicting network managers to intermittently and silently break your connection). Anyway, rant over, not going back to Ubuntu anytime soon.
I recently finally switched to NetworkManager after using Arch's netctl for years (since so long ago I don't remember why I picked it in the first place). It's been a nice experience so far and I don't have any reason to reach for something more minimal again for network management. That's the beauty of Arch—you will indeed learn a lot by default but all the options are there and well documented in the wiki of course.
Anyway, have fun, and remember, it's not a partial upgrade if you didn't sync your package lists (that one took me too long to figure out). Breaking stuff is part of the fun and learning for sure, but to be honest maintaining Arch becomes rather routine after the initial learning curve. In a way even less so than non rolling distros since there's never a jarring version bump with some big changes. My current install has been chugging along for over seven years across two different laptops.
The amount of care the openbsd team puts into keeping it's system simple is very under rated. If unfamiliar, all you usually need for openbsd wifi is.
ifconfig iwn0 join "essid" wpakey "itsasecret"
jam 'join "essid" wpakey "itsasecret"' into your /etc/hostname.iwn0 and you are good to go.
iwctl station wlan0 connect "essid" --passphrase "itsasecret"
The permanent config would be stuffed into /var/lib/iwd/essid.conf (different file per SSID)The harder part for me is remembering it's "iwctl station wlan0 scan && iwctl station wlan0 get-networks" to see what's out there for a new connection. Of course I always cheat and make a wifi-scan wrapper script so maybe that's why I never remember...
It's not trivial, but it's not difficult either. I have been using iwd. It involves installing one package, editing one file, and enabling two services. There are no dependencies beyond the base package, partially because a DHCP client is built into iwd. It may be possible to get away with enabling only one service, but I haven't figured out how to get the glibc resolver working. Incidentally, this TUI appears to be a replacement connection manager for iwd's `iwctl` command.
Of course, installing a desktop environment may result in NetworkManager being installed and NetworkManager will install it's preferred network stack. That said: I don't recall Arch enabling NetworkManager by default, though it is definitely something people would enable when installing a desktop environment (leading to the dueling network managers situation).
(A similar lesson learned: systemd-boot is much easier to setup than traditional boot managers and it is installed on Arch by default. Like iwd, it is meant for common straight forward setups.)
> Of course, installing a desktop environment may result in NetworkManager being installed and NetworkManager will install it's preferred network stack. That said: I don't recall Arch enabling NetworkManager by default, though it is definitely something people would enable when installing a desktop environment (leading to the dueling network managers situation).
It definitely doesn't enable it by default; I'm not really even sure what "default" would mean in this context because Arch doesn't really have an "installer" in the traditional sense. An Arch installation typically will comprise of partioning/formatting the hard drive, mounting the partitions, running `pacstrap` to install things directly to the mounted root rather than to the currently running system, and then chrooting in to manually configure anything else that's needed. I guess some people might consider what you get from the `base` set of packages to be "default", but IIRC that alone wouldn't come with _anything_ to configure wifi, let alone NetworkManager.
Agreed. On the other hand, what you decide to spend your time tuning will bias what you think of as simple or complex. I tend to lean towards the "fewest moving parts" along with "tried and true" solutions, so partitioning is straightforward. It sounds like you have other needs, so partitioning is more complex.
> It definitely doesn't enable it by default; I'm not really even sure what "default" would mean in this context because Arch doesn't really have an "installer" in the traditional sense.
By default I mean any actions taken by hooks/scripts during package installation, or the configuration files installed with the package. Arch may take a light touch, but some decisions are made either by the package maintainers or the original software developers.
I achieved the first one (and at some point the last one) without achieving the middle one, I think...
Fast-forward few years: I learned that no matter the Linux distro, true and tried is NetworkManager. It has various flaws, which is why there are plenty of complementary / alternative management solutions, but they usually come with more flaws than what they purport to replace / complement.
Also, it's worth learning several commands from nmcli family. Especially, when it comes to wifi:
nmcli d wifi list
nmcli d wifi connect $SSID password $PASSWORD
This will cover most of what you need when connecting to WiFi with your laptop wherever you need most of the time.My morning brain read that like "new torque sea tee ell" and didn't realize there was a typo. It was incredibly confused for several long seconds thinking that one through. Finally after being unable to understand it, I noticed it was a typo.
As a systems guy, on Debian, the workflow that works for me is to have wired interfaces defined as 'manual' in /etc/network/interfaces, so NetworkManager skips them, and I can configure them using the typical linux tooling and leave wifi managed by NetworkManager, so it can easily manage the dance between WPA/DHCP/AP association.
You're right, learning a bunch of bespoke commands you have to run on every new install is super based.
This wraps iwd tools I think. Even though, to be fair to the spirit of your comment, I don't see anything in the readme offering significant more functionality than iwctl
FWIW there's also wpa_cli which tends to work almost always (since everything wraps wpa_supplicant in the end), but it's a CLI rather than a TUI, and not a particularly usable one.
> everything wraps wpa_supplicant in the end
What should I be reading to understand exactly how the pieces fit together?I'm on Kubuntu, and have been suffering wifi disconnects for years across multiple computers with multiple USB wifi dongles and multiple access points. Literally not a bit of hardware shared, not even the access points. I suspect that Kubuntu shuts down USB wifi dongles after a period of time, as the only reliable way to get back online is to simply disconnect then reconnect the USB dongle. I forget what dmesg says (on mobile now) but it's something to the effect of a voluntary disconnect.
The AP runs OpenWrt. We worked around it by changing the reauthentication interval to 8 hours. Those working longer have to deal with it... Yeah, it's probably a weaker security now...
This is more likely to be a driver issue than management issue.
I think, this was posted to HN before, but I cannot find the article right now, but the gist of it is: both WiFi h/w vendors and Linux driver authors are to blame for the dismal state of events. On the h/w vendor side everything as per usual: no drivers, or broken drivers, incorrect product labeling or self-identification, false or imprecise advertisement of available features. On Linux side: slow inclusion of community-provided drivers for various WiFi modems, no real effort at cataloging and unification / systematization of available drivers.
My experience so far is this: Intel h/w is the one that has best Linux support. So, if you are on Realtec or Mediatec, you are getting the short end of the stick.
Another universal problem: WiFi protocol keeps iterating at a relatively high speed. Which means that you are often in a situation where either your modem or your router don't speak the same protocol at a good level, and the middle-ground that they find is not well-supported or, sometimes will only be found after lengthy unsuccessful attempts by both sides to do the handshake. This is often also exacerbated by the management software which may misidentify these "handshake problems" and "solve" them by restarting something in the network stack, essentially sending you into an infinite loop of trying to connect.
In my unfortunate case with my latest PC build, I had to swap three WiFi modems before I found one that worked satisfactory with the router I have. So, if you have some extra $ to throw at your problem: maybe try getting another WiFi modem?
W Linux Solving problems
NM has support for iwd.
Architecture diagram on home page: https://iwd.wiki.kernel.org/
It looks like you're right [0], so I stand corrected.
It also looks like it can't fully replace wpa_supplicant though:
> IWD and the NM backend are work in progress and the capabilities are still limited.
Distros like Ubuntu have defaulted to iwd as the NM backend for Wi-Fi for a couple years (and now in the LTS version). It really is a quite popular and stable replacement to wpa_supplicant.
NetworkManager and ConnMan can optionally _USE_ iwd as a backend _INSTEAD OF_ wpa_supplicant.
iwd does _NOT_ use NetworkManager/ConnMan
Source: gentoo user who explicitly avoids the buggy disaster that is NetworkManager+wpa_supplicant whenever possible
Or maybe that's a diagram technique I'm just not used to.
Even if that were true (and ignoring the fact that they aren't alternatives to each other, like other comments point out)
If you're on a distro with iwd you might still want a TUI without having NetworkManager installed. A tool doesn't need to be universally needed to be useful
Iwd is a separate program and actually works.
Try it out. It doesn't suck
It doesn't matter what the default is, though. Some people don't use NM, and this tool is for them.
> (since everything wraps wpa_supplicant in the end)
That's not true. IWD doesn't require wpa_supplicant.
TIL it is a wpa_supplicant replacement. Sorry for the misinformed comment!
https://www.computernetworkingnotes.com/linux-tutorials/the-...
EDIT: OK, it doesn't need network-manager. But I suspect about 99% of Linux installations do have that installed already, and if you need to get online, it's more useful to know the existing tool than a clever alternative you don't have installed.
This is an alternative that gives it TUI vs just the interactive console. Not something I use enough to care what it looks, personally.