This section provides an example for adding an interface to a multicast group statically.
On the network shown in Figure 1, GE 0/1/1 on DeviceA is connected to a router, and GE 0/1/2 on the DeviceA is connected to a switch. It is required that all the hosts in VLAN 3 should receive the multicast packets from the multicast group 225.0.0.1.
The configuration roadmap is as follows:
Create a VLAN.
Add interfaces to the VLAN.
Add an interface to a multicast group statically.
To complete the configuration, you need the following data:
Multicast group address: 225.0.0.1
ID of the VLAN to which a switch and connected host devices belong: 3
GE 0/1/1 as the interface to a multicast group statically
# Create VLAN 3 on DeviceA.
<DeviceA> system-view [~DeviceA] igmp-snooping enable [*DeviceA] vlan 3 [*DeviceA-vlan3] igmp-snooping enable [*DeviceA-vlan3] commit [~DeviceA-vlan3] quit
# Configure GE 0/1/2 on Device A to allow data frames from VLAN 3 to pass through.
[~DeviceA] interface gigabitethernet 0/1/2 [~DeviceA-GigabitEthernet0/1/2] portswitch [*DeviceA-GigabitEthernet0/1/2] port trunk allow-pass vlan 3 [*DeviceA-GigabitEthernet0/1/2] commit [~DeviceA-GigabitEthernet0/1/2] quit
# Configure GE 0/1/1 on Device A to allow data frames from VLAN 3 to pass through.
[~DeviceA] interface gigabitethernet 0/1/1 [~DeviceA-GigabitEthernet0/1/1] portswitch [*DeviceA-GigabitEthernet0/1/1] port trunk allow-pass vlan 3 [*DeviceA-GigabitEthernet0/1/1] commit [~DeviceA-GigabitEthernet0/1/1] quit
[~DeviceA] interface gigabitethernet 0/1/2 [~DeviceA-GigabitEthernet0/1/2] l2-multicast static-group group-address 225.0.0.1 vlan 3 [*DeviceA-GigabitEthernet0/1/2] commit [~DeviceA-GigabitEthernet0/1/2] quit
# After completing the configurations, run the display igmp-snooping port-info command on DeviceA to view information about member ports of the multicast group 225.0.0.1.
[~DeviceA] display igmp-snooping port-info ----------------------------------------------------------------------------------- Flag: S:Static D:Dynamic M:Ssm-mapping A:Active P:Protocol F:Fast-channel (Source, Group) Port Flag ----------------------------------------------------------------------------------- VLAN 3, 1 Entry(s) (*, 225.0.0.1) P-- GE0/1/2 S-- 1 port(s) include -----------------------------------------------------------------------------------
DeviceA configuration file
# sysname DeviceA # vlan batch 3 # igmp-snooping enable # # vlan 3 igmp-snooping enable # # interface GigabitEthernet0/1/1 undo shutdown portswitch port trunk allow-pass vlan 3 # interface GigabitEthernet0/1/2 undo shutdown portswitch port trunk allow-pass vlan 3 l2-multicast static-group group-address 225.0.0.1 vlan 3 # return