In Figure 1, GE0/0/1 on SwitchA is connected to the Router. GE0/0/2 provides services for ISP1, and GE0/0/3 provides services for ISP2. ISP1 and ISP2 use multicast VLAN 2 and VLAN 3 respectively to provide multicast services for users. GE0/0/2 and GE0/0/3 have the same user VLAN (VLAN 10).
To ensure that multicast packets of each ISP are sent only to users of the ISP, interface-based multicast VLAN replication is required. After the configuration is complete, multicast data of an ISP will be sent only to the interface connected to the ISP.
The configuration roadmap is as follows:
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 10
[SwitchA] igmp-snooping enable [SwitchA] vlan 2 [SwitchA-vlan2] igmp-snooping enable [SwitchA-vlan2] igmp-snooping querier enable [SwitchA-vlan2] quit [SwitchA] vlan 3 [SwitchA-vlan3] igmp-snooping enable [SwitchA-vlan3] igmp-snooping querier enable [SwitchA-vlan3] quit
[SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] l2-multicast-bind vlan 10 mvlan 2 [SwitchA-GigabitEthernet0/0/2] quit [SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] l2-multicast-bind vlan 10 mvlan 3 [SwitchA-GigabitEthernet0/0/3] quit
# Add GE0/0/1 to multicast VLANs 2 and 3 as a trunk interface.
[SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type trunk [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 3 [SwitchA-GigabitEthernet0/0/1] quit
# Add GE0/0/2 and GE0/0/3 respectively to user VLAN 10 as hybrid interfaces.
[SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type hybrid [SwitchA-GigabitEthernet0/0/2] port hybrid pvid vlan 10 [SwitchA-GigabitEthernet0/0/2] port hybrid untagged vlan 10 [SwitchA-GigabitEthernet0/0/2] quit [SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] port link-type hybrid [SwitchA-GigabitEthernet0/0/3] port hybrid pvid vlan 10 [SwitchA-GigabitEthernet0/0/3] port hybrid untagged vlan 10 [SwitchA-GigabitEthernet0/0/3] quit
Run the display l2-multicast-bind command on SwitchA to view binding between the user VLAN and multicast VLANs.
[SwitchA] display l2-multicast-bind ------------------------------------------------------------------- Port Startvlan Endvlan Mvlan ------------------------------------------------------------------- GigabitEthernet0/0/2 10 -- 2 GigabitEthernet0/0/3 10 -- 3 ------------------------------------------------------------------- Total Table(s) : 2
SwitchA configuration file
# sysname SwitchA # vlan batch 2 to 3 10 # igmp-snooping enable # vlan 2 igmp-snooping enable igmp-snooping querier enable vlan 3 igmp-snooping enable igmp-snooping querier enable # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 2 to 3 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 l2-multicast-bind vlan 10 mvlan 2 # interface GigabitEthernet0/0/3 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 l2-multicast-bind vlan 10 mvlan 3 # return