IGMP Snooping Querier Election: Configuration Guide - 夜莺博客

IGMP Snooping Querier Election: Configuration Guide

In a Layer 2 VLAN with no multicast router attached, nothing sends IGMP general queries, so switches never learn which ports have interested receivers and multicast traffic gets flooded everywhere — or, worse, aged out of the group table and dropped. The IGMP snooping querier solves this by having a switch act as the query source. The catch is election: if more than one switch in the VLAN is configured as a querier, or if a real multicast router appears later, the election rules decide who wins, and a misconfigured contender can cause periodic group-table churn. This guide covers the configuration, the addressing requirements, and how to verify who is actually querying.

Why a Snooping Querier Exists

IGMP snooping works by listening to IGMP messages between hosts and a router. The router's job is to send periodic general queries; when hosts answer, the switch populates its group table and can then forward multicast only toward ports that asked for it. Remove the router from the VLAN — which is exactly what happens in a Layer 2 access design where the multicast source and receivers sit in the same VLAN — and the whole mechanism loses its driver.

A snooping querier takes over that role without requiring a multicast routing protocol on the switch. Because it only sends queries, it does not need PIM, and it never joins the group itself. It is the lightweight answer for a closed Layer 2 domain.

The Addressing Requirement

Source address selection order

The querier needs an IP address to use as the source of its queries, and this is where most configurations fail. The order of preference is:

  1. The IP address of the VLAN SVI.
  2. A globally configured querier IP address.
  3. Another SVI address on the switch.
  4. The first available IP address on the device.

If none of those exists, the querier does not generate any general queries at all, and it fails silently. Always configure an address on the VLAN so behaviour is deterministic rather than dependent on whatever other interface happens to be numbered.

Step 1 - Enable IGMP Snooping and the Querier

IGMP snooping is enabled globally and per VLAN by default on Cisco platforms, so the querier is the only thing you normally need to add:

Switch(config)# ip igmp snooping
Switch(config)# vlan configuration 100
Switch(config-vlan-config)# ip igmp snooping
Switch(config-vlan-config)# ip igmp snooping querier 10.10.100.1
Switch(config-vlan-config)# ip igmp snooping querier-timeout 255
Switch(config-vlan-config)# exit

On a Catalyst in interface configuration mode, the equivalent uses the VLAN interface as the address source:

Switch(config)# ip igmp snooping
Switch(config)# interface Vlan100
Switch(config-if)# ip address 10.10.100.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# ip igmp snooping querier

The explicitly configured querier address and the querier-versus-SVI relationship is what determines election behaviour, so decide deliberately whether the querier should use the SVI address or a dedicated address.

Step 2 - Understand the Election

Who wins the election

Election follows RFC 2236 rules: when an IGMPv2 device starts, it sends a general query to 224.0.0.1 with its interface address as the source. Every device that receives that query compares the source address with its own, and the device with the lowest IP address on the subnet is elected querier.

Two consequences matter in practice:

  • Other devices start a query timer, reset on every general query received. If the timer expires, a new election runs. This is how the VLAN recovers when the querier is reloaded.
  • If a real multicast router appears in the VLAN, the snooping querier steps down to a non-querier state rather than competing with it. The router is authoritative.

Because the lowest address wins, a switch left with a low SVI address will take over as querier the moment the intended querier disappears. If you want a specific switch to be the querier, give it the lowest address in the subnet — otherwise the role will move, and your monitoring will start reporting a different source.

Where the platform supports it, the election can be disabled. With election disabled, the switch delays sending general queries for 60 seconds after the feature is enabled, and stops querying if another querier is detected — but during the delay it may not query at all:

Switch(config)# vlan configuration 100
Switch(config-vlan-config)# no ip igmp snooping querier election
Switch(config-vlan-config)# ip igmp snooping querier version 2

Version 2 is the normal choice; the querier supports IGMPv1 and v2, and version 3 should only be set when all receivers are IGMPv3.

Step 3 - Tune the Timeouts

Query and timeout tuning

The querier timeout controls how long the switch waits before assuming the current querier is gone. The default is 255 seconds; doubling the query interval of 60 seconds is the standard guidance because it tolerates one missed query without triggering a re-election.

Switch(config-vlan-config)# ip igmp snooping querier-timeout 255
Switch(config)# ip igmp snooping last-member-query-interval 1000

Lowering the last-member-query-interval shortens leave latency when receivers stop listening, which matters for IPTV-style workloads where channel changes must be fast.

Verification

Switch# show ip igmp snooping
Switch# show ip igmp snooping querier
Switch# show ip igmp snooping querier vlan 100
Switch# show ip igmp snooping groups
Switch# show ip igmp snooping groups vlan 100
Switch# show ip igmp snooping mrouter
Switch# show ip igmp snooping interface

Read show ip igmp snooping querier first: it must show the querier state as running for the VLAN, with the address you expect. If it shows "is not running", the switch could not find a usable source address — configure an SVI address and check again.

Then check the group table. Entries appearing with the correct member ports prove that queries are being sent and reports are being snooped. If the querier is running but the group table is empty while receivers are active, look for a member that never answers: IGMP report suppression is enabled by default, so only the first host's report reaches the switch — that is expected, but it means a single host failing to report can hide others.

Finally, confirm there is no multicast router in the VLAN that would make all of this redundant:

Switch# show ip igmp snooping mrouter

Operational Notes

  • Always configure an SVI address on the VLAN; without a usable source address the querier stays silent.
  • Lowest IP address wins the election — plan addresses rather than letting the role float.
  • A querier that detects a multicast router steps down automatically; no manual intervention is needed for that transition.
  • Leave report suppression enabled to keep the control plane quiet, but remember it hides duplicate reports.
  • Cap the querier to VLANs with sources and receivers and no router — enabling it everywhere adds traffic with no benefit.

Related reading: our IGMP snooping configuration guide, the PIM sparse mode RP and RPF verification article, and the MSDP anycast RP multicast configuration guide.

原文链接:https://www.cisco.com/c/en/us/td/docs/dcn/nx-os/nexus9000/103x/configuration/multicast/cisco-nexus-9000-series-nx-os-multicast-routing-configuration-guide-release-103x/m_configuring_igmp_snooping_9x.html