Wifi isn’t that simple on Linux. Well, it is to some extent using NetworkManager under graphical environment. But in a terminal, setting up a wifi can be cumbersome. Fortunately, systemd and ArchLinux ARM has made this process a breeze through many examples sitting in /etc/network.d/examples. That being said, there’s some things that may not be clear for people using systemd for the first time so here’s how to make your wifi work.
Lucky us, Arch already made some of the work for us. Edit /etc/network.d/wireless-wpa and change the ESSID for the name of your router and the key to your WPA password.
Once done, you will be able to activate that configuration by typing (in root)
# systemctl enable "email@example.com" # systemctl start "netcfg@wireless-wpa"
Now your wifi should work.
There’s some magic here and it might be good to explain what’s happening with firstname.lastname@example.org:
In /usr/lib/systemd/system, there’s a file name netcfg@.service. This file is a wrapper. So when you call systemctl enable “email@example.com” netcfg@.service is called and in return will use /etc/network.d/whatever_is_after_@.
So once your wifi works, it’s a good idea to disable your ethernet. If you don’t it won’t change much except that every time you boot you will have an error message from systemd saying firstname.lastname@example.org failed. False negative is more than useless: it makes any other important error message less important because you will be used to seeing error at boot time.
To get rid of ethernet service we do the opposite of enabling the wifi. In /etc/network.d/ there is a file name ethernet-eth0. So doing the exact opposite:
# systemctl disable "email@example.com" # systemcdl stop "netcfg@ethernet-eth0"
The last line is only useful if ethernet was connected. Voilà!
If you reboot, you won’t see an error about ethernet and you will see a message saying that your wifi was successfully connected to your home network.