Your Network Is the Foundation

Networking

Every self-hosted app, remote backup, and media stream depends on predictable local networking. Clean DNS, tidy subnetting, and deliberate firewall rules prevent brittle workarounds later.

DNS: Where Local Control Begins

Every phone, laptop, and smart TV resolves hostnames through DNS. Running a local resolver cuts ad and tracker traffic network-wide while giving internal hostnames clean local routing.

Pi-hole: Network-Wide DNS Filtering

Pi-hole acts as a local DNS sinkhole, blocking known advertising and telemetry domains across devices that cannot run browser extensions.

Basic setup:

  1. Run Pi-hole in Docker or on a Raspberry Pi with a static LAN IP.
  2. Point your router's DHCP DNS option to that IP.
  3. Verify queries appear in the dashboard (typically blocking 15–30% of tracker requests).

AdGuard Home: Encrypted Upstream Built In

AdGuard Home covers the same filtering role with built-in DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) plus per-client filter toggles.

FeaturePi-holeAdGuard Home
Ad blockingMature blocklistsMature blocklists
Web UIFunctionalModern layout
Encrypted upstream DNSVia Unbound or CloudflaredBuilt-in DoH/DoT
Per-client controlsGroup rulesPer-device switches
RAM usageVery lowLow

Reverse Proxies: Clean HTTPS Routing

A reverse proxy listens on ports 80 and 443, terminates TLS certificates, and forwards each subdomain to its internal backend port.

Caddy: Automatic HTTPS

Caddy requests and renews Let's Encrypt certificates automatically with concise configuration:

# Caddyfile
nextcloud.yourdomain.com {
    reverse_proxy 192.0.2.10:8080
}

vaultwarden.yourdomain.com {
    reverse_proxy 192.0.2.10:8081
}

jellyfin.yourdomain.com {
    reverse_proxy 192.0.2.10:8096
}

Traefik: Docker-Native Labels

Traefik watches the Docker socket and reads routing rules straight from container labels:

# docker-compose.yml labels
labels:
  - "traefik.enable=true"
  - "traefik.http.routers.nextcloud.rule=Host(`nextcloud.yourdomain.com`)"
  - "traefik.http.routers.nextcloud.tls.certresolver=letsencrypt"

Nginx Proxy Manager: Browser Interface

For administrators who prefer managing proxy hosts and certificates through a web dashboard, Nginx Proxy Manager wraps Nginx and Certbot in a clean UI.

VLANs: Network Segmentation

Virtual LANs split trusted workstations, servers, smart-home gadgets, and guest Wi-Fi onto separate logical subnets over shared switches:

VLANPurposeExample Devices
VLAN 1ManagementRouter, managed switches, access points
VLAN 10TrustedLaptops, desktops, phones
VLAN 20ServersNAS, Docker hosts
VLAN 30IoTSmart plugs, cameras, thermostats
VLAN 40GuestVisitor Wi-Fi

Isolating IoT devices keeps a compromised smart camera or plug from probing your NAS or SSH ports.

Equipment required: An entry-level managed Gigabit switch (such as an 8-port TP-Link TL-SG108E) paired with a VLAN-capable router running OPNsense, pfSense, or OpenWrt.

VPN: Private Remote Access

WireGuard

WireGuard uses modern cryptography inside the Linux kernel for fast handshakes and low battery drain on phones. Use it to reach home NAS shares, SSH consoles, and admin panels remotely without exposing them on the public web.

Tailscale and Headscale

Tailscale automates WireGuard key exchange and NAT traversal across devices with zero router port forwarding. Headscale lets you self-host the coordination server if you prefer full independence.

Firewalls

FirewallTypeBest ForCost
OPNsenseDedicated router/firewall OSMini PC router buildsFree (open source)
pfSenseDedicated router/firewall OSDedicated firewall hardwareFree (CE)
OpenWrtEmbedded router firmwareSupported consumer routersFree (open source)
UFWLinux host firewallIndividual Docker/Linux serversFree (built-in)
nftables / iptablesLow-level Linux packet filterCustom host rulesFree (kernel)

Baseline UFW Rules

# Default deny incoming, allow outgoing
sudo ufw default deny incoming
sudo ufw default allow outgoing

# Allow SSH (change port if needed)
sudo ufw allow 22/tcp

# Allow HTTP/HTTPS for reverse proxy
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

# Allow WireGuard
sudo ufw allow 51820/udp

# Enable
sudo ufw enable

Cloudflare Tunnel: Zero Open Router Ports

Cloudflare Tunnel runs a lightweight daemon inside your network that dials outbound to Cloudflare, publishing chosen web apps without opening inbound firewall ports or exposing your home IP. Note that TLS terminates at Cloudflare's edge; use WireGuard or Tailscale whenever end-to-end privacy matters most.

Network Hardware Tiers

CategoryEntry PickMid-RangeEnthusiast
RouterOpenWrt on existing routerMini PC + OPNsenseProtectli VP2420
SwitchTP-Link TL-SG108E (managed)TP-Link TL-SG3210 (L2+ managed)UniFi PoE managed switch
Access PointTP-Link EAP225UniFi U6 LiteUniFi U6 Pro
CablingCat5e (up to 1GbE)Cat6 (up to 10GbE short runs)Cat6a (10GbE up to 100m)

Consistent Naming

  • Devices: type-location-number (nas-office-01, ap-lounge-01).
  • VLANs and subnets: Match numbers cleanly (VLAN 10 → 10.0.10.0/24).
  • Network diagram: Keep an up-to-date map in draw.io alongside /docs/ notes.

Product links may include affiliate partnerships. See our affiliate disclosure for details.