Troubleshooting wireless connections in Archlinux, sort of …

… a journey through wireless connectivity hell in Archlinux

I do not like to think too much about how I get connected to wifi using Archlinux but when things do not work as they should, it could turn into a nightmare. The nightmare is partly because I do not know things I should or that I am plain stupid. Just in case helps, yesterday I ran into a situation where the Archlinux OS on my lenovo thinkpad X220i stopped working. I got it working this morning but I still do not know what exactly happened to make it work but perhaps the sequence is worth writing it out here.

I went through several sites in search of solutions and the reliable bbs.archlinux.org is still my most recomended solution to go through when you are in difficult or unknown territory on all things Archlinux. So, off we go:

Step 1: check if the wifi is working, do:

sudo ip link

This will bring up the list of interfaces and will let you know if the wifi is working or not. If the wifi does not seem to work (in my case the interface was “wlp3s0”, if will show it as DOWN; if that’s the case, try to bring it up with the following command:

sudo ip link set wlp3s0 up

In my case, when I did so, nothing really happened. So, I ended up looking up the resources and in my case it was managed by netctl-auto which worked on the basis of profile wlp3s0-myssidname and that was part of the systemctl service. So, logically, if the wifi was not up, and asking it to be up did not work, my next recourse could be this:

systemctl start netctl-auto@wlp3s0-myssidname.service

When I did this, a popup box prompted me to enter the username for which I was requesting this service. I entered the username and the password, and was hoping it would work. It did not and instead provided me with an error message and asked me to study the error codes of journalctl -xe . The message in the output from journalctl -xe was cryptic but it did point to something referred to as “authentication failure”. Some more digging into Archlinux forums led me to the page on polkit. It turned out that in a folder titled /etc/polkit-1/rules.d I could create a file labelled 10-wifimanagement.rules and enter the following lines (you have to be the root user, so start this with something like, sudo nano /etc/polkit-1/rules.d/10-wifimanagement.rules and then enter the following code:

polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.systemd1.manage-units") {
if (action.lookup("unit") == "wpa_supplicant.service") {
var verb = action.lookup("verb");
if (verb == "start" || verb == "stop" || verb == "restart") {
return polkit.Result.YES;
}
}
}
});

This code itself looked self-explanatory that if polkit found the verb “start” or “stop” or “restart”, then it’d just execute what was asked to do. Fair enough, I did that restarted my computer. Nothing happened. Possibly the netctl-auto did not enable the profile? So, I did:

systemctl enable netctl-auto@wlp3s0-myssid.service

and it started working. I do not know at the time of writing this if this will fix the problem when I reboot, whether I will get back my internet access, but for the time it works.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store