Adding OSPF support to Ubiquiti devices
Although Ubiquiti devices don't ship with OSPF support, Ubiquiti do provide a firmware SDK for building custom firmware. Ubiquiti firmware is based on OpenWrt, and consequently there are a lot of software packages available to install, including both BIRD and Zebra.
This guide focuses on building a custom Ubiquiti Airmax firmware with BIRD integrated.
Requirements:
- A working Linux system or virtual machine with build tools installed.
- Basic Unix knowledge (editing/patching files, building software, copying files).
- Ubiquiti Airmax SDK v5.3.
- My patch.
Extract and patch SDK
Download the SDK tarball and patch file, placing them both into the same directory.
tar xjf SDK.UBNT.v5.3.tar.bz2 unzip ubnt-5.3-bird-1.2.5.zip mv SDK.UBNT.v5.3 SDK.UBNT.v5.3.ospf cd SDK.UBNT.v5.3.ospf patch -p1 <../ubnt-5.3-bird-1.2.5.diff
All the above commands should complete with no errors.
Build firmware
To build the firmware your system will need internet access so that the build tools can fetch package data.
From within the SDK.UBNT.v5.3.ospf directory:
cd openwrt make
The build will take a long time even on fast hardware. Go make a sandwich. :)
When it completes, there should be a firmware image in the bin directory:
cd bin ls -l XM* -rw-r--r-- 1 aragon aragon 6932789 Jan 29 14:38 XM.v5.3.ospf.7782.110129.1434.bin
Load that firmware onto your device using the update option in the device's web interface.
Using BIRD
Although you've loaded BIRD onto your Ubiquiti device, there is no pretty GUI for it on the Ubiquiti web interface. BIRD is a Unix daemon, and unless you want to write your own web interface to it, you have to configure and use it via the command line. SSH into your device and start by creating /etc/persistent/bird4.conf. Please see the BIRD User Guide for instructions on configuring and using BIRD.
Once your configuration is done, save it and then try start BIRD on your device:
save bird4.init start
Every time you edit the configuration file you must run the save command to commit changes to flash. If you forget to save, changes will be lost when your device reboots.
Once you're happy with your BIRD setup, create /etc/persistent/rc.poststart with the following contents:
#!/bin/sh /usr/bin/bird4.init start
That will ensure BIRD is started when the device boots up. Run the save command to finish off.
For more usage information and examples, have a look at how it's used in Hout Bay.