FreeBSD: Working WiFi on Any Laptop

I recently installed FreeBSD for the first time and installed it on my Lenovo X131e. I instantly began battling with it’s evil Broadcom wireless card. This card had caused me endless trouble on Linux. After messing around with it for an hour or two I decided that this was the final straw and pulled the card out. I shoved it in a draw and plan to never look at it again!

Phew… now that’s out the way I can get on with describing my solution!

NOTE: this is based on FreeBSD 10.3 and didn’t work on TrueOS for me.

TL;DR

ASUS USB-N10 Nano

I opted to go with a USB wireless card. I knew that if I got this working then I could use FreeBSD on any of my laptops (or PC’s if needed).

After trawling through the supported hardware list I landed on the ASUS N10. It’s cheap, really small and can easily be left in my laptop full time.

Getting It All Setup

Once you’ve installed FreeBSD you’ll need to complete the following steps to get your WiFi working.

Load the Driver Module

The ASUS N10 uses the rsu driver. You can get all the information you need about this driver by running man rsu.

To load the driver add the following to your /boot/loader.conf:

if_rsu_load="YES"
legal.realtek.license_ack=1
rsu-rtl8712fw_load="YES"

Setup the Interface

To setup the interface add the following to your /etc/rc.conf:

wlans_urtwn0="wlan0"
ifconfig_wlan0="WPA DHCP"

Configure the Connection

And finally to configure your connection add the following to your /etc/wpa_supplicant.conf (create it if it’s not there):

network={
    ssid="< wireless routers SSID >"
    psk="< wireless routers password >"
}

Now you’ve completed these three steps it’s time to reboot your machine. Once it’s booted you should be connected to your configured wireless router and good to go.

Update - 22/07/2017

Adding Multiple Networks

You’re eventually going to want to configure more than one network and you can do this by adding multiple network blocks to your /etc/wpa_supplicant.conf. You can prioritise these by adding a priority value (this defaults to 0 with higher values being selected first).

network={
    ssid="< wireless routers SSID >"
    psk="< wireless routers password >"
    priority=< value >= 0 >
}

Restarting wlan0

Once you’ve added your newly configured network you can restart wlan0 by running:

$ su
$ service netif restart wlan0

References

comments powered by Disqus