Example for Configuring MLD Snooping
Networking Requirements
In Figure 10-5, RouterA connects to the user network through RouterB on an IPv6 network. When the multicast source sends data to multicast group FF16::1 to FF16::5, HostA, HostB, and HostC on the network only want to receive date of multicast groups FF16::1 to FF16::3.
Configuration Roadmap
To meet the requirement, basic MLD snooping functions and multicast group policy need to be configured on the Layer 2 device. The configuration roadmap is as follows:
- Create a VLAN on the RouterB and add the interface to the VLAN.
- Enable MLD snooping globally and in a VLAN.
- Configure a multicast group policy in a VLAN.
Procedure
- Create a VLAN and add interfaces to the VLAN.
<Huawei> system-view [Huawei] sysname RouterB [RouterB] vlan 10 [RouterB-vlan10] quit [RouterB] interface ethernet 2/0/1 [RouterB-Ethernet2/0/1] port hybrid pvid vlan 10 [RouterB-Ethernet2/0/1] port hybrid untagged vlan 10 [RouterB-Ethernet2/0/1] quit [RouterB] interface ethernet 2/0/2 [RouterB-Ethernet2/0/2] port hybrid pvid vlan 10 [RouterB-Ethernet2/0/2] port hybrid untagged vlan 10 [RouterB-Ethernet2/0/2] quit [RouterB] interface ethernet 2/0/3 [RouterB-Ethernet2/0/3] port hybrid pvid vlan 10 [RouterB-Ethernet2/0/3] port hybrid untagged vlan 10 [RouterB-Ethernet2/0/3] quit
- Enable MLD snooping.
# Enable MLD snooping globally.
[RouterB] mld-snooping enable
# Enable MLD snooping in VLAN 10.
[RouterB] vlan 10 [RouterB-vlan10] mld-snooping enable [RouterB-vlan10] quit
- Configure and apply a multicast group policy.
# Configure a multicast group policy.
[RouterB] acl ipv6 2000 [RouterB-acl6-basic-2000] rule deny source ff16::4 128 [RouterB-acl6-basic-2000] rule deny source ff16::5 128 [RouterB-acl6-basic-2000] quit
# Apply the multicast policy in VLAN 10.
[RouterB] vlan 10 [RouterB-vlan10] mld-snooping group-policy 2000 [RouterB-vlan10] quit
- Verify the configuration.
# Check the member interface on the RouterB.
[RouterB] display mld-snooping port-info vlan 10 ----------------------------------------------------------------------- (Source, Group) Port Flag Flag: S:Static D:Dynamic M: Ssm-mapping ----------------------------------------------------------------------- VLAN 10, 3 Entry(s) ( *, ff16:0:0:0:0:0:0:1)Ethernet2/0/1 -D- Ethernet2/0/2 -D- 2 port(s) ( *, ff16:0:0:0:0:0:0:2)Ethernet2/0/1 -D- Ethernet2/0/2 -D- 2 port(s) ( *, ff16:0:0:0:0:0:0:3)Ethernet2/0/1 -D- Ethernet2/0/2 -D- 2 port(s) -----------------------------------------------------------------------
The command output shows that Eth2/0/1 and Eth2/0/2 on the RouterB have joined the group FF16::1 to FF16::3.
Configuration Files
RouterB configuration file
# sysname RouterB # vlan batch 10 # mld-snooping enable # acl ipv6 number 2000 rule 0 deny source ff16::4/128 rule 1 deny source ff16::5/128 # vlan 10 mld-snooping enable mld-snooping group-policy 2000 # interface Ethernet2/0/1 port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface Ethernet2/0/2 port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface Ethernet2/0/3 port hybrid pvid vlan 10 port hybrid untagged vlan 10 # return