Back to Engineering Blog
Infrastructure & Reliability 3 min read

The Port Mirror Delivered Packets, and tcpdump Saw Nothing

A switch SPAN port, a dedicated NIC and a bridge into the IDS container were all configured and green. Broadcast traffic arrived and everything else vanished. A learning bridge was correctly refusing to forward frames it believed belonged to the port they arrived on.

Jason NevillBy , Houston, TX
#IDS#Suricata#Zeek#Linux#Networking

Key Architectural Takeaways

  • A Linux bridge is a learning switch; on a SPAN feed it will learn every mirrored MAC behind the same port and stop forwarding.
  • Bisect the path: switch counters, then the physical NIC, then the bridge, to localise where traffic disappears.
  • Disabling MAC learning on the tap port turns the bridge into a repeater and must be made persistent.

The challenge

The network sensor (Suricata and Zeek in a container) had only ever seen a test capture. To watch real traffic we needed a mirror of the firewall's uplink on the switch, delivered to a dedicated NIC on the hypervisor, bridged into the sensor container.

Building the path

  1. The managed switch does support port mirroring: it is exposed in the controller as a mirror mode on a port override, with a hardware limit of one mirror session. Our earlier doubt in the architecture notes was wrong.
  2. A second, previously unused NIC on the hypervisor was cabled to a spare switch port, confirmed by a live ping test and the switch's wired-client table.
  3. A new bridge with that NIC as its only member and no IP of its own, and a second interface on the sensor container attached to it, unaddressed and promiscuous.
  4. The mirror applied through the controller's REST API, source the uplink port to the firewall, destination the tap port.

Every layer reported success. The switch returned 200 and showed the override provisioned.

The test that failed

We pinged an external address from a host that routes through the firewall and ran tcpdump on the sensor's interface for that address. Zero packets. Yet ARP and spanning-tree frames did arrive, which looked like partial progress rather than a clean failure and cost real time.

Bisecting

  • The switch. Sampling byte counters on all ports during traffic showed the mirror destination's transmit counter climbing in step with the uplink's, while its receive counter stayed frozen: the signature of a working SPAN port.
  • The NIC and cable. A capture on the hypervisor's physical NIC, bypassing the bridge, showed substantial real traffic arriving.
  • The bridge. The bridge's forwarding database held more than fifteen dynamically learned MAC addresses, all on the tap NIC. Because the mirror is the only real traffic source on that two-port bridge, the bridge had learned that essentially every host lives behind it. A learning bridge will not forward a frame out of a port other than the one it believes the destination is on, so unicast died at the NIC. Broadcast and multicast skip that lookup and always flood, which is exactly why those frames got through.

The fix

Turn off MAC learning on the tap NIC's bridge port, so every destination stays unknown and every frame floods to the sensor. It was made persistent with a post-up line in the bridge's interface file, and we confirmed it survived an interface reload rather than only a live change.

Verification

After the change, tcpdump captured 8 of 8 echo request and reply pairs matching a concurrent ping. Suricata's capture interface showed the right device with decoder counters climbing, and Zeek's connection log held the matching entries for the ping and a test web request.

Takeaway

When a tap or mirror partially works, ask what in the path is trying to be smart. A bridge's job is to avoid sending frames where it thinks they do not belong, which is the opposite of what a monitoring feed needs.

Follow the build on LinkedIn or by RSS.

All Articles

Follow the build

Questions about the build, or spotted something we got wrong? Find us on LinkedIn and GitHub.