Nick introduced me to Soekris a few weeks ago and some neat little boxes they make. For a current project, the net4801 fit the bill perfectly, especially with the add in vpn1411 which off loads the intensive computational operations for encryption and compression.
I plan some future posts looking at the throughput performance of OpenVPN with and without the vpn1411 as well as general traffic throughput measurements. This post however will focus on installing FreeBSD on this device as easily as possible.
Firstly, I ordered the following:
- Soekris net4801-48 in the case;
- vpn1411 for mini-PCI slot;
- 1.5A power supply;
- 8GB Ultra II CF-Card (could probably be sourced from elsewhere for cheaper);
- USB2.0 Flash card reader; and a
- null modem cable.
Including P&P, this all came to €369.48.
While there is a lot of documentation online and a number of methods available to install FreeBSD on a Soekris box, I found that the easiest way to to do it was as if I were installing on the local machine and hence I could just install it as normal. For this, we turn to VirtualBox1.
- Install VirtualBox if you don’t have it.
- Attach the CF card to your computer via the USB card reader.
- Download a FreeBSD installation CD (e.g. 8.0-RELEASE-i386-disc1.iso.
- Create a new VirtualBox machine such that:
- the ISO image is mounted;
- you have enabled a network adapter (PCnet-PCI II in bridged mode works for me as I have a DHCP server on the LAN).
- Boot the new VirtualBox machine and from its built in BIOS, choose to boot from the mounted CD ROM.
- Immediately attach the USB card reader device to the VirtualBox machine.
- Choose a custom install so you can select the USB device as the destination medium (
- Proceed with your FreeBSD installation as normal.
Once it completes, there are some changes you should make before popping the CF card back into the Soekris box:
/etc/rc.conf, set up the network configuration. Note that in VirtualBox, the interfaces will be reported as
le0but when booted on the Soekris box, they’ll be
sis2. I set
sis0(marked Eth 0 on the case) to configure by DHCP. I also set a static IP on
sis2so I can access the box on a direct computer to computer connection if necessary. Lastly, I enable the SSH daemon (ensure you have created a user!):123ifconfig_sis0="DHCP"ifconfig_sis2="inet 192.168.130.2 netmask 255.255.255.0 up"sshd_enable="YES"
- When installing via VirtualBox, the destination device was a USB drive. On the Soekris, the CF is handled as an IDE drive. As such, change
fstabto something like (as appropriate for you – I have a single root filesystem and a swap partition):123# Device Mountpoint FStype Options Dump Pass#/dev/ad0s1b none swap sw 0 0/dev/ad0s1a / ufs rw 1 1
- Enable a console on the serial port in
/etc/ttysby editing the
ttyu0line:1ttyu0 "/usr/libexec/getty std.9600" vt100 on secure
- Lastly, add the following lines to
Now, pop the CF card back into the Soekris box and boot with the serial console attached (19200,8,n,1). I immediately changed the Soekris console speed to 9600 so that it works seemlessly from Soekris BIOS to FreeBSD bootloader, kernel and console.
1. VirtualBox is a fantastic piece of software. I run Kubuntu natively on my laptop and I have a virtual Windows 7 Professional machine running in VirtualBox most of the time. It runs smoothly and quickly and there is a wonderful feature to allow you to attach USB devices to the virtual machine (so my iPhone can access iTunes for example).