Also sprach tealeg…

How to setup wifi in 9front.

This is all documented very well elsewhere:

… but these are my notes for my own benefit (and yours if you happen to look).

Assumptions

This assumes you have a machine with an existing 9front installation, some other network connection (presumably ethernet) already available, and a supported wifi card.

In my case, this means my elderly ThinkPad Edge E130 (i3-3227U version, circa 2014).

Identify your wifi card’s firmware

The following command should show you some output related to your wifi card:

grep .*l1 /dev/kmesg

.. if you have multiple ethernet cards configured the l1 might be l2, etc..

In my case I’ll see that the file /lib/firmware/iwn-2030 is missing.

Download the correct firmware

Plan9 uses the firmware distributed by OpenBSD. Go to the following site and identify the correct firmware bundle:

In my case, the iwn-2030 firmware will be inside the file iwn-firmware-5.11p1.tgz.

To download that firmware I follow these steps:

cd /lib
hget https://firmware.openbsd.org/firmware/7.7/iwn-firmware-5.11p1.tgz | tar xz

Add a wifi connection function to your profile

Edit your profile by typing:

acme $home/lib/profile

Locate the line that starts with:

switch($service)

… and then, prior to that line, insert a function like this:

fn wifi {
   bind -a '#l1' /net
   aux/wpa -s $1 -p /net/ether1
   ip/ipconfig ether /net/ether1
}

NOTE it’s really important to declare this prior to the switch statement, or it won’t be available to you until after you exit your session. Then save you file by middle-clicking “Put” in the toolbar above the buffer.

Reboot

Now reboot your machine:

reboot

Once your machine has booted you should now be able to connect to your wifi by typing (replace <essid> with your wifi network name):

wifi <essid>

…and providing the password when prompted.