IGMP snooping querier configuration example (for VLANs)
Network requirements
As shown in Figure 16:
The network is a Layer 2-only network.
Source 1 and Source 2 send multicast data to multicast groups 224.1.1.1 and 225.1.1.1, respectively.
Host A and Host C are receivers of multicast group 224.1.1.1, and Host B and Host D are receivers of multicast group 225.1.1.1.
All host receivers run IGMPv2, and all switches run IGMPv2 snooping. Switch A (which is close to the multicast sources) acts as the IGMP snooping querier.
Configure the switches to meet the following requirements:
To prevent the switches from flooding unknown data in the VLAN, enable all the switches to drop unknown multicast data.
A switch does not mark a port that receives an IGMP query with source IP address 0.0.0.0 as a dynamic router port. This adversely affects the establishment of Layer 2 forwarding entries and multicast traffic forwarding. To avoid this, configure the source IP address of IGMP queries as a non-zero IP address.
Figure 16: Network diagram
Configuration procedure
Configure Switch A:
# Enable the IGMP snooping feature.
<SwitchA> system-view [SwitchA] igmp-snooping [SwitchA-igmp-snooping] quit
# Create VLAN 100, and assign Ten-GigabitEthernet 1/0/1 through Ten-GigabitEthernet 1/0/3 to the VLAN.
[SwitchA] vlan 100 [SwitchA-vlan100] port ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/3
# Enable IGMP snooping, and enable dropping unknown multicast data for VLAN 100.
[SwitchA-vlan100] igmp-snooping enable [SwitchA-vlan100] igmp-snooping drop-unknown
# Configure Switch A as the IGMP snooping querier.
[SwitchA-vlan100] igmp-snooping querier [SwitchA-vlan100] quit
# In VLAN 100, specify 192.168.1.1 as the source IP address of IGMP general queries.
[SwitchA-vlan100] igmp-snooping general-query source-ip 192.168.1.1
# In VLAN 100, specify 192.168.1.1 as the source IP address of IGMP group-specific queries.
[SwitchA-vlan100] igmp-snooping special-query source-ip 192.168.1.1 [SwitchA-vlan100] quit
Configure Switch B:
# Enable the IGMP snooping feature.
<SwitchB> system-view [SwitchB] igmp-snooping [SwitchB-igmp-snooping] quit
# Create VLAN 100, and assign Ten-GigabitEthernet 1/0/1 through Ten-GigabitEthernet 1/0/4 to the VLAN.
[SwitchB] vlan 100 [SwitchB-vlan100] port ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/4
# Enable IGMP snooping, and enable dropping unknown multicast data for VLAN 100.
[SwitchB-vlan100] igmp-snooping enable [SwitchB-vlan100] igmp-snooping drop-unknown [SwitchB-vlan100] quit
Configure Switch C:
# Enable the IGMP snooping feature.
<SwitchC> system-view [SwitchC] igmp-snooping [SwitchC-igmp-snooping] quit
# Create VLAN 100, and assign Ten-GigabitEthernet 1/0/1 through Ten-GigabitEthernet 1/0/3 to the VLAN.
[SwitchC] vlan 100 [SwitchC-vlan100] port ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/3
# Enable IGMP snooping, and enable dropping unknown multicast data for VLAN 100.
[SwitchC-vlan100] igmp-snooping enable [SwitchC-vlan100] igmp-snooping drop-unknown [SwitchC-vlan100] quit
Configure Switch D:
# Enable the IGMP snooping feature.
<SwitchD> system-view [SwitchD] igmp-snooping [SwitchD-igmp-snooping] quit
# Create VLAN 100, and assign Ten-GigabitEthernet 1/0/1 and Ten-GigabitEthernet 1/0/2 to the VLAN.
[SwitchD] vlan 100 [SwitchD-vlan100] port ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/2
# Enable IGMP snooping, and enable dropping unknown multicast data for VLAN 100.
[SwitchD-vlan100] igmp-snooping enable [SwitchD-vlan100] igmp-snooping drop-unknown [SwitchD-vlan100] quit
Verifying the configuration
# Display statistics for IGMP messages and PIMv2 hello messages learned through IGMP snooping on Switch B.
[SwitchB] display igmp-snooping statistics Received IGMP general queries: 3 Received IGMPv1 reports: 0 Received IGMPv2 reports: 12 Received IGMP leaves: 0 Received IGMPv2 specific queries: 0 Sent IGMPv2 specific queries: 0 Received IGMPv3 reports: 0 Received IGMPv3 reports with right and wrong records: 0 Received IGMPv3 specific queries: 0 Received IGMPv3 specific sg queries: 0 Sent IGMPv3 specific queries: 0 Sent IGMPv3 specific sg queries: 0 Received PIMv2 hello: 0 Received error IGMP messages: 0
The output shows that all switches except Switch A can receive the IGMP general queries after Switch A acts as the IGMP snooping querier.