Skip to content

Router: info-highway

This is my router. It runs as a router on a stick, using VLAN tagging and my switch for routing traffic between WAN and LAN VLANs. In an ideal world, this wouldn't be a Pi 4, and would maybe have a switch built in. For my home network though, it seems to work okay and as I've not got huge amounts of throughput, and I'm not running anything like DPI or an IDS, the CPU is more than capable of handling the traffic.

On the hardware side of things, it simply connects to sw0 on a trunk port, and assigns devices to VLANs. I've installed the Pi 4 fan, as it's in the Pi 4 case, but there doesn't seem to be a need for it, as with current usage, it barely touches the CPU at all.

VLANs

Description VLAN ID Address Range DNS Assignments
Upstream Network 10 192.168.0.0/24 Manual .home.chza.me
LAN 20 192.168.1.0/24 .home.chza.me
IoT 30 192.168.30.0/24 .iot.chza.me
Guest 40 192.168.40.0/24 .guest.chza.me
CCTV (Unused) 50 192.168.50.0/24 .cctv.chza.me

DNS

DNS is currently managed by OpenWRT, and is not yet shipped out to PiHole. For this to happen, I'd want to have some sort of cluster running 2 different instances of PiHole redundantly so that if and when it breaks (as it has done previously), DNS queries can still go through.

WAN Failover

graph LR
A(WAN: Virgin Media) ==> D(LAN: Router);
B(WANB: USB Tether) -.-> D;
C(WANC: Bluetooth PAN) -.-> D;

D --> E(Wired Devices);
D --> F(Wireless Devices);

There was a time when Virgin Media was having constant problems, causing the internet to continually drop. As there are so many smart devices on the network, and my computer can't tether wirelessly to my hotspot, I opted to install WAN failover using multiwan3.

If it can't reach the internet on WAN, then it attempts to failover to wanc unless wanb is present. It then queues a Pushover notification to tell me to plug my phone into a USB on the Pi. Once WAN comes back up, then it notifies me that I am free to remove my phone.

I'm not completely happy with this system as is, as currently the Bluetooth tethering is very temperamental and there's no way to let me know the internet is down by sending me a notification when it dies. I can maybe fix this using Home Assistant's notifications, but I've not looked into this properly.

The ideal here is to have a 4G dongle sat near my window with an unlimited data plan on it, then either balance or failover to that when the main internet goes down. I can get these on a business plan through Three for a couple of quid a month, so definitely something to explore.

Network Booting

This is a prerequisite to running clustered computing on the Pis. As I have many old Raspberry Pis lying around, and not many Micro SD cards, I would prefer to network boot the Pis wherever possible, to save on storage overheads. I'm currently booting from an old 64GB SSD out of a Macbook Air, which is plenty fast, but a single point of failure. Backing up this SSD or at least running RAID is a future project.