The l2-multicast forwarding-mode command configures the forwarding mode of multicast data in a VLAN.
The undo l2-multicast forwarding-mode command restores the default forwarding mode of multicast data.
By default, multicast data is forwarded in a VLAN based on IP addresses.
Parameter | Description | Value |
---|---|---|
ip | Forwards multicast data based on IP addresses. |
- |
mac | Forwards multicast data based on MAC addresses. |
- |
Usage Scenario
After Layer 2 multicast is enabled on a Layer 2 device, the Layer 2 device maintains a Layer 2 multicast forwarding table. When receiving a multicast packet, the Layer 2 device searches the Layer 2 multicast forwarding table for the outbound interface based on the multicast address of the packet. The Layer 2 device determines the outbound interface based on the IP multicast address or IP multicast MAC address, depending on the configured Layer 2 multicast forwarding mode.
Multiple multicast IP addresses may be mapped to one MAC address. If multicast data is forwarded based on MAC addresses, multicast data may be sent to the users who do not require the multicast data. To prevent this problem, use the IP address-based forwarding mode on devices with Layer 3 functions.
Configuration Impact
To set the IGMP snooping version to IGMPv3 or the MLD snooping version to MLDv2, do not change the default forwarding mode using this command.
After the multicast data forwarding mode is set to MAC address-based forwarding in a VLAN using this command, the VLAN cannot be configured as a multicast VLAN.
Precautions
# After IGMP snooping is enabled globally, configure the switch to forward multicast data in VLAN 100 based on MAC addresses.
<HUAWEI> system-view [HUAWEI] igmp-snooping enable [HUAWEI] vlan 100 [HUAWEI-vlan100] l2-multicast forwarding-mode mac [HUAWEI-vlan100] igmp-snooping enable
# After MLD snooping is enabled globally, configure the switch to forward multicast data in VLAN 100 based on MAC addresses.
<HUAWEI> system-view [HUAWEI] mld-snooping enable [HUAWEI] vlan 100 [HUAWEI-vlan100] l2-multicast forwarding-mode mac [HUAWEI-vlan100] mld-snooping enable