Building your own Linux home router

Summary

At the Chemnitz Linux Days 2022, Rouven Czerwinski of Pengutronix showed how to build your own Linux home router from free components. The router shown used NixOS, but the approach works with any distribution. The talk covered PPPoE for the VDSL line, DHCP for several internal networks, DNS, a firewall and IPv6 with ULA and delegated prefixes, plus a brief look at DDNS and WireGuard for access on the road.

What a home router actually does

A home router performs many tasks at once. It establishes the connection to the provider, usually via PPPoE over a modem for DSL. It assigns addresses on the home network via DHCP, answers DNS queries, filters unwanted traffic with the firewall and separates different networks, for example for guests or smart home devices.

With IPv6, the provider also delegates an entire prefix, which the router distributes to the internal networks. Additional ULA addresses ensure that internal devices keep stable addresses even if the public prefix changes.

Why build it yourself?

Your own Linux router offers full control, traceable configuration and updates for as long as you install them yourself. NixOS describes the whole system in a configuration file that can be versioned and rebuilt reproducibly. In return, you are responsible for security and availability yourself; if the router fails, the whole home network is offline.

Ideas

  • A Linux computer handles PPPoE, DHCP, DNS, firewall and IPv6 distribution.
  • Separate internal networks keep guests and smart home devices apart from the rest of the network.
  • ULA addresses give internal devices stable IPv6 addresses despite a changing prefix.

Insights

  • A home router combines many network services that you should understand individually.
  • Full control also means full responsibility for updates and fault tolerance.

Facts

  • The router presented used NixOS.
  • A VDSL2 line via a modem with PPPoE was covered.
  • IPv6 was set up with ULA addresses and delegated prefixes.

References

Remarks

  • The talk was listed in the programme as “Howto build your own home linux router”.

Recommendations

  • Keep a ready-configured replacement for a home-built router, such as the provider’s old router.
  • Version the router configuration so that every change can be traced and rolled back.

Open the programme item

Search the Web Archive

Found a mistake or have something to add? Get in touch.