Design a home network based on the following input:
ISP router
Private firewall behind ISP router: OPNsense.
managed switch
private Wi-Fi router
Pi-hole for ad blocking
Traefik a reverse proxy for SSL and routing between domain names (to avoid using IPs).
Cloudflare Tunnel for remote access.
Requirements: I want to separate my home network from the ISP's network. I will connect wired devices to OPNsense using managed switches and wireless devices through a private Wi-Fi router. I will host several applications on my home network, including Jellyfin, Immich, Nextcloud, and Home Assistant. I need Traefik for HTTPS and easy app routing. Also, I want to access my home network from outside using Cloudflare Tunnel and Tailscale as an internal VPN. I will offer some public services that can be accessed online without logging in.
Design a home network that is easy to manage, secure, utilizes VLANs when needed, and is scalable.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Here’s a secure, scalable, and manageable home network design based on your requirements — optimized for isolation, security, ease of management, and future expansion.
🔒 Key Principle: Zero Trust from the ISP. Your ISP router is treated as untrusted. All security, routing, and filtering happen in your OPNsense zone.
🧩 Component Roles & Placement
Component
Role
Placement
Notes
ISP Router
Internet gateway
Outside your network
Do NOT use as DHCP/DNS/firewall. Put in Bridge Mode (critical!) so it only passes traffic. If bridge mode isn’t possible, disable its DHCP, Wi-Fi, and firewall.
OPNsense
Primary firewall, DHCP server, VLAN router, DNS forwarder
Directly connected to ISP router (WAN)
Handles all routing, firewall rules, VLANs, DHCP, DNS forwarding to Pi-hole.
Managed Switch
Network segmentation hub
Connected to OPNsense LAN port
Supports VLAN tagging (802.1Q). All wired devices connect here.
Private Wi-Fi Router
Wireless access point
Connected to OPNsense LAN port (via switch or directly)
Disabled DHCP & NAT. Set to Access Point (AP) Mode. Use same SSID/password as OPNsense for seamless roaming.
Pi-hole
DNS sinkhole / ad blocker
On LAN network (VLAN or standalone)
Configured as DNS server in OPNsense DHCP settings. All devices use Pi-hole for DNS.
Traefik
Reverse proxy, SSL termination, routing
On LAN network (Docker/VM)
Listens on internal IP. Routes traffic based on hostname (e.g., jellyfin.yourdomain.com). Uses Let’s Encrypt via Cloudflare DNS API.
Cloudflare Tunnel (cloudflared)
Secure public access without port forwarding
Runs on Traefik host or separate VM
Connects to Cloudflare edge. Exposes only Traefik (port 80/443). No open ports on OPNsense.
Tailscale
Zero-config internal VPN
Installed on all devices needing remote access
Creates mesh VPN. Used for secure internal access (e.g., Home Assistant UI, file shares). No exposure to public internet.
Services (Jellyfin, Immich, Nextcloud, HA)
Applications
On LAN network (Docker/VM)
Hosted on a single server (e.g., Proxmox, Ubuntu VM, or NAS) or distributed. All accessed via Traefik + Cloudflare Tunnel.
🌐 VLAN Design (Critical for Security & Scalability)
Use VLANs to segment traffic and enforce policies. Managed switch must support VLANs.
VLAN ID
Name
Purpose
Devices
Security Notes
10
LAN
Main network
Phones, laptops, tablets, smart TVs
Default network. DHCP from OPNsense. Pi-hole DNS.
20
IoT
Smart devices
Lights, plugs, cameras, thermostats
Isolated. No outbound internet unless needed. Blocked from accessing LAN.
30
Guest
Visitors
Guest phones/laptops
Limited internet only. No access to LAN/IoT.
40
Server
Hosting services
Traefik, Pi-hole, Jellyfin, Nextcloud, etc.
Most restrictive. Only allows inbound from Traefik (port 80/443) and Tailscale. Blocks all other LAN access.
99
DMZ (Optional)
Public-facing services
If you ever need a public web server
Not needed now — Cloudflare Tunnel replaces this.
💡 OPNsense Configuration:
Create VLAN interfaces on the managed switch port connected to OPNsense (tagged).
Assign each VLAN to an interface (lan10, lan20, etc.).
Set up DHCP servers per VLAN.
Configure Firewall Rules:
IoT → Can only reach WAN (no LAN/IoT communication).
Server → Only accepts traffic from Traefik (on LAN) and Tailscale (via 100.x.x.x subnet).
Guest → Only WAN, no internal access.
LAN → Can reach Server (for apps) and WAN.
✅ Managed Switch Setup:
Port connected to OPNsense: Trunk port (allow VLANs 10,20,30,40).
Ports for wired devices: Assign to appropriate VLANs (e.g., NAS → VLAN 40, PC → VLAN 10).
Wi-Fi Router: Connect to a port assigned to VLAN 10 (untagged).
🛡️ Security & Isolation Strategy
Goal
Implementation
Isolate from ISP
ISP router in bridge mode. OPNsense handles all routing/firewalling.
Block ads & trackers
Pi-hole as DNS server for all VLANs. Blocklists: StevenBlack, AdGuard.
Prevent lateral movement
VLAN segmentation + firewall rules block inter-VLAN traffic by default.
No open ports to internet
Cloudflare Tunnel exposes only Traefik. No port forwarding.
SSL/TLS termination
Traefik handles Let’s Encrypt certs via Cloudflare DNS API (no HTTP challenge).
Remote access
Use Tailscale for secure internal access (SSH, HA UI, file shares). Use Cloudflare Tunnel for public services (e.g., Jellyfin public streaming).
No public IPs needed
Cloudflare Tunnel masks your IP. Even if your ISP changes IP, service stays up.
Scalability
Add VLANs easily. Add more services behind Traefik with new hostnames.
✅ DNS: Point yourdomain.com A record to any IP (Cloudflare Tunnel ignores it). Use CNAME to yourdomain.pages.dev (or use Cloudflare Tunnel’s generated hostname).
🔐 Cloudflare Tunnel Setup
Install cloudflared on the Traefik host (same machine).
Run: cloudflared tunnel run --no-autoupdate myhome
In Cloudflare DNS, delete any existing A records for your subdomains. Let Cloudflare Tunnel handle routing.
✅ Benefits: No open ports, encrypted end-to-end, DDoS protection, geo-blocking, WAF.
📱 Tailscale for Secure Internal Access
Install Tailscale on:
OPNsense (optional, for remote firewall access)
Traefik server
Home Assistant server
Your laptop/phone
bash
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --hostname=home-server
Access services via http://home-server:8123 (Home Assistant) or http://home-server:8080 (Nextcloud) from anywhere — no port forwarding, no public exposure.
🔒 Tailscale uses WireGuard. All traffic is encrypted and authenticated via your Tailnet.
No open ports. Cloudflare Tunnel + Tailscale replace port forwarding.
Scalability
VLANs let you add devices/services without reconfiguring entire network.
Maintainability
All services behind Traefik → one place to manage certs, routing, auth.
Privacy
Pi-hole blocks ads/tracking for all devices.
Redundancy
Use a UPS. Back up OPNsense config regularly.
Monitoring
Install Netdata or Grafana on server to monitor bandwidth, CPU, disk.
Backup
Back up Traefik config, Pi-hole blocklists, and Tailscale keys.
📦 Optional Enhancements (Future)
Unbound on OPNsense → forward to Pi-hole → improves DNS privacy.
Fail2ban on OPNsense for SSH brute-force protection.
WireGuard VPN server on OPNsense (if you want to bypass Tailscale for some use cases).
Home Assistant Supervised → install on same server as Traefik (use Docker).
Automated backups of all services to external drive or cloud (e.g., rclone to Backblaze).
🏁 Final Notes
You do NOT need a second router. The private Wi-Fi router is just an AP.
You do NOT need DMZ. Cloudflare Tunnel is superior for exposing services.
You do NOT need static IPs on devices. Use DHCP reservations in OPNsense for servers (e.g., Traefik = 192.168.10.100).
All public services are behind Cloudflare → protected, fast, free SSL.
This design is enterprise-grade for home use: secure, clean, scalable, and maintainable. You can add 10 more services tomorrow with a single Traefik label. No port forwarding. No exposed IPs. Zero trust from ISP to your server.
Let me know if you want the OPNsense VLAN config screenshots or Tailscale + Cloudflare Tunnel setup scripts!