As shown in Figure 1, the router connects to user hosts through a Layer 2 switch. The user-side VLANIF interface of the router is bound to static groups 225.1.1.1-225.1.1.5 and does not run IGMP. HostA and HostB expect to receive data of multicast groups 225.1.1.1-225.1.1.3 for a long time. HostC and HostD expect to receive data of multicast groups 225.1.1.4 and 225.1.1.5.
To meet the preceding requirements, configure a static router port and static member ports of IGMP snooping on the Layer 2 switch. The configuration roadmap is as follows:
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] vlan 10 [Switch-vlan10] quit [Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] port link-type hybrid [Switch-GigabitEthernet0/0/1] port hybrid pvid vlan 10 [Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 10 [Switch-GigabitEthernet0/0/1] quit [Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] port link-type hybrid [Switch-GigabitEthernet0/0/2] port hybrid pvid vlan 10 [Switch-GigabitEthernet0/0/2] port hybrid untagged vlan 10 [Switch-GigabitEthernet0/0/2] quit [Switch] interface gigabitethernet 0/0/3 [Switch-GigabitEthernet0/0/3] port link-type hybrid [Switch-GigabitEthernet0/0/3] port hybrid pvid vlan 10 [Switch-GigabitEthernet0/0/3] port hybrid untagged vlan 10 [Switch-GigabitEthernet0/0/3] quit
# Enable IGMP snooping globally.
[Switch] igmp-snooping enable
# Enable IGMP snooping in VLAN 10.
[Switch] vlan 10 [Switch-vlan10] igmp-snooping enable [Switch-vlan10] quit
[Switch] interface gigabitethernet 0/0/3 [Switch-GigabitEthernet0/0/3] igmp-snooping static-router-port vlan 10 [Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] l2-multicast static-group group-address 225.1.1.1 to 225.1.1.3 vlan 10 [Switch-GigabitEthernet0/0/1] quit [Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] l2-multicast static-group group-address 225.1.1.4 to 225.1.1.5 vlan 10 [Switch-GigabitEthernet0/0/2] quit
# Check the router port information on the switch.
[Switch] display igmp-snooping router-port vlan 10 Port Name UpTime Expires Flags --------------------------------------------------------------------- VLAN 10, 1 router-port(s) GE0/0/3 00:20:09 -- STATIC
The command output shows that GE0/0/3 has been configured as a static router port.
# Check the member port information on the switch.
[Switch] display igmp-snooping port-info vlan 10 -------------------------------------------------------------------------------- (Source, Group) Port Flag Flag: S:Static D:Dynamic M: Ssm-mapping -------------------------------------------------------------------------------- VLAN 10, 5 Entry(s) (*, 225.1.1.1) GE0/0/1 S-- 1 port(s) (*, 225.1.1.2) GE0/0/1 S-- 1 port(s) (*, 225.1.1.3) GE0/0/1 S-- 1 port(s) (*, 225.1.1.4) GE0/0/2 S-- 1 port(s) (*, 225.1.1.5) GE0/0/2 S-- 1 port(s) --------------------------------------------------------------------------------
The command output shows that multicast groups 225.1.1.1-225.1.1.3 have a static member port GE0/0/1, and multicast groups 225.1.1.4 and 225.1.1.5 have a static member port GE0/0/2.
# Check the Layer 2 multicast forwarding table on the switch.
[Switch] display l2-multicast forwarding-table vlan 10 VLAN ID : 10, Forwarding Mode : IP -------------------------------------------------------------------------------- (Source, Group) Interface Out-Vlan -------------------------------------------------------------------------------- Router-port GigabitEthernet0/0/3 10 (*, 225.1.1.1) GigabitEthernet0/0/1 10 GigabitEthernet0/0/3 10 (*, 225.1.1.2) GigabitEthernet0/0/1 10 GigabitEthernet0/0/3 10 (*, 225.1.1.3) GigabitEthernet0/0/1 10 GigabitEthernet0/0/3 10 (*, 225.1.1.4) GigabitEthernet0/0/2 10 GigabitEthernet0/0/3 10 (*, 225.1.1.5) GigabitEthernet0/0/2 10 GigabitEthernet0/0/3 10 -------------------------------------------------------------------------------- Total Group(s) : 5
The command output shows that multicast groups 225.1.1.1-225.1.1.5 have forwarding entries on the switch.
Switch configuration file
# sysname Switch # vlan batch 10 # igmp-snooping enable # vlan 10 igmp-snooping enable # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 l2-multicast static-group group-address 225.1.1.1 to 225.1.1.3 vlan 10 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 l2-multicast static-group group-address 225.1.1.4 to 225.1.1.5 vlan 10 # interface GigabitEthernet0/0/3 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 igmp-snooping static-router-port vlan 10 # return