Skip to content

Suricata Netmap Jammed the Firewall

The Problem

One afternoon the whole house lost internet for about 25 minutes. The firewall was up, the WAN was up, but traffic on the LAN side simply stopped moving. An hour later Grafana fired again: Suricata IPS queue full.

The Setup

Suricata was running as an inline IPS in netmap mode on the LAN parent interface — the physical port that carries every VLAN as a tagged trunk. The policy was already two-tier (drop high-confidence threats, alert on everything informational), so this wasn't a rule blocking traffic. It was the plumbing.

Why It Happened

NETMAP (inline)                          DIVERT
───────────────                          ──────
NIC ──► netmap ring ──► Suricata         NIC ──► pf firewall ──► allowed?
              │              │                         │
              └── everything ┘                         └─ divert-to rule ──► Suricata
                 must pass here                                                 │
                                                       pf ◄── verdict ──────────┘

If Suricata stalls,                      If Suricata stalls,
the NIC stalls.                          the firewall still owns the packet path.

With netmap, Suricata sits inside the NIC's packet path. Every packet on every VLAN has to go through its ring buffers. If Suricata can't keep up — a burst of traffic, a slow rule, a ring that fills — the port stops forwarding. On a trunk carrying every VLAN, that means everything.

Netmap and VLAN trunks are also a known awkward pair: the netmap kernel device doesn't always cooperate with other kernel features, VLANs included. Plenty of people run it fine on a plain WAN or LAN port; a busy trunk is where it bites.

The Fix

Switch the IPS to Divert mode (Services → Intrusion Detection → Administration). In Divert mode, the firewall's own rules decide which traffic is handed to Suricata (divert-to), and Suricata returns a verdict. The packet path belongs to pf, not to Suricata's buffers.

Same rules, same two-tier policy, same alerts — just a different way of getting packets to Suricata.

What Changed Afterwards

  • No more queue-full stalls
  • Grafana alerts for "Suricata IPS falling behind" and "Suricata silent", so a stuck IPS is noticed before the family notices
  • Suricata logs go to Loki via remote syslog, so alerts can be searched next to firewall logs

The Lesson

An inline IPS is part of your network, not an add-on to it. If it can stall, your network can stall. Choose the mode where a struggling IPS degrades gracefully, and alert on its health — not just on what it detects.

Also: netmap on a VLAN trunk is a risk. If your LAN port carries every VLAN, start with Divert mode and only try netmap if you have a reason and a rollback plan.