Lesson 2 of 9 · 24m
Firewall Policy and Remote Access Without Exposing the House
Build explicit ingress and egress policy, separate administration from service access, and choose VPN or identity-aware access intentionally.
Every serious home lab eventually faces the same question: how do I reach it when I am not home? The wrong answer is usually a port forward created in five minutes and forgotten for five years. Remote access is not one mechanism. It is a policy decision about who may reach which control plane, from where, under what evidence.
Default posture: deny inbound, constrain outbound
Your edge firewall should start boring:
WAN ingress: deny all except explicitly published services or VPN endpoints
LAN egress: permit required internet access, but log and review sensitive zones
inter-VLAN: implement the written traffic matrix, not convenience any-any rules
management: reachable only from admin networks or tightly controlled VPN usersOn pfSense or OPNsense, the dangerous rule is rarely the explicit allow you remember writing. It is the broad temporary rule left at the top of the list because firewall rule order matters. Audit first-match behavior, aliases, and floating rules after every change.
A small nftables example
Linux firewalls can be explicit and reviewable:
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
ct state established,related accept
iif "lo" accept
iif "vlan20" tcp dport {22, 443} accept
iif "vlan40" tcp dport {80, 443} accept
udp dport 51820 accept
log prefix "lab-drop " counter drop
}
}The exact firewall matters less than the discipline: default deny, explicit interface ownership, connection tracking, and logging that does not drown you.
VPN is for administration, not every user problem
WireGuard is a strong fit when the consumers are trusted devices and you need administrative reach:
[Interface]
Address = 10.10.99.2/32
PrivateKey = <device-private-key>
DNS = 10.10.30.10
[Peer]
PublicKey = <server-public-key>
Endpoint = vpn.lab.example.net:51820
AllowedIPs = 10.10.0.0/16
PersistentKeepalive = 25AllowedIPs is policy, not plumbing. If your phone only needs the reverse proxy, do not give it a route to the hypervisor management network. If you need browser-based access for other people, use an identity-aware proxy or application-level authentication instead of extending network trust.
Do not expose these directly
Some things should almost never listen on the public internet from a home connection: SSH password authentication, hypervisor GUIs, database ports, Docker socket proxies, unauthenticated admin panels, NAS interfaces, and IPMI/iDRAC/iLO. If a vendor says their cloud relay is required, treat that as a risk decision rather than a technical necessity.
Failure mode: carrier-grade NAT
Many home connections sit behind CGNAT. Inbound port forwarding cannot work because you do not control the provider NAT. Your choices are a public VPS relay, IPv6 with explicit firewalling, a hosted tunnel, or an overlay network. Each shifts trust somewhere else. A VPS relay gives you a controlled public edge; a tunnel provider sees plaintext unless end-to-end TLS terminates beyond them.
Field notes
- Disable UPnP on the edge unless you enjoy discovering which device opened its own inbound hole.
- IPv6 is not optional imaginary networking. If enabled, firewall it deliberately; a globally routable host with no policy is exposed even if NAT never protected it in the first place.
- Test from outside the network. Hairpin NAT can make a service appear healthy internally while the public path is broken.
- Put an expiration date on temporary rules in the rule comment or change ticket. Temporary firewall policy has a geological half-life.
Was this lesson helpful?