Author(s): Louis Ouellet
A compact, high-performance home/SMB router built on Raspberry Pi 5 with the Radxa Dual 2.5G Router HAT. Runs on Raspberry Pi OS with a lean Linux stack (ifupdown + iptables + dnsmasq) and optional services like Pi-hole, Unbound (recursive DNS), and a Wi-Fi AP. The project includes shell scripts and documentation to reproduce the setup end-to-end, including NVMe migration for reliability and speed.
eth0
), LAN (eth1
), DMZ (eth2
)ifupdown
for addresses, iptables
for firewall/NAT, dnsmasq
for DHCPwlan0
) or bridged (LAN extender via br0
)
Internet │ [eth0] WAN ← DHCP/PPPoE ┌───────────── RPi 5 ─────────────┐ │ │ [eth1] LAN 192.168.10.0/24 [eth2] DMZ 192.168.20.0/24 GW: 192.168.10.1 GW: 192.168.20.1 │ │ Switch / PCs / NAS Servers / Public apps Optional Wi-Fi: - Guest AP (routed): wlan0 → 192.168.30.0/24 (isolated by default) - Bridged AP: br0 = eth1 + wlan0 (Wi-Fi extends the LAN at L2)
192.168.10.0/24
, DMZ 192.168.20.0/24
(guest Wi-Fi 192.168.30.0/24
if enabled)192.168.10.1
, DMZ 192.168.20.1
, Wi-Fi 192.168.30.1
.100
–.200
per subnet (configurable in scripts)INPUT
: DROP by default; allow loopback, established/related, DHCP/DNS from LAN/DMZ, SSH from LAN onlyFORWARD
: allow LAN/DMZ→WAN; block unsolicited WAN→LAN/DMZ; LAN↔DMZ blocked unless explicitly alloweddnsmasq
on :5353 serves local zones; Pi-hole forwards lan/dmz
to 127.0.0.1#5353
127.0.0.1#5335
for local recursion (DNSSEC in Unbound)Requires Raspberry Pi OS (Bookworm), RPi5 with Radxa Dual 2.5G HAT, and basic console access.
# 1) Get the installer curl -fsSL https://raw.githubusercontent.com/LaswitchTech/router-pi5/stable/install.sh -o install.sh chmod +x install.sh # 2) Run base router setup (ifupdown + iptables + dnsmasq) sudo ./install.sh # 3) (Optional) Add services later # Pi-hole DNS front-end sudo ./add-pihole.sh # Unbound recursive resolver sudo ./add-unbound.sh # Guest Wi-Fi AP (routed) sudo ./add-ap-wifi-guest.sh # Bridged Wi-Fi AP (LAN extender) sudo ./add-ap-wifi-bridge.sh
Heads-up: if you already installed Pi-hole, it binds port 53.
The system dnsmasq
used for DHCP must be moved to port 5353 (the scripts handle this).
To diagnose conflicts: sudo ss -lunp '( sport = :53 or sport = :5353 )'
Review the full documentation including:
Brand | Part | Vendor | Qty | Price |
---|---|---|---|---|
Raspberry Pi | 5 (4–8 GB) | Amazon | 1 | 143.00 $CAD |
Raspberry Pi | 5 Active Cooler | Amazon | 1 | 17.31 $CAD |
Radxa | Dual 2.5G Router HAT | AliExpress | 1 | 60.68 $CAD |
Radxa | Power DC12 60W | AliExpress | 1 | 17.89 $CAD |
Total | 238.88 $CAD |
install.sh
flags (e.g., –with-pihole
, –with-unbound
, –with-ap-guest|bridge
)# Who's using port 53 / 5353? sudo ss -lntup '( sport = :53 or sport = :5353 )' sudo ss -lunp '( sport = :53 or sport = :5353 )' # Pi-hole DNS reload + logs sudo pihole reload dns journalctl -u pihole-FTL -n 50 --no-pager # dnsmasq status & lease file systemctl status dnsmasq cat /var/lib/misc/dnsmasq.leases
Code and docs are in the repo; see LICENSE file for details. Thanks to the Raspberry Pi, Radxa, and open-source communities.