Example: Configuring VLAN-based IGMP snooping group polices and simulated joining
Network configuration
As shown in Figure 14, Router A runs IGMPv2 and acts as the IGMP querier. Switch A runs IGMPv2 snooping.
Configure a multicast group policy and simulated joining to meet the following requirements:
Host A and Host B receive only the multicast data addressed to multicast group 224.1.1.1. Multicast data can be forwarded through HundredGigE 1/0/3 and HundredGigE 1/0/4 of Switch A uninterruptedly, even though Host A and Host B fail to receive the multicast data.
Switch A will drop unknown multicast data instead of flooding it in VLAN 100.
Figure 14: Network diagram
Procedure
Assign an IP address and subnet mask to each interface, as shown in Figure 14. (Details not shown.)
Configure Router A:
# Enable IP multicast routing.
<RouterA> system-view [RouterA] multicast routing [RouterA-mrib] quit
# Enable IGMP on HundredGigE 1/0/1.
[RouterA] interface hundredgige 1/0/1 [RouterA-HundredGigE1/0/1] igmp enable [RouterA-HundredGigE1/0/1] quit
# Enable PIM-DM on HundredGigE 1/0/2.
[RouterA] interface hundredgige 1/0/2 [RouterA-HundredGigE1/0/2] pim dm [RouterA-HundredGigE1/0/2] quit
Configure Switch A:
# Enable the IGMP snooping feature.
<SwitchA> system-view [SwitchA] igmp-snooping [SwitchA-igmp-snooping] quit
# Create VLAN 100, and assign HundredGigE 1/0/1 through HundredGigE 1/0/4 to the VLAN.
[SwitchA] vlan 100 [SwitchA-vlan100] port hundredgige 1/0/1 to hundredgige 1/0/4
# Enable IGMP snooping, and enable dropping unknown multicast data for VLAN 100.
[SwitchA-vlan100] igmp-snooping enable [SwitchA-vlan100] igmp-snooping drop-unknown [SwitchA-vlan100] quit
# Configure a multicast group policy so that hosts in VLAN 100 can join only multicast group 224.1.1.1.
[SwitchA] acl basic 2001 [SwitchA-acl-ipv4-basic-2001] rule permit source 224.1.1.1 0 [SwitchA-acl-ipv4-basic-2001] quit [SwitchA] igmp-snooping [SwitchA-igmp-snooping] group-policy 2001 vlan 100 [SwitchA-igmp-snooping] quit
# Configure HundredGigE 1/0/3 and HundredGigE 1/0/4 as simulated member hosts of multicast group 224.1.1.1.
[SwitchA] interface hundredgige 1/0/3 [SwitchA-HundredGigE1/0/3] igmp-snooping host-join 224.1.1.1 vlan 100 [SwitchA-HundredGigE1/0/3] quit [SwitchA] interface hundredgige 1/0/4 [SwitchA-HundredGigE1/0/4] igmp-snooping host-join 224.1.1.1 vlan 100 [SwitchA-HundredGigE1/0/4] quit
Verifying the configuration
# Send IGMP reports from Host A and Host B to join multicast groups 224.1.1.1 and 224.2.2.2. (Details not shown.)
# Display dynamic IGMP snooping group entries for VLAN 100 on Switch A.
[SwitchA] display igmp-snooping group vlan 100 Total 1 entries. VLAN 100: Total 1 entries. (0.0.0.0, 224.1.1.1) Host ports (2 in total): HGE1/0/3 (00:03:23) HGE1/0/4 (00:04:10)
The output shows the following information:
Host A and Host B have joined multicast group 224.1.1.1 through the member ports HundredGigE 1/0/4 and HundredGigE 1/0/3 on Switch A, respectively.
Host A and Host B have failed to join multicast group 224.2.2.2.