The Network Layer

What Slips Through After You've Firewalled Your Devices

We've locked down the apps. Now let's watch the pipe.

You've installed TrackerControl. You've got WFC or OpenSnitch running.

Your Device Firewall Has a Blind Spot

  • Device firewalls see what your device thinks it's doing
    • They see the process, the destination, the port — they ask you to allow or deny
    • A rule you got wrong, an app that connected before the firewall loaded — the device won't tell you
  • They see nothing from devices that can't run software
    • Your smart TV, printer, thermostat, game console — none of those have Little Snitch installed
    • Your guest's laptop, phone, or laptop — not your device, not your firewall, fully visible to you
  • The network sees all of it — always
    • Every packet that leaves your LAN passes through one chokepoint: the router
    • One monitor at that chokepoint covers every device, no agents required, all the time
  • Endpoint visibility vs network visibility — different questions
    • Endpoint: "did this app try to connect?" — reported by the device itself
    • Network: "what actually left?" — observed by something the device can't influence or hide from
  • The network layer is also where you can block globally
    • DNS blocklists cut off entire categories of tracking for every device simultaneously
    • IP blocklists drop known malware infrastructure before any device completes a TCP handshake
  • Your ISP router is not neutral
    • Consumer ISP routers report connected devices, DNS queries, and usage patterns upstream
    • Replace it with something you control — OPNsense — and the chokepoint becomes yours
  • What you build here is independent of every device on your network
    • Works on smart TVs, IoT, guests, VMs, containers — anything that passes through the router

The Setup — Come Join My WiFi

[ Your Devices ]
  [ Guest Devices ]     ← "Everyone jump on my OpenWRT WiFi"
  [ IoT / Smart TV ]
         |
         |  (all traffic)
         ▼
  [ OpenWRT Access Point ]
         |
         |  (everything funneled here)
         ▼
  [ OPNsense Router / Firewall ]
    ├── ntopng        ← see everything
    ├── Suricata      ← flag the bad stuff
    ├── Unbound DNS   ← block at DNS level
    └── IP Aliases    ← block by IP list
         |
         ▼
  [ Your ISP / The Internet ]
  • OpenWRT — the access point: manages WiFi radios, SSIDs, and VLANs at the edge
  • OPNsense — the router and firewall: all policy, all monitoring, all security lives here
  • ntopng — flow analyzer living inside OPNsense, sees every conversation across every device
  • Suricata — IDS/IPS watching all traffic against known bad signatures and JA3 fingerprints
  • Unbound DNS — the resolver that can block entire domains before they resolve to an IP
  • IP blocklists — drop packets to/from known bad infrastructure at the firewall level, below DNS
  • You don't need all of this at once — each layer adds visibility or protection independently

OPNsense and OpenWRT — The Two-Device Stack

OPNsense — Your Router and Firewall

  • Open source firewall and router OS based on FreeBSD — fork of pfSense, more actively maintained
  • Runs on a mini PC, old ThinkCentre, or dedicated appliance (Protectli Vault ~$200, Beelink ~$100)
  • One NIC = WAN (to your modem), one NIC = LAN (to your switch/AP) — web UI at 192.168.1.1
  • ISP routers report to your ISP: connected devices, DNS queries, usage stats — OPNsense does not
  • Plugins relevant here: os-ntopng, os-suricata, os-crowdsec — all from the plugin manager
  • Download from opnsense.org — flash to USB, boot, run installer, done

OpenWRT — Your Access Point

  • Linux-based open source firmware for routers and APs — replaces stock firmware with full control
  • SSH access, firewall rules, traffic mirroring, VLANs, package manager — none of that on stock firmware
  • VLAN support: IoT network, trusted network, guest network — all segmented at the AP layer
  • Compatible hardware: GL.iNet travel routers (OpenWRT pre-installed), TP-Link Archer series
  • Forward all DNS to OPNsense resolver — no device on any VLAN can bypass your resolver
  • Demo moment: "everyone connect to this network" — ntopng is now watching all of you

ntopng — Network Traffic Monitoring

What It Shows You

  • Live flows — every active connection on your network right now, by source, destination, bytes
  • Top hosts — which device is generating the most traffic, sorted by volume or connection count
  • Top destinations — which external IPs and hostnames are contacted most — the wall of shame
  • Protocol breakdown — HTTPS, DNS, NTP, QUIC, STUN, BitTorrent — nDPI identifies by fingerprint
  • Geo map — where your traffic is going: that DNS call resolving to Singapore is worth investigating
  • nDPI deep packet inspection — identifies app protocols even on non-standard ports, even over HTTPS
  • Detects Netflix, Zoom, TikTok, WhatsApp, Telegram, Tor — by traffic behavior, not just port number

Install and First Findings

  • System → Firmware → Plugins → search os-ntopng → install — then Services → ntopng → enable on LAN
  • Your smart TV making 30+ connections before you've touched the remote — that's finding number one
  • NTP sync from every device on different schedules — a surprising number of NTP calls go to Google
  • QUIC (Google's UDP-based HTTP/3) from every Chrome browser simultaneously — visible as UDP/443
  • DNS queries from devices you forgot were on your network — that IP ending in .247 — what is that?
  • Connection to raw IPs with no reverse DNS: legitimate services have PTR records — raw IPs are a flag

Reading ntopng — What to Actually Look For

Hosts to Watch

  • Any device making unusually high connection counts — spyware behavior or a misconfigured sync app
  • Devices connecting at 3am or 4am — background telemetry batching, covert exfil pattern
  • Devices you don't recognize — enumerate everything on your network and know what each one is
  • A device that spikes traffic after being idle all day — update downloading or something else

Destinations to Investigate

  • Connections to raw IPs with no reverse DNS — legitimate services almost always have PTR records
  • Unexpected geographic destinations — your printer talking to servers in China is worth a question
  • High-volume repeated connections to a single unknown host — update server or data exfil?
  • CDN hostnames that resolve to different IPs each time — check the owning organization via whois

Protocol Anomalies

  • DNS queries to non-standard ports — something is trying to bypass your resolver
  • STUN/TURN traffic — peer-to-peer NAT traversal for Zoom, Teams, games, and occasionally spyware
  • High UDP to random IPs — could be a game, could be a botnet calling home
  • Tor traffic signatures — nDPI fingerprints Tor circuit establishment even over non-standard ports
  • Encrypted traffic metadata — even with HTTPS, ntopng sees: device, destination IP, volume, timing
  • This metadata alone identifies most services — encrypted is not the same as invisible

Suricata — Intrusion Detection and Prevention

What It Is and How to Deploy

  • Open source IDS/IPS — watches all traffic against a database of known bad signatures
  • IDS mode: alert and log. IPS mode: drop the matching packet too. Start in IDS, tune, then switch.
  • OPNsense: Services → Intrusion Detection → install rules, enable on WAN and LAN interfaces
  • Enable on WAN to stop inbound threats; enable on LAN to catch compromised devices calling out
  • ET Open (Emerging Threats) is free, updated daily — the baseline ruleset for any deployment

What It Catches

  • Known malware command-and-control traffic — even over HTTPS, via JA3 fingerprinting
  • Exploit kit traffic patterns: specific URI structures, headers, response sequences
  • Port scans and reconnaissance originating from inside your network (compromised device indicator)
  • DNS exfiltration — data encoded in long subdomain strings — Suricata has dedicated rule categories
  • Cryptocurrency mining pool connections — distinct protocol patterns, easily detected
  • Credential phishing infrastructure — domains and IPs from active campaign feeds (Abuse.ch)

JA3 Fingerprinting — The Interesting Part

  • TLS handshakes have a fingerprint: which cipher suites and extensions the client offers
  • Malware families use the same TLS library → consistent JA3 hash across all infections
  • Suricata flags: "this HTTPS connection has a JA3 hash associated with Emotet" — no decryption needed
  • Rule sets: Abuse.ch SSL Blacklist includes JA3 hashes from active malware campaigns
  • Tuning: week 1 in IDS mode, identify false positives (Steam trips rules), suppress known-good traffic

DNS Blocklists — Block It Before It Resolves

How DNS Blocking Works and Why It's Powerful

  • Every connection starts with a DNS lookup — if the resolver returns NXDOMAIN, no connection happens
  • No IP = no TCP handshake = no data leaves any device on your network for that destination
  • Works on smart TVs, IoT, game consoles, guests — anything using your DNS server
  • OPNsense runs Unbound as its resolver — all devices get OPNsense via DHCP automatically
  • Services → Unbound DNS → Blocklists tab — add URLs, Unbound downloads and applies them
  • One blocklist addition covers every device on your network simultaneously, no per-device config

Best Blocklist Sources

  • Hagezi DNS Blocklists — tiered: normal, pro, ultimate — well maintained, low false positives
  • OISD — large, actively curated, low breakage rate — good starting point for any network
  • Steven Black's hosts — merged ad/tracking/malware list, multiple variants by category
  • Abuse.ch — malware and botnet C2 domains specifically — not ad-blocking, threat intelligence
  • EasyList + EasyPrivacy — the lists that power uBlock Origin, available in hosts format

What You'll Block on Day One

  • Advertising networks: doubleclick.net, googlesyndication.com, moatads.com, taboola.com
  • Tracking pixels: scorecardresearch.com, omtrdc.net, quantserve.com, demdex.net
  • Smart TV telemetry: samsungads.com, lgtvsdp.com, *.amazon-adsystem.com, tvsquared.com
  • Windows telemetry: vortex.data.microsoft.com, settings-win.data.microsoft.com, watson endpoints
  • Start with OISD normal + Hagezi normal — good coverage, minimal breakage, whitelist as needed

IP Blocklists — Drop the Packet at the Border

How IP Blocking Works

  • Block by IP address range — firewall drops packets to/from listed IPs before DNS, before TCP
  • Catches malware that hardcodes IP addresses and skips DNS entirely — no DNS query to intercept
  • OPNsense: Firewall → Aliases → URL Table type → point at a blocklist URL → auto-refreshed
  • Create a floating rule: block any traffic matching the alias — applies across all interfaces at once
  • Combine with DNS blocking: DNS catches domain-based connections, IP catches hardcoded bypasses

Best IP Blocklist Sources

  • Spamhaus DROP/EDROP — don't-route-or-peer lists: hijacked ASNs, malicious allocations
  • Abuse.ch Feodo Tracker — botnet C2 IPs: Emotet, TrickBot, Dridex infrastructure updated daily
  • Emerging Threats IP blocklist — known C2 and malware hosting IPs, matches the Suricata ruleset
  • Firehol Level 1 — conservative merged list, minimal false positives, good baseline
  • CrowdSec — collaborative threat intelligence: IPs seen attacking other CrowdSec users globally
  • os-crowdsec plugin: community-sourced blocklist updated in near-real-time from attack observations

Geo-Blocking and Considerations

  • OPNsense supports MaxMind GeoIP — block entire country IP ranges at the firewall level
  • Useful for inbound only, or if you have no legitimate reason to communicate with specific regions
  • CDNs serve from everywhere — geo-blocking will break legitimate services if applied broadly
  • Blunt instrument: use narrowly, document what you block and why, maintain a whitelist

The Layered Defense Stack

Layer Tool What It Catches Uniquely
Device firewall WFC / OpenSnitch / Little Snitch Which specific process made the connection
DNS blocklist Unbound + Hagezi/OISD Domain-based tracking, telemetry — all devices at once
IP blocklist OPNsense Aliases + Firehol Hardcoded IPs, known malicious ASNs, geo threats
Suricata IDS/IPS ET Open + Abuse.ch rules Malware behavior signatures, encrypted C2 by JA3 fingerprint
ntopng nDPI flow analysis Anomaly visibility, metadata analysis, full device inventory
CrowdSec Collaborative CTI feed IPs actively attacking other users right now, globally
  • Each layer catches what the others miss — no single tool sees everything
  • Stack them in order: device → DNS → IP → IDS → visibility
  • Start with just OPNsense + DNS blocklists — that alone covers every device with zero per-device work
  • Add Suricata in IDS mode next — tune for a week before switching anything to IPS/drop mode
  • Add ntopng last — it's the visibility layer that shows you whether the blocking is working

What the Network Layer Catches That Devices Don't

  • Your smart TV's full data diet — with no agent installed
    • Samsung, LG, Roku, Fire TV all phone home on a schedule regardless of any device-side setting
    • ACR (Automatic Content Recognition) fingerprints what you're watching and reports it to ad networks
    • DNS blocklist kills this for every TV on your network simultaneously — no configuration on the TV
  • The connection that happened before the device firewall loaded
    • On boot, some apps connect before per-app firewalls initialize — the network sees it regardless
  • Every device that joins your network — including guests
    • ntopng shows every device, every connection, including the ones you invited to the workshop
    • You have approximately zero privacy right now. Mwahahaha.
  • IoT devices with no user-facing controls whatsoever
    • Smart plugs, bulbs, thermostats, printers — all calling somewhere, nothing you can configure
    • Many contact Chinese cloud infrastructure by default — DNS and IP blocklists cut this off silently
  • Suricata catches the things that look normal but aren't
    • HTTPS traffic to a known malware C2 server on port 443 — looks like web traffic, JA3 says otherwise
    • DNS exfiltration: data encoded in subdomain strings — a2f3b1c9d.exfil.attacker.com — Suricata has rules
  • The bigger picture — two different views
    • Device tools show what your devices think they're doing
    • Network tools show what's actually happening — you want both views simultaneously

Resources

Tool Link
OPNsense opnsense.org — download, docs, community forum
OpenWRT openwrt.org — firmware + hardware compatibility table
ntopng ntop.org/ntopng — standalone or OPNsense plugin os-ntopng
Suricata suricata.io — OPNsense plugin os-suricata
CrowdSec crowdsec.net — OPNsense plugin os-crowdsec
Hagezi DNS Blocklists github.com/hagezi/dns-blocklists
Steven Black hosts github.com/StevenBlack/hosts
OISD blocklist oisd.nl
Abuse.ch abuse.ch — Feodo Tracker, URLhaus, SSL Blacklist
Spamhaus DROP/EDROP spamhaus.org/drop
Firehol blocklist-ipsets github.com/firehol/blocklist-ipsets
Protectli Vault protectli.com — fanless purpose-built OPNsense boxes
GL.iNet routers gl-inet.com — OpenWRT pre-installed, travel or home AP

Further Reading

  • OPNsense documentation: docs.opnsense.org
  • ntopng user guide: ntop.org/guides/ntopng
  • Suricata rules writing: suricata.readthedocs.io
  • Emerging Threats ruleset changelog — good reading for what is active in the wild right now