< Home

l2-multicast forwarding-mode

Function

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.

Format

l2-multicast forwarding-mode { ip | mac }

undo l2-multicast forwarding-mode mac

Parameters

Parameter Description Value
ip

Forwards multicast data based on IP addresses.

-
mac

Forwards multicast data based on MAC addresses.

-

Views

VLAN view

Default Level

2: Configuration level

Usage Guidelines

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

This command can only be used in VLANs with Layer 2 multicast snooping disabled. After running this command in a VLAN, enable Layer 2 multicast snooping in the VLAN for the configuration to take effect.
  • On an IPv4 network, run the igmp-snooping enable (VLAN view) command to enable IGMP snooping in the VLAN.
  • On an IPv6 network, run the mld-snooping enable command to enable MLD snooping in the VLAN.

Example

# 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >