Building A Router Pt-1: Researching The Platforms

About The Project

Here at Arch Cloud Labs, we love Arch Linux due to the ability to customize, debug, and otherwise modify every aspect of the system. This level of visibility into an Operating System allows the end user the ability to (in theory) fix any issue they come across with sufficient time and resources. Troubleshooting issues as they arise over time also makes you a better Developer/Sys Admin/hacker/etc… as well. However, when you venture into the wonderful world of SoHo routers you find yourself with limited choices and endless CVEs to wade through. As a homelab hobbyist, I love the thought of being able to develop, build and deploy a custom OS image for my networking devices. This led me to identifying hardware that supports a popular Operating System distributions (PfSense/OpenWrt/Tomato) or identifying a hardware platform with Yocto or Buildroot support. This blog post sums up the past couple of months of research into this space along with ongoing testing.

Router Operating System Choices

When we talk about routers in a home environment, we’re typically talking about a device that handles routing, firewall capabilities, Wi-Fi functionality, and DHCP needs at a minimum. Some more advanced models may support NFS shares or other neat features as well, but these come at a more premium cost. Popular manufacturers of small office/home office (SoHo) routers such as Linksys, D-Link, and Asus have a variety of offshoot Operating Systems that allow hobbyist developers will build custom firmware images and make full use of the hardware as they desire. Popular choices include OpenWrt, Tomato, and PfSense.

OpenWrt is a Linux/GNU distribution tailored towards wireless routers. The OpenWrt community maintains a “table of hardware” (ToH) for devices that are known to work with OpenWrt along with steps to flash custom firmware onto these devices. There’s also a robust developers guide, for building custom images which is exactly what I was looking for.

Tomato is another Linux router distribution, but with more of a focus of getting custom firmware to run on Broadcom devices. For those unfamiliar, your wireless router’s feature set is limited to the functionality of the embedded SoC (system-on-chip)/processor of the device. If you have a data sheet for said SoC/processor, developers of the hobbyist operating systems discussed here can go forth, and understand how to interact with said device and ultimately build custom firmware images for them. However, Broadcom is notorious for not providing publicly available data sheets, thus Broadcom support for custom Linux Operating Systems is limited or otherwise buggy.

PfSense, is an enterprise solution for a network appliance that offers commercial support through Netgate. PfSense is a great choice for a stable, feature complete network appliance, but I already run PfSense as the core router in my Homelab. I want to experiment with alternative networking Operating Systems that allows me to use a build system like Yocto or Buildroot to create custom images for a board. Specifically, I’m looking to replace my Ubiquiti Wi-Fi access point as I don’t enjoy having to run a controller to interface with said access point.

A final option is just running a minimal Linux/BSD with hostapd. A Linux/BSD machine with two network interfaces can route traffic no problem, but the ecosystem of packages, support and documentation offered by Tomato, OpenWrt, PfSense, etc… would be gone and it would be on you to support “all the things”.

For now, I’ve decided to go with OpenWrt because of the robust developer documentation, and wide router support as shown in the Table of Hardware.

Hardware Options for OpenWrt

Referring back to the Table of Hardware, there’s over 2,000 entries of supported hardware models. For experimentation, I’ve chosen three models to evaluate. These models include OpenWrt One, Gl-iNet AX1800, and a Raspberry Pi Compute Module 5.

The OpenWrt One is an official OpenWrt router that supports the latest OpenWrt release at the time of this writing, has publicly available documentation on the Mediatek chipset, and even schematics available should you want to do something crazy and customize the board yourself in Kicard. Out of the box, this is an ideal developer board as it comes with all the documentation necessary to build custom images, recover from firmware upgrade issues, etc… OpenWrt’s firmware build process is also based off of Buildroot which also gives me the ability to fully control the firmware images I’m building for my home router, something I very much like the idea of, and is why I selected it. The image below also shows a header for a Mikrobus add on. Mikrobus is an emerging form factor for embedded devices that allow for swapping in components (referred to as “click boards”)that augment the functionality of given embedded device. Think of it like a generic Raspbery Pi hat for embedded devices. An example would be a CC3100 which is a 802.11 click board. This additional add-on can further customize the router to be tailored toyour needs.

openwrt_one_top.png

Gl-iNet is a SoHo router manufacturer that ship a custom OpenWrt image for most of their routers. Their official website goes into the supported OpenWrt versions for each currently supported model. At this time, the AX1800 supports versions OpenWrt 21.02, but this firmware went End-of-Life as of May 2023. In addition to evaluating performance of this router, I want to try and port a new version of OpenWrt firmware to run on the AX1800. While this sounds ambitious on paper, a pull request is open for official support of this image.

glinet.png

Finally, the Raspberry Pi foundation announced the Raspberry Pi 5 compute module recently. Previous generation compute modules have been used with add-on boards to create small travel routers. Sparkfun has a “IO case” that breaks out the boards I/O into accessible peripherals to include an ethernet port, a Wi-Fi module, GPIO pins, etc… All models of the Rasbperry Pi, to include the original 512MB model is supported by OpenWrt as well as Buildroot. This made it an easy choice to create a DIY travel OpenWrt router to also evaluate the performance of.

pi.png

To summarize, while each of these device supports OpenWrt, they all also provide a unique side project opportunity and learning experience with embedded systems development.

  • The OpenWrt One is an officially OpenWrt router that allows for Mikrobus boards to further tailor your router to your needs. Given the openness of the platform, available documentation and numerous recovery options this board seems pretty hard to brick should something go wrong in the flashing process.

  • The Gl-iNet AX1800 supports an older-version of Openwrt and presents an opportunity to practice porting a recent release to said board.

  • The Raspberry Pi 5 compute module in addition to being supported by OpenWrt is also supported by Buildroot furthering my ability to develop a custom router OS for.

Conclusion

With the devices ordered, the next phase is to build an image and assess the devices functionality (range, bandwidth, etc…). Being able to build, debug and troubleshoot home electronics gives you the ability to reduce e-waste and ultimately control or repurpose the devices in your house. Openwrt is a powerful Open Source router distribution for SoHo routers that enables you to patch functionality as you see fit.

Thank you for reading!