Skip to content

IGMP snooping on Linux bridges: stopping multicast flood at L2

How IGMP snooping on the Linux bridge prevents multicast from flooding every port, the querier role, and the sysctls and bridge commands that control it in production.

A Linux bridge with multicast snooping disabled treats multicast frames like broadcast — every port gets every frame. On a small lab that costs nothing; on a busy bridge with a high-rate video feed, it puts entire LANs into the dirt. IGMP snooping fixes this by watching IGMP joins and leaves on the wire and learning which ports actually want each group. The Linux bridge has supported snooping since 2.6.31 and enables it by default, but several conditions can silently disable it — including the absence of a querier on the segment. This article walks through the model, the commands to inspect the MDB, and the production gotchas.

How to verify

Inspect snooping state and the multicast database:

brctl showstp br0 | grep -i multicast
cat /sys/class/net/br0/bridge/multicast_snooping
cat /sys/class/net/br0/bridge/multicast_querier
bridge -d link show
bridge mdb show
bridge mdb show dev br0
tcpdump -ni br0 'igmp or (ip6 and icmp6 type 130-132)'

bridge mdb show prints the multicast database — one entry per (port, group) the bridge has learned. Empty after a join means the join did not reach the bridge, or snooping was disabled when it arrived.

What’s happening

When IGMP snooping is enabled, the bridge inspects every multicast control frame (IGMPv2/v3 Reports and Leaves, and IPv6 MLD equivalents) passing through it. From those frames the bridge builds the multicast database (MDB), keyed on (port, group). For unicast multicast traffic (one source, many receivers) the bridge then forwards each frame only to ports whose MDB indicates interest.

Three actors:

  • Hosts send IGMP Membership Report messages when they want a group; periodic re-reports refresh state.
  • Querier sends IGMP Membership Query messages at a regular interval (default 125 seconds). Hosts respond to queries with Reports, which is how the bridge keeps its MDB fresh.
  • Snooping bridge listens to the conversation and prunes accordingly.

The querier is essential. Without a querier on the segment, hosts may report once when joining but never again, and the bridge’s MDB entries time out. The result is multicast traffic to a group with active receivers stops being delivered. Linux’s bridge can act as the querier itself by setting multicast_querier=1.

Three failure modes show up repeatedly:

  • No querier on the segment — MDB entries expire, traffic stops
  • Snooping disabled when bridge is created on top of WiFi/wireless — some drivers refuse to support multicast on those segments and disable snooping silently
  • IGMP version mismatch — older IGMPv1/v2 hosts ignore IGMPv3-only queriers, so they never re-report

The procedure

  1. Confirm snooping is enabled and configure the bridge to act as querier. On the bridge device:

    # Check
    cat /sys/class/net/br0/bridge/multicast_snooping
    cat /sys/class/net/br0/bridge/multicast_querier
    
    # Enable snooping (default 1, but verify)
    echo 1 > /sys/class/net/br0/bridge/multicast_snooping
    
    # Make this bridge the querier
    echo 1 > /sys/class/net/br0/bridge/multicast_querier

    Or via ip:

    ip link set br0 type bridge mcast_snooping 1 mcast_querier 1
  2. Persist via systemd-networkd or ip-link in a startup script. systemd-networkd:

    # /etc/systemd/network/10-br0.netdev
    [NetDev]
    Name=br0
    Kind=bridge
    
    [Bridge]
    MulticastSnooping=yes
    MulticastQuerier=yes
    MulticastIGMPVersion=3
  3. Tune query intervals if defaults are too slow. Default query interval is 12500 (in 1/100 seconds, so 125 sec). For a high-churn fabric, drop it:

    echo 6000 > /sys/class/net/br0/bridge/multicast_query_interval

    Be aware: shorter intervals mean more IGMP query traffic. 30 seconds is the lower bound most environments tolerate.

  4. Add a static MDB entry for control traffic that bypasses joins. Some multicast streams (SSDP, mDNS) do not use IGMP at all; you can pin them to specific ports:

    bridge mdb add dev br0 port eth1 grp 239.255.255.250 permanent
  5. Allow IGMP and ICMPv6 through any L3 firewall in the path. Bridges normally skip netfilter unless br_netfilter is loaded, but if it is, your iptables rules apply to bridged traffic and you need explicit ACCEPTs for IGMP/MLD.

  6. Watch the MDB during a flow.

    watch -n2 'bridge mdb show dev br0'

    When a receiver leaves the group, the entry should disappear within the next query cycle.

Operational notes

  • Disable br_netfilter if you do not need it. When loaded, every L2-forwarded frame is processed by netfilter, which is expensive and can also drop multicast unexpectedly if your rules are not multicast-aware.
  • WiFi bridges silently disable snooping in some kernels. If you bridge wlan0 into br0, expect multicast handling to revert to flood — wireless’s per-multicast retransmit semantics already cripple multicast performance.
  • MLD is the IPv6 equivalent and is enabled separately on older kernels. Modern kernels handle MLD via the same snooping path; verify with cat /sys/class/net/br0/bridge/multicast_mld_version.
  • A bridge with only one port that wants a group still receives it. Snooping prunes ports that have no interest; if only one port is interested, traffic still flows there (just not to the rest).
  • OVS (Open vSwitch) has its own snooping path independent of the kernel bridge; if you use OVS, the commands here do not apply — use ovs-vsctl set bridge br0 mcast_snooping_enable=true.

In the engagements we run, the bridge tuning above is part of the standard Layer-2 setup for hypervisors and edge appliances. The combination of mcast_snooping=1, mcast_querier=1, and a 30-second query interval is the baseline; we add static MDB entries for service-discovery groups that should always reach a specific port. The pattern slots into the broader PIM-SM multicast piece we run for L3 multicast across racks, and the bridge tuning lives in the same Ansible role the managed-operations practice maintains.