Blog tvlooy

Building an OpenBSD wireless access point

OpenBSD, networking | December 30, 2013

I have a Cisco/Linksys wireless access point to provide me with WiFi at home. I was never satisfied with the device, from day one, and it caused lots of trouble. I would never buy Cisco/Linksys again. Some time ago it even started crashing / rebooting very frequently. Which by the way also feels very creepy after watching @ioerror's talk at #30c3. Anyway, I'm totally fed up with the "broken" device so today I decided to see what hardware I had lying around to build a replacement.

My home network is protected by an OpenBSD NAT/firewall which also does things like DHCP and DNS. It used to run on a Soekris net5501. I also had an older, less powerful net4801 that was not in use. I found a wireless USB adapter and a wireless miniPCI adapter that I "recovered" from an old D-Link router. That was my initial hotspot setup.

Things changed over time. The home network is now running on APU2 and the Soekris net5501 became my the wifi access point, I got myself a athn card for it so I can do WPA. It runs OpenBSD 6.0 and when I upgrade it to anything more recent, performance drops to max 2Mbps, see also Keep that in mind if you are on a similar setup.


The APU2 was set up with pxeboot capabilities. That is actually very easy. Just adding a single line in the /etc/dhcpd.conf:

filename "pxeboot";

Off course the tftp service must be running too:

rcctl start tftpd

The tftp service points to the directory /tftpboot. Which was created and populated like this:

# mkdir -p /tftpboot # cd /tftpboot # ftp # ftp # mkdir etc # cat << EOF > etc/boot.conf stty com0 19200 set tty com0 boot tftp:/bsd.rd EOF

I think the default baud rate of a Soekris is also 19200, so I'm just adapting the OpenBSD console to that.

Installing base

For installing the base system I hooked up the Soekris with my laptop using a serial to USB cable. There are a lot of Linux tools available that can connect to a serial device. For example cu, screen (not tmux unfortunately) and ckermit. I used ckermit:

$ sudo apt-get install ckermit $ kermit C-Kermit>set line /dev/ttyUSB0 C-Kermit>set speed 19200 C-Kermit>set carrier-watch off C-Kermit>connect

When the power is connected, the system starts comBIOS and allows you to jump into configuration by pressing ctrl+p. At the comBIOS prompt, start network boot with this instruction:

boot f0

The system will use DHCP and the APU2 will give it instructions for pxeboot. The bsd.rd (ramdisk) kernel is loaded and the installation starts. A default installation was just fine in this case.

... comBIOS output ... switching console to com0 >> OpenBSD/i386 PXEBOOT 3.31 booting tftp:/bsd.rd: 3181055+1369088+3366920+0+454656 [349692+107+290608+284430]=0x8dfee4 entry point at 0x201000 Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. Copyright (c) 1995-2019 OpenBSD. All rights reserved. OpenBSD 6.5-beta (RAMDISK_CD) #1272: Sat Mar 16 23:11:49 MDT 2019 ... dmesg output ... Welcome to the OpenBSD/i386 6.0 installation program. (I)nstall, (U)pgrade or (S)hell?

Network interfaces

The APU2 assigns a fixed IP for the device based on it's MAC address. The wired interface is /etc/hostname.vr0:


For the machine to allow forwarding traffic between interfaces, the following system control must be active and uncommented in /etc/sysctl.conf:


The two wireless interfaces I got for the machine is athn. It needs non-free firmware but OpenBSD installs that automatically.

The athn interface supports WPA. The device is configured in /etc/hostname.athn0:

inet mediaopt hostap nwid ctors wpakey mysecretpassword chan 9

The wireless network has it's own IP range 10.0.1/24. The net5501 will hand out IP's for it on the athn interface. A DHCP service is started like this in /etc/rc.conf.local:


The DHCP service config is in /etc/dhcpd.conf:

option domain-name-servers; subnet netmask { option routers; range; }

To make the new subnet reachable from you wired network, add this to the APU's internal network interface /etc/hostname.vr1. would be the IP of the access point's wired interface:

!route add -net 10.0.1/24


This software is all installed by default on an OpenBSD system and just needs some configuration. I'm always surprised how easy these things are to set up with OpenBSD. This is also explained very well in the documentation, man pages and FAQ. OpenBSD is a system that is completely usable with just the manual pages. It has always been a pleasure to use.

Soekris net4801

Soekris net5501

Soekris APU2