Example: Configuring port-based multicast VLAN
Network configuration
As shown in Figure 26:
Layer 3 device Switch A runs IGMPv2 and acts as the IGMP querier. Layer 2 device Switch B runs IGMPv2 snooping.
The multicast source sends multicast data to multicast group 224.1.1.1. Receivers Host A, Host B, and Host C belong to VLAN 2, VLAN 3, and VLAN 4, respectively.
Configure a port-based multicast VLAN on Switch B to meet the following requirements:
Switch A sends multicast data to Switch B through the multicast VLAN.
Switch B forwards the multicast data to the receivers in different user VLANs.
Figure 26: Network diagram
Procedure
Configure Switch A:
# Enable IP multicast routing.
<SwitchA> system-view [SwitchA] multicast routing [SwitchA-mrib] quit
# Create VLAN 20, and assign HundredGigE 1/0/2 to the VLAN.
[SwitchA] vlan 20 [SwitchA-vlan20] port hundredgige 1/0/2 [SwitchA-vlan20] quit
# Assign an IP address to VLAN-interface 20, and enable PIM-DM on the interface.
[SwitchA] interface vlan-interface 20 [SwitchA-Vlan-interface20] ip address 1.1.1.2 24 [SwitchA-Vlan-interface20] pim dm [SwitchA-Vlan-interface20] quit
# Create VLAN 10, and assign HundredGigE 1/0/1 to the VLAN.
[SwitchA] vlan 10 [SwitchA-vlan10] port hundredgige 1/0/1 [SwitchA-vlan10] quit
# Assign an IP address to VLAN-interface 10, and enable IGMP on the interface.
[SwitchA] interface vlan-interface 10 [SwitchA-Vlan-interface10] ip address 10.110.1.1 24 [SwitchA-Vlan-interface10] igmp enable [SwitchA-Vlan-interface10] quit
Configure Switch B:
# Enable the IGMP snooping feature.
<SwitchB> system-view [SwitchB] igmp-snooping [SwitchB-igmp-snooping] quit
# Create VLAN 10, assign HundredGigE 1/0/1 to the VLAN, and enable IGMP snooping for the VLAN.
[SwitchB] vlan 10 [SwitchB-vlan10] port hundredgige 1/0/1 [SwitchB-vlan10] igmp-snooping enable [SwitchB-vlan10] quit
# Create VLAN 2, and enable IGMP snooping for the VLAN.
[SwitchB] vlan 2 [SwitchB-vlan2] igmp-snooping enable [SwitchB-vlan2] quit
# Create VLAN 3, and enable IGMP snooping for the VLAN.
[SwitchB] vlan 3 [SwitchB-vlan3] igmp-snooping enable [SwitchB-vlan3] quit
# Create VLAN 4, and enable IGMP snooping for the VLAN.
[SwitchB] vlan 4 [SwitchB-vlan4] igmp-snooping enable [SwitchB-vlan4] quit
# Configure HundredGigE 1/0/2 as a hybrid port, and configure VLAN 2 as the PVID of the hybrid port.
[SwitchB] interface hundredgige 1/0/2 [SwitchB-HundredGigE1/0/2] port link-type hybrid [SwitchB-HundredGigE1/0/2] port hybrid pvid vlan 2
# Assign HundredGigE 1/0/2 to VLAN 2 and VLAN 10 as an untagged VLAN member.
[SwitchB-HundredGigE1/0/2] port hybrid vlan 2 untagged [SwitchB-HundredGigE1/0/2] port hybrid vlan 10 untagged [SwitchB-HundredGigE1/0/2] quit
# Configure HundredGigE 1/0/3 as a hybrid port, and configure VLAN 3 as the PVID of the hybrid port.
[SwitchB] interface hundredgige 1/0/3 [SwitchB-HundredGigE1/0/3] port link-type hybrid [SwitchB-HundredGigE1/0/3] port hybrid pvid vlan 3
# Assign HundredGigE 1/0/3 to VLAN 3 and VLAN 10 as an untagged VLAN member.
[SwitchB-HundredGigE1/0/3] port hybrid vlan 3 untagged [SwitchB-HundredGigE1/0/3] port hybrid vlan 10 untagged [SwitchB-HundredGigE1/0/3] quit
# Configure GigabitEthernet 1/0/4 as a hybrid port, and configure VLAN 4 as the PVID of the hybrid port.
[SwitchB] interface hundredgige 1/0/4 [SwitchB-HundredGigE1/0/4] port link-type hybrid [SwitchB-HundredGigE1/0/4] port hybrid pvid vlan 4
# Assign GigabitEthernet 1/0/4 to VLAN 4 and VLAN 10 as an untagged VLAN member.
[SwitchB-HundredGigE1/0/4] port hybrid vlan 4 untagged [SwitchB-HundredGigE1/0/4] port hybrid vlan 10 untagged [SwitchB-HundredGigE1/0/4] quit
# Configure VLAN 10 as a multicast VLAN.
[SwitchB] multicast-vlan 10
# Assign HundredGigE 1/0/2 and HundredGigE 1/0/3 to VLAN 10.
[SwitchB-mvlan-10] port hundredgige 1/0/2 to hundredgige 1/0/3 [SwitchB-mvlan-10] quit
# Assign GigabitEthernet 1/0/4 to VLAN 10.
[SwitchB] interface hundredgige 1/0/4 [SwitchB-HundredGigE1/0/4] port multicast-vlan 10 [SwitchB-HundredGigE1/0/4] quit
Verifying the configuration
# Display information about multicast VLANs on Switch B.
[SwitchB] display multicast-vlan Total 1 multicast VLANs. Multicast VLAN 10: Sub-VLAN list(0 in total): Port list(3 in total): HGE1/0/2 HGE1/0/3 HGE1/0/4
# Display dynamic IGMP snooping forwarding entries on Switch B.
[SwitchB] display igmp-snooping group Total 1 entries. VLAN 10: Total 1 entries. (0.0.0.0, 224.1.1.1) Host slots (0 in total): Host ports (3 in total): HGE1/0/2 (00:03:23) HGE1/0/3 (00:04:07) HGE1/0/4 (00:04:16)
The output shows that IGMP snooping maintains the user ports in the multicast VLAN (VLAN 10). Switch B will forward the multicast data of VLAN 10 through these user ports.