Veljko Radan

Language: SvenskaEN

← All articles

How the home network is guarded

One firewall, four layers and one place to watch. The map of how DNS, IDS, DPI and VPN work together.

Veljko Radan · · 5 min read

Over a few evenings my home network got three new things: forced DNS, intrusion detection and traffic analysis, on top of VPN tunnels that are now post-quantum. Each has its own article. This one is the map: what each layer does, why it is there, and how they work together.

How the home network is guarded: one firewall, four layers, one place to watch Devicesphones, TVs,computers,consoles The firewall 1 · DNS: every lookup goes to my resolverport 53 redirected · DoT blocked · DoH starved~1 million domains on the blocklist 2 · IDS (Suricata): is something bad happening?43,000 rules: malware, botnets, phishingalerts only, nothing blocked 3 · DPI (ntopng): what is happening?apps and protocols per device, livewatches only 4 · VPN: everything leaves through two tunnelsDNS too · second tunnel takes overpost-quantum key exchange Internetvia the VPN Monitoringexporter → Prometheus → Grafana + start pagepush to my phone on alerts or failures
Everything sits on one small firewall. A request from any device passes all four layers before it reaches the internet, and the monitoring tells me when something is wrong.

Layer 1: DNS – the first thing every device does

Before a phone loads a page or an app phones home, it asks DNS for an address. That makes DNS the cheapest place to stop ads, trackers and known malware: no address, no connection. The firewall's own resolver answers every lookup against a blocklist of about a million domains (Hagezi Pro plus threat intelligence). Devices that try to ask someone else are caught: plain DNS is redirected, DNS over TLS is blocked, and the known DNS-over-HTTPS servers simply don't resolve. The lookups that pass then leave through the VPN, not through my internet provider.

What it gives: the same protection for every device, including the ones I can't install anything on, like the TV. Forcing all DNS through the firewall

Layer 2: IDS – is something bad happening?

DNS stops what is known by name. Suricata looks at the traffic itself, with 43,000 rules for malware, botnet control servers, phishing and crypto miners. It runs on the home network side, before the VPN, so it sees which device did what. It only raises alerts; it blocks nothing yet. The rules are chosen for a network that only connects outwards, so it stays quiet unless something really happens, and when it does, my phone buzzes.

What it gives: an early warning if a device on the inside has been compromised. An IDS someone actually listens to

Layer 3: DPI – what is happening?

The IDS answers yes or no. ntopng answers the open question: which device talks to whom, using which application, and how much. It recognises streaming, games, cloud sync, updates and hundreds of other protocols, per device and live. It is a magnifying glass, not a guard: it watches and blocks nothing. When the IDS or the DNS dashboard shows something odd, this is where I look next.

ntopng dashboard on the firewall: a flow chart from home devices to remote addresses, a donut of top hosts, a donut of top applications led by DNS and TLS with Epic Games and Riot Games visible, and a traffic classification donut that is mostly safe. Remote addresses and host names are hidden.
ntopng twenty minutes after it was switched on. Top left: which device talks to which address. Bottom left: applications recognised by deep packet inspection – DNS and TLS, but also Epic Games and Riot Games: someone was gaming that evening, and it can tell. Remote addresses and host names are hidden.

Layer 4: VPN – how everything leaves

All traffic from the home network, DNS included, leaves through two WireGuard tunnels to a commercial VPN; if the first fails the second takes over. My internet provider sees encrypted traffic to one address and nothing else. Since December the tunnels also use a post-quantum key exchange, so a recording of the traffic today can't be decrypted by a quantum computer tomorrow. Post-quantum VPN tunnels on the router

Watching all of it

Layers nobody looks at are decoration. A small exporter on a server at home reads the firewall's DNS statistics and IDS alerts through the API, with keys that can only read, and hands the numbers to Prometheus. From there:

  • Grafana dashboards for DNS and security, plus one for traffic and the machines.
  • A start page with one row per area: traffic, DNS, security, status.
  • Push to my phone when the IDS raises an alert, when Suricata stops, or when the DNS blocklist suddenly is empty.
Self-hosted start page with rows for traffic, DNS, security, status and infrastructure: today 119 GiB down, 2,087,424 DNS queries with 1,383 blocked, IDS with 42,842 active rules in 9 rule sets and 0 alerts, uptime and load per server, and a card for ntopng. The VPN server name, location and one service card are hidden.
All four layers on one page: traffic through the VPN, DNS, the IDS and the machines. Hidden: location, VPN server name and one service.

Why layers

No single layer catches everything. DNS doesn't see a malware sample that connects straight to an IP address; the IDS does. The IDS doesn't tell me that the TV suddenly sends gigabytes to somewhere new; ntopng does. None of them help if my internet provider can read the traffic; the VPN does. And all of it is worth nothing if nobody notices; the monitoring does. Each layer covers a gap in the one before.

What it costs

All of it runs on a small office PC with 12 threads and 16 GB of memory: CPU about 3 %, memory about 21 %. Every piece is free, open-source software. Every change went through the firewall's API, with a backup before and after, so each step can be undone.