How to overengineer your home network
A guide to overengineering your home network using UniFi equipments, Pi-hole, WireGuard and a lot of timeImplementation
Objectives
- Secure networks for all devices : 0-trust networks by default
- Fast and reliable internet connection : Up to 10Gbe for servers and mesh wifi for the rest
- Privacy first : Block ads and trackers for all devices with Pi-Hole (since the Ad-blocker from Unifi is not that great)
- Remote access to my home network : Using WireGuard VPN
- Monitoring : Keep an eye on the network with Grafana and Prometheus
- Backup : Backup all my data with a self-hosted solution
Network description
3 VLANs:- 1 : ****Master [10.42.0.0/24] : is used for servers and myself
- 10 : IoT [10.42.10.0/24] : 0 trust network for all IoT devices (i.e. lamps, sonos, tv, …)
- 255 : Guest [10.42.255.0/24] : 0 trust network for any friends coming over
- Go Go Gadget Internet → Master VLAN
- Go Go Gadget Internet - IoT → IoT VLAN
- Go Go Gadget Internet - Guest → Guest VLAN
- TinkyWinky : Workstation with UnraidOS used for storage and compute (Linux VMs and dockers).
- Specs:
- Threadripper 1920X
- 2x 2080 Ti
- 24TB HDD for storage
- 3TB NVme for VMs
- 512GB SSD for cache
- 10GB RJ45
- Dockers:
- Plex for movies and tv shows streamed to TV
- Bitwarden for password management
- Caddy for reverse proxy and SSL
- Specs:
- ✅ Allow master to all VLANs
- ✅ Allow TV to access Plex on TinkyWinky
- ✅ Allow established and related connections (allow other VLANs to communicated if initiated by master VLAN)
- ✅ Allow IoT VLAN to access Home Assistant on TinkyWinky
- ❌ Drop invalid state
- ❌ Block all traffic matching RFC1918 (all local IPv4 addresses)
Dockers
Pi-Hole
Pi-Hole is directly on the the UDM Pro using systemd to create a debian container. I followed the guide from unifi-utilities for UnifiOS 3.x+.All dockers on tinkywinky
- Caddy : Reverse proxy and SSL and is the only one exposed to the internet and lan, the others are only accessible from an internal docker network from Caddy.
- Bitwarden : Password manager accessible through Caddy.
- Nextcloud : Cloud storage accessible through Caddy.
- n8n : Automation tool accessible through Caddy.
External access
WireGuard
The plan is to use wireguard to access my home network from anywhere. The only problem right now is that Unifi doesn't support IPv6 for the easy wireguard setup so I'll have to tweak the configuration a bit to make it work.Limitations
- IPv6 :
- First, my ISP only provides IPv6 subnet and no public IPv4 address so for the moment, I can't access my setup from an IPv4 only network, but it could be solved with either another proxy or a VPN on a VPS, or simply using Cloudflare Tunnels but I'm not sure I want all my traffic to be visible by Cloudflare.
- Unifi doesn't seem to acknowledge the existence of IPv6 for some services (Wireguard, ...), which is a bit annoying.
Future improvements
- External access : If I want to open some of the instances to the internet, I'll probably switch to Traefik with Authelia for authentication and give access to only trusted users.
1graph TD2provider[ISP]3modem[Modem]45device_tinkywinky[TinkyWinky]67switch_livingroom[Living Room Switch]89device_tv[Tv]10device_sonos[Sonos]11device_nanoleaf[Nanoleaf]12device_hue[HUE]13device_tuya[Tuya]1415ap_sonic0[Sonic #0]1617ssid_gogomaster[Go Go Gadget Internet]18ssid_gogoiot[Go Go Gadget Internet - IoT]19ssid_gogoguest[Go Go Gadget Internet - Guest]202122subgraph "ISP"23provider --> modem24end2526subgraph "UDM Pro"27port_wan1[WAN1]28port_lan1[LAN1]29port_lan3[LAN3]30port_lan5[LAN5]3132port_lan333end3435subgraph "IoT VLAN"36ssid_gogoiot3738switch_livingroom3940device_tuya41device_nanoleaf42device_hue43device_sonos44device_tv45end4647modem --> port_wan14849port_lan1 --> ap_sonic050ap_sonic0 --> ssid_gogomaster51ap_sonic0 --> ssid_gogoiot52ap_sonic0 --> ssid_gogoguest5354port_lan3 --> switch_livingroom55switch_livingroom --> device_tv56switch_livingroom --> device_sonos5758port_lan5 --> device_tinkywinky5960ssid_gogoiot --> device_tuya61ssid_gogoiot --> device_nanoleaf62ssid_gogoiot --> device_hue6364style provider fill:#f9f,stroke:#333,stroke-width:4px65style modem fill:#bbf,stroke:#333,stroke-width:2px66style device_tinkywinky fill:#ff9,stroke:#333,stroke-width:2px67style switch_livingroom fill:#9f9,stroke:#333,stroke-width:2px68style device_tv fill:#f99,stroke:#333,stroke-width:2px69style device_sonos fill:#99f,stroke:#333,stroke-width:2px70style device_nanoleaf fill:#9ff,stroke:#333,stroke-width:2px71style device_hue fill:#f9f,stroke:#333,stroke-width:2px72style device_tuya fill:#ff9,stroke:#333,stroke-width:2px73style ap_sonic0 fill:#9f9,stroke:#333,stroke-width:2px74style ssid_gogomaster fill:#f99,stroke:#333,stroke-width:2px75style ssid_gogoiot fill:#99f,stroke:#333,stroke-width:2px76style ssid_gogoguest fill:#9ff,stroke:#333,stroke-width:2px