Example for Configuring IGMP Snooping
Networking Requirements
As shown in Figure 9-6, RouterA connects to user hosts through a Layer 2 device RouterB and RouterA runs IGMPv2. The multicast source sends data to multicast groups 225.1.1.1 to 225.1.1.5. On the network, there are three receivers HostA, HostB, and HostC and the three hosts only want to receive data of multicast groups 225.1.1.1 to 225.1.1.3.
Configuration Roadmap
To meet the preceding requirements, configure basic IGMP snooping functions and a multicast group policy on the Layer 2 RouterB. The configuration roadmap is as follows:
- On RouterB, create a VLAN and add interfaces to the VLAN.
- Enable IGMP snooping globally and in the VLAN.
- Configure a multicast group policy and apply this policy to the 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 IGMP snooping.
# Enable IGMP snooping globally.
[RouterB] igmp-snooping enable
# Enable IGMP snooping in VLAN 10.
[RouterB] vlan 10 [RouterB-vlan10] igmp-snooping enable [RouterB-vlan10] quit
- Configure a multicast group policy and apply this policy.
# Configure a multicast group policy.
[RouterB] acl 2000 [RouterB-acl-basic-2000] rule deny source 225.1.1.4 0 [RouterB-acl-basic-2000] rule deny source 225.1.1.5 0 [RouterB-acl-basic-2000] quit
# Apply the multicast group policy in VLAN 10.
[RouterB] vlan 10 [RouterB-vlan10] igmp-snooping group-policy 2000 [RouterB-vlan10] quit
- Verify the configuration.
# Check the interface information on RouterB.
<RouterB> display igmp-snooping port-info vlan 10 ----------------------------------------------------------------------- (Source, Group) Port Flag ----------------------------------------------------------------------- VLAN 10, 3 Entry(s) (*, 225.1.1.1) Ethernet2/0/1 -D- Ethernet2/0/2 -D- 2 port(s) (*, 225.1.1.2) Ethernet2/0/1 -D- Ethernet2/0/2 -D- 2 port(s) (*, 225.1.1.3) Ethernet2/0/1 -D- Ethernet2/0/2 -D- 2 port(s) -----------------------------------------------------------------------
The command output shows that multicast groups 225.1.1.1 to 225.1.1.3 have dynamically generated member ports Eth2/0/1 and Eth2/0/2 on RouterB.
# Check the Layer 2 multicast forwarding table on RouterB.
<RouterB> display l2-multicast forwarding-table vlan 10 VLAN ID : 10, Forwarding Mode : IP ------------------------------------------------------------------------ (Source, Group) Interface Out-Vlan ------------------------------------------------------------------------ Router-port Ethernet2/0/3 10 (*, 225.1.1.1) Ethernet2/0/3 10 Ethernet2/0/1 10 Ethernet2/0/2 10 (*, 225.1.1.2) Ethernet2/0/3 10 Ethernet2/0/1 10 Ethernet2/0/2 10 (*, 225.1.1.3) Ethernet2/0/3 10 Ethernet2/0/1 10 Ethernet2/0/2 10 Total Group(s) : 3 ----------------------------------------------------------------------
The command output shows that the forwarding table contains only information about multicast groups 225.1.1.1 to 225.1.1.3. The multicast groups 225.1.1.4 to 225.1.1.5 do not forward data to the hosts.
Configuration Files
RouterB configuration file
# sysname RouterB # vlan batch 10 # igmp-snooping enable # acl number 2000 rule 5 deny source 225.1.1.4 0 rule 10 deny source 225.1.1.5 0 # vlan 10 igmp-snooping enable igmp-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