On a Layer 2 network shown in Figure 1, multicast sources Source1 and Source2 send multicast data to multicast groups 224.1.1.1 and 225.1.1.1. HostA and HostC expect to receive data of group 224.1.1.1 for a long time, whereas HostB and HostD expect to receive data of group 225.1.1.1 for a long time. All the hosts run IGMPv2.
To meet the preceding requirements, enable IGMP snooping on the four switches and configure an IGMP snooping querier. Enable all the switches to discard unknown multicast packets. In this way, the switches will not broadcast multicast data in a VLAN when they have no matching Layer 2 multicast forwarding entries. The configuration roadmap is as follows:
# Configure SwitchA. The configurations of SwitchB, SwitchC and SwitchD are similar to the configuration of SwitchA, and are not provided here.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan 10 [SwitchA-vlan10] quit [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type hybrid [SwitchA-GigabitEthernet0/0/1] port hybrid pvid vlan 10 [SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 10 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type hybrid [SwitchA-GigabitEthernet0/0/2] port hybrid pvid vlan 10 [SwitchA-GigabitEthernet0/0/2] port hybrid untagged vlan 10 [SwitchA-GigabitEthernet0/0/2] quit [SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] port link-type hybrid [SwitchA-GigabitEthernet0/0/3] port hybrid pvid vlan 10 [SwitchA-GigabitEthernet0/0/3] port hybrid untagged vlan 10 [SwitchA-GigabitEthernet0/0/3] quit
# Configure SwitchA. The configurations of SwitchB, SwitchC and SwitchD are similar to the configuration of SwitchA, and are not provided here.
[SwitchA] igmp-snooping enable [SwitchA] vlan 10 [SwitchA-vlan10] igmp-snooping enable [SwitchA-vlan10] quit
[SwitchA] vlan 10 [SwitchA-vlan10] igmp-snooping querier enable [SwitchA-vlan10] quit
# Configure SwitchA. The configurations of SwitchB, SwitchC and SwitchD are similar to the configuration of SwitchA, and are not provided here.
[SwitchA] vlan 10 [SwitchA-vlan10] multicast drop-unknown [SwitchA-vlan10] quit
# When the IGMP snooping querier begins to work, all the switches except the IGMP snooping querier receive IGMP General Query messages. Run the display igmp-snooping statistics vlan 10 command on SwitchB to view IGMP message statistics. The command output is as follows:
[SwitchB] display igmp-snooping statistics vlan 10
IGMP Snooping Packets Counter
Statistics for VLAN 10
Recv V1 Report 0
Recv V2 Report 32
Recv V3 Report 0
Recv V1 Query 0
Recv V2 Query 30
Recv V3 Query 0
Recv Leave 0
Recv Pim Hello 0
Send Query(S=0) 0
Send Query(S!=0) 0
Suppress Report 0
Suppress Leave 0
Proxy Send General Query 0
Proxy Send Group-Specific Query 0
Proxy Send Group-Source-Specific Query 0
SwitchA configuration file
# sysname SwitchA # vlan batch 10 # igmp-snooping enable # vlan 10 multicast drop-unknown igmp-snooping enable igmp-snooping querier enable # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/3 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # return
SwitchB configuration file
# sysname SwitchB # vlan batch 10 # igmp-snooping enable # vlan 10 multicast drop-unknown igmp-snooping enable # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/3 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/4 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # return
SwitchC configuration file
# sysname SwitchC # vlan batch 10 # igmp-snooping enable # vlan 10 multicast drop-unknown igmp-snooping enable # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/3 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # return
SwitchD configuration file
# sysname SwitchD # vlan batch 10 # igmp-snooping enable # vlan 10 multicast drop-unknown igmp-snooping enable # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # return