Configuring Basic IGMP Snooping Functions
Pre-configuration Tasks
Basic IGMP snooping functions enable the switch to create and maintain a Layer 2 multicast forwarding table for on-demand multicast data transmission at the data link layer.
Before configuring IGMP snooping functions, create the VLAN.
Configuration Procedure
Enabling IGMP Snooping and Configuring the IGMP Snooping Version are mandatory and other tasks are optional.
- Enabling IGMP Snooping
- Configuring the IGMP Snooping Version
- (Optional) Configuring a Static Router Port
- (Optional) Configuring a Static Member Port
- (Optional) Configuring an IGMP Snooping Querier
- (Optional) Suppressing Report and Leave Messages
- (Optional) Configuring the Router-Alert Option
- (Optional) Disabling Users from Dynamically Joining Multicast Groups
- Verifying the Basic IGMP Snooping Function Configuration
Enabling IGMP Snooping
Context
Other IGMP snooping functions can be configured only after IGMP snooping is enabled globally. Other IGMP snooping functions take effect in a VLAN only after IGMP snooping is enabled in the VLAN.
By default, IGMP snooping is disabled globally on the switch.
Procedure
- Run system-view
The system view is displayed.
- Run igmp-snooping enable
IGMP snooping is enabled globally.
- Run vlan vlan-id
The VLAN view is displayed.
- (Optional) Run l2-multicast forwarding-mode { ip | mac }
The multicast forwarding mode in the VLAN is set to IP address-based or MAC address-based forwarding.
By default, multicast flows are forwarded based on IP addresses.
Configure the forwarding mode of multicast flows in the VLAN before IGMP snooping is enabled in the VLAN. Enable IGMP snooping in the VLAN for the configuration to take effect.
After the multicast data forwarding mode is set to MAC address-based forwarding in a VLAN using this command, the VLAN cannot be configured as a multicast VLAN.
If the device forwards multicast data packets based on MAC addresses, do not use a group address on the network if the group address maps to the same multicast MAC address as a multicast IP address reserved for a protocol. Otherwise, the protocol that uses this multicast IP address cannot run normally. For example, OSPF uses 224.0.0.5 to send protocol packets. This multicast IP address maps to multicast MAC address 01-00-5E-00-00-05. If multicast data packets are forwarded based on MAC addresses and use multicast IP address 225.0.0.5 (also mapping to 01-00-5E-00-00-05), the OSPF protocol cannot run normally.
- (Optional) Run l2-multicast router-port-discard
The switch is disabled from forwarding multicast data to router ports in a VLAN.
Before disabling the switch from forwarding multicast data to router ports in a VLAN, disable IGMP snooping in the VLAN. After setting the forwarding mode, enable IGMP snooping in the VLAN for the configuration to take effect.
- Run igmp-snooping enable
IGMP snooping is enabled in the VLAN.
Run the igmp-snooping enable [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ] command in the system view to enable IGMP snooping in multiple VLANs.
IGMP snooping cannot be used with N:1 (N > 1) VLAN mapping.
Configuring the IGMP Snooping Version
Context
Internet Group Management Protocol (IGMP) manages multicast group members and runs on the network segments where Layer 3 multicast devices connect to user hosts. IGMP has three protocol versions: V1, V2, and V3. You can specify an IGMP snooping version on a Layer 2 device to enable the device to process IGMP messages of specific versions. Generally, set the IGMP snooping version on a Layer 2 device to be the same as the IGMP version on the upstream Layer 3 multicast device. If IGMP is disabled on the Layer 3 multicast device, set the IGMP snooping version to be the same as or later than the IGMP version running on user hosts.
Devices in the same VLAN must run the same IGMP version. When hosts in a VLAN run different IGMP versions, configure an appropriate IGMP snooping version on the Layer 2 multicast device, to ensure that it can process IGMP messages of all the hosts.
Procedure
- Run system-view
The system view is displayed.
- Run vlan vlan-id
The VLAN view is displayed.
- Run igmp-snooping version version
The version of IGMP messages that the switch can process is set.
By default, the switch can process IGMPv1 and IGMPv2 messages, but cannot process IGMPv3 messages.
When the IGMP snooping version is set to IGMPv3, the switch forwards multicast data by looking up the forwarding table according to the VLAN ID and group address.
(Optional) Configuring a Static Router Port
Context
A router port is located on a Layer 2 device and connects to an upstream Layer 3 device (a multicast router or Layer 3 switch). When IGMP snooping is enabled in a VLAN, all interfaces in this VLAN learn forwarding entries from multicast protocol packets. When an interface receives IGMP Query messages or Protocol Independent Multicast (PIM) Hello messages, the Layer 2 device sets this interface as a dynamic router port. A router port provides the following functions:
- Receives multicast data from the upstream device.
- Forwards IGMP Report/Leave messages. IGMP Report/Leave messages received in a VLAN are forwarded only to router ports in the VLAN.
A dynamic router port has an aging time. If a dynamic router port does not receive an IGMP Query or a PIM Hello message before the aging time expires, the device deletes the port from the router port list. To enable an interface to forward IGMP Report/Leave messages to the upstream querier for a long time, configure the interface as a static router port.
On a ring network running IGMP snooping, if the downstream port of a device is configured as a static router port, downstream ports of all devices on the ring network must be configured as static router ports. Otherwise, multicast traffic cannot be forwarded normally if the Layer 2 network topology changes. Therefore, it is not recommended to configure downstream ports as static router ports.
Procedure
- Run system-view
The system view is displayed.
- (Optional) Run vlan vlan-id
The VLAN view is displayed.
- (Optional) Run undo igmp-snooping router-learning
Dynamic router port learning is disabled.
By default, dynamic router port learning is enabled in a VLAN.
You can also disable router port learning by running the undo igmp-snooping router-learning vlan { { vlan-id1 [ to vlan-id2 ] } &<1–10> | all } command in the interface view.
- (Optional) Run quit
Exit from the VLAN view.
- Run interface interface-type interface-number
The interface view is displayed.
- Run igmp-snooping static-router-port vlan { vlan-id1 [ to vlan-id2 ] } &<1-10>
The interface is configured as a static router port.
(Optional) Configuring a Static Member Port
Context
A member port is on a Layer 2 device and connects to receiver hosts which are multicast group members. The member port can be configured manually or learned dynamically by multicast protocols. When IGMP snooping is enabled in a VLAN, all interfaces in this VLAN learn forwarding entries from multicast packets. When an interface receives IGMP Report messages, the Layer 2 device sets this interface as a dynamic member port. A dynamic member port has an aging time.
If the hosts connected to an interface need to receive multicast data for a specific group or source-group for a long time, add the interface statically to the multicast group or source-group. The manually added interface is a static member port. Static member ports will not be aged out.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number
The interface view is displayed.
- (Optional) Run undo igmp-snooping learning vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }
Dynamic member port learning is disabled.
By default, dynamic member port learning is enabled. If this function is disabled, interfaces must be statically added to a multicast group when they need to forward multicast data for this group.
- Run l2-multicast static-group [ source-address source-ip-address ] group-address group-ip-address vlan { vlan-id1 [ to vlan-id2 ] } &<1-10>
The interface is manually added to a multicast group and becomes a static member port.
Or run l2-multicast static-group [ source-address source-ip-address ] group-address group-ip-address1 to group-ip-address2 vlan vlan-id
The interface is added to multiple multicast groups.
(Optional) Configuring an IGMP Snooping Querier
Context
When IGMP snooping is enabled on a Layer 2 device, the device can listen to IGMP protocol packets exchanged between an IGMP querier and user hosts to dynamically create Layer 2 multicast forwarding entries and provide Layer 2 multicast functions.
A Layer 2 device cannot create Layer 2 multicast forwarding entries by listening to IGMP protocol packets in the following conditions, even when IGMP snooping is enabled:
The interfaces on the upstream Layer 3 multicast device have static multicast groups configured and do not run the IGMP protocol.
The multicast source is located on the same Layer 2 network as user hosts, and therefore no Layer 3 multicast device is required.
In either of the preceding conditions, you can configure the IGMP snooping querier on the Layer 2 multicast device. The Layer 2 multicast device then sends IGMP Query messages to user hosts on behalf of the Layer 3 multicast device.
Procedure
- Run system-view
The system view is displayed.
- Run vlan vlan-id
The VLAN view is displayed.
- Run igmp-snooping querier enable
The IGMP snooping querier function is enabled.
After an IGMP snooping querier is enabled in a VLAN, the switch periodically broadcasts IGMP Query messages to all the interfaces in the VLAN, including the router ports. This may result in IGMP querier reelection if an IGMP querier already exists on the multicast network. If an IGMP querier already exists on the multicast network, configuring IGMP snooping querier is not recommended. If you configure an IGMP snooping querier on a switch, ensure that the source IP address of the General Query messages sent from the switch is larger than the IP address of the upstream IGMP querier.
IGMP snooping querier and IGMP snooping proxy cannot be enabled in the same VLAN.
- If multicast VLAN replication is configured on the switch, the IGMP snooping querier function cannot be enabled in user VLANs.
- (Optional) Set the querier parameters.
When setting the querier parameters, ensure that the interval for sending IGMP General Query messages is larger than the maximum response time for IGMP Query messages.
Querier Parameter
Configuration Command
Description
Default Setting
Version
Interval for sending IGMP General Query messages
igmp-snooping query-interval query-interval
The querier sends IGMP General Query messages at the specified interval to maintain memberships of interfaces in a VLAN.
125 seconds IGMPv1, IGMPv2, IGMPv3
IGMP robustness variable
igmp-snooping robust-count robust-count
The robustness variable defines the following values:- Number of times the querier sends General Query messages after startup. The packet sending interval is 1/4 of the configured interval for sending General Query messages.
- Number of times the querier sends Group-Specific Query messages after receiving a Leave message. The packet sending interval is the same as the configured interval for sending Group-Specific Query messages.
2
IGMPv1, IGMPv2, IGMPv3
Maximum response time for IGMP Query messages
igmp-snooping max-response-time max-response-time
When receiving IGMP Report messages from hosts, the switch sets the aging time of member ports by using the following formula: Aging time = IGMP robustness variable x Interval for sending IGMP General Query messages + Maximum response time.
After a multicast member receives an IGMP Query message, it must send a Report message within the maximum response time.
10 seconds
IGMPv2, IGMPv3
Interval for sending IGMP Group-Specific Query messages
igmp-snooping lastmember-queryinterval lastmember-queryinterval
When receiving IGMP Leave messages from a host, the switch calculates the aging time of the member port using the following formula: Aging time = Interval for sending Group-Specific Query messages x IGMP robustness variable. The switch sends a Group-Specific Query message a certain number of times (specified by the IGMP robustness variable) to check whether this group has any other members.
1 second
IGMPv2, IGMPv3
- (Optional) Run quit
Return to the system view.
- (Optional) Run igmp-snooping send-query source-address ip-address
The source IP address of IGMP Query messages is configured.
By default, the source IP address of IGMP Query messages sent by the IGMP snooping querier is 192.168.0.1. If this IP address is used by another device on the network, use this command to set a different IP address.
(Optional) Suppressing Report and Leave Messages
Context
IGMP periodically sends Query and Response messages to maintain group memberships. When multiple members join the same multicast group, they send a large number of identical Report messages to the IGMP router. When IGMPv2 or IGMPv3 hosts leave a multicast group, they send a large number of identical Leave messages. To conserve bandwidth, configure suppression for Report and Leave messages on the Layer 2 device.
After message suppression is configured, the switch forwards a Report message only when the first member joins a group or when it receives an IGMP Query message. The switch sends a Leave message only when the last member leaves the group.
Procedure
- Run system-view
The system view is displayed.
- Run vlan vlan-id
The VLAN view is displayed.
- Run igmp-snooping report-suppress
Report and Leave message suppression is configured.
When configuring message suppression, pay attention to the following points:
- IGMP snooping proxy and message suppression cannot be configured in the same VLAN.
- If multicast VLAN replication is configured on the switch, the IGMP message suppression function cannot be enabled in user VLANs.
- The switch can suppress duplicate IGMPv1 or IGMPv2 Report messages even when IGMP message suppression is disabled. The default suppression time is 10 seconds. To change the suppression time, run the igmp-snooping suppress-time suppress-time command. If suppress-time is set to 0, all the membership report packets are forwarded immediately.
(Optional) Configuring the Router-Alert Option
Context
By default, the switch does not check whether IGMP messages contain the Router-Alert option and sends all the IGMP messages to the upper-layer routing protocol. To improve device performance, reduce transmission cost, and enhance protocol security, configure the switch to discard IGMP messages without the Router-Alert option.
By default, the switch sends IGMP messages with the Router-Alert option.
Procedure
- Run system-view
The system view is displayed.
- Run vlan vlan-id
The VLAN view is displayed.
- Run igmp-snooping require-router-alert
The device is configured to check whether IGMP messages contain the Router-Alert option.
- Run igmp-snooping send-router-alert
The device is configured to send only IGMP messages with the Router-Alert option.
(Optional) Disabling Users from Dynamically Joining Multicast Groups
Context
If an upstream multicast device is a non-Huawei device and has static multicast groups configured on user-side interfaces, multicast users are not allowed to dynamically join or leave multicast groups. In this case, disable the switch from sending IGMP Report and Leave messages carrying static group addresses to the upstream device.
Procedure
- Run system-view
The system view is displayed.
- Run vlan vlan-id
The VLAN view is displayed.
- Run igmp-snooping static-group suppress-dynamic-join
The switch is disabled from sending IGMP Report and Leave messages carrying static group addresses to the upstream device.
By default, the switch forwards IGMP Report and Leave messages carrying static group addresses to router ports.
Verifying the Basic IGMP Snooping Function Configuration
Context
Run the following commands in any view to check IGMP snooping configurations and forwarding entries.
Procedure
- Run the display igmp-snooping [ vlan [ vlan-id ] ] configuration command to check the IGMP snooping configuration in a VLAN.
- Run the display igmp-snooping [ vlan [ vlan-id ] ] command to check all the IGMP snooping running parameters in a VLAN.
- Run the display igmp-snooping port-info [ vlan vlan-id [ group-address group-address ] ] [ verbose ] command to check member ports of a multicast group.
- Run the display igmp-snooping host-tracking [ vlan vlan-id [ group-address group-address ] ] [ interface { interface-type interface number } ] command to check information about group member hosts.
- Run the display igmp-snooping router-port vlan [ vlan-id ] command to check router ports.
- Run the display l2-multicast forwarding-table vlan [ vlan-id ] [ [ source-address source-address ] group-address { group-address | router-group } ] command to check the Layer 2 multicast forwarding table in a VLAN.
- Run the display l2-multicast forwarding-mode vlan [ vlan-id ] command to check the Layer 2 multicast data forwarding mode in the VLAN.
- Run the display igmp-snooping querier vlan [ vlan-id ] command to check the IGMP snooping querier configuration.
- Enabling IGMP Snooping
- Configuring the IGMP Snooping Version
- (Optional) Configuring a Static Router Port
- (Optional) Configuring a Static Member Port
- (Optional) Configuring an IGMP Snooping Querier
- (Optional) Suppressing Report and Leave Messages
- (Optional) Configuring the Router-Alert Option
- (Optional) Disabling Users from Dynamically Joining Multicast Groups
- Verifying the Basic IGMP Snooping Function Configuration