IGMP snooping configuration example (for VXLANs)

Network requirements

As shown in Figure 19:

Configure IGMP snooping on the switches to implement Layer 2 multicast forwarding and reduce the burden of replicating known multicast traffic for VTEPs in VXLAN 10.

Figure 19: Network diagram

Table 6: Interface and IP address assignment

Device

Interface

IP address

Device

Interface

IP address

Switch A

Vlan-int11

11.1.1.1/24

Switch C

Vlan-int13

13.1.1.3/24

Switch A

Loop0

1.1.1.1/32

Switch C

Loop0

3.3.3.3/32

Switch B

Vlan-int12

12.1.1.2/24

Switch D

Vlan-int11

11.1.1.4/24

Switch B

Loop0

2.2.2.2/32

Switch D

Vlan-int12

12.1.1.4/24

Switch D

Vlan-int13

13.1.1.4/24

Configuration procedure

  1. Assign an IP address and subnet mask to each interface on the transport network, as shown in Table 6. (Details not shown.)

  2. Configure OSPF on all the switches in the transport network. (Details not shown.)

  3. Configure Switch A:

    # Enable L2VPN.

    <SwitchA> system-view
    [SwitchA] l2vpn enable
    

    # Enable Layer 2 forwarding for VXLANs.

    [SwitchA] undo vxlan ip-forwarding
    

    # Create a VSI named vpna, and create VXLAN 10.

    [SwitchA] vsi vpna
    [SwitchA-vsi-vpna] vxlan 10
    [SwitchA-vsi-vpna-vxlan-10] quit
    [SwitchA-vsi-vpna] quit
    

    # Enable the IGMP snooping feature.

    [SwitchA] igmp-snooping
    [SwitchA -igmp-snooping] quit
    

    # Enable IGMP snooping and dropping unknown multicast data packets for VSI vpna.

    [SwitchA] vsi vpna
    [SwitchA-vsi-vpna] igmp-snooping enable
    [SwitchA-vsi-vpna] igmp-snooping drop-unknown
    [SwitchA-vsi-vpna] quit
    

    # Assign an IP address to Loopback 0. This IP address will be used as the source address of the VXLAN tunnels to Switch B and Switch C.

    [SwitchA] interface loopback 0
    [SwitchA-Loopback0] ip address 1.1.1.1 255.255.255.255
    [SwitchA-Loopback0] quit
    

    # Create a VXLAN tunnel to Switch B.

    • The tunnel interface name is Tunnel 1.

    • The source address and destination address of the tunnel interface are 1.1.1.1 and 2.2.2.2, respectively.

    [SwitchA] interface tunnel 1 mode vxlan
    [SwitchA-Tunnel1] source 1.1.1.1
    [SwitchA-Tunnel1] destination 2.2.2.2
    [SwitchA-Tunnel1] quit
    

    # Create a VXLAN tunnel to Switch C.

    • The tunnel interface name is Tunnel 2.

    • The source address and destination address of the tunnel interface are 1.1.1.1 and 3.3.3.3, respectively.

    [SwitchA] interface tunnel 2 mode vxlan
    [SwitchA-Tunnel2] source 1.1.1.1
    [SwitchA-Tunnel2] destination 3.3.3.3
    [SwitchA-Tunnel2] quit
    

    # Assign Tunnel 1 and Tunnel 2 to VXLAN 10.

    [SwitchA] vsi vpna
    [SwitchA-vsi-vpna] vxlan 10
    [SwitchA-vsi-vpna-vxlan-10] tunnel 1
    [SwitchA-vsi-vpna-vxlan-10] tunnel 2
    [SwitchA-vsi-vpna-vxlan-10] quit
    [SwitchA-vsi-vpna] quit
    

    # On Ten-GigabitEthernet 1/0/1, create Ethernet service instance 1000 to match VLAN 2.

    [SwitchA] interface ten-gigabitethernet 1/0/1
    [SwitchA-Ten-GigabitEthernet1/0/1] service-instance 1000
    [SwitchA-Ten-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 2
    

    # Map Ethernet service instance 1000 to VSI vpna.

    [SwitchA-Ten-GigabitEthernet1/0/1-srv1000] xconnect vsi vpna
    [SwitchA-Ten-GigabitEthernet1/0/1-srv1000] quit
    [SwitchA-Ten-GigabitEthernet1/0/1] quit
    
  4. Configure Switch B:

    # Enable L2VPN.

    <SwitchB> system-view
    [SwitchB] l2vpn enable
    

    # Enable Layer 2 forwarding for VXLANs.

    [SwitchB] undo vxlan ip-forwarding
    

    # Create a VSI named vpna, and create VXLAN 10.

    [SwitchB] vsi vpna
    [SwitchB-vsi-vpna] vxlan 10
    [SwitchB-vsi-vpna-vxlan-10] quit
    [SwitchB-vsi-vpna] quit
    

    # Enable the IGMP snooping feature.

    [SwitchB] igmp-snooping
    [SwitchB -igmp-snooping] quit
    

    # Enable IGMP snooping and dropping unknown multicast data packets for VSI vpna.

    [SwitchB] vsi vpna
    [SwitchB-vsi-vpna] igmp-snooping enable
    [SwitchB-vsi-vpna] igmp-snooping drop-unknown
    [SwitchB-vsi-vpna] quit
    

    # Assign an IP address to Loopback 0. This IP address will be used as the source address of the VXLAN tunnels to Switch A and Switch C.

    [SwitchB] interface loopback 0
    [SwitchB-Loopback0] ip address 2.2.2.2 255.255.255.255
    [SwitchB-Loopback0] quit
    

    # Create a VXLAN tunnel to Switch A.

    • The tunnel interface name is Tunnel 2.

    • The source address and destination address of the tunnel interface are 2.2.2.2 and 1.1.1.1, respectively.

    [SwitchB] interface tunnel 2 mode vxlan
    [SwitchB-Tunnel2] source 2.2.2.2
    [SwitchB-Tunnel2] destination 1.1.1.1
    [SwitchB-Tunnel2] quit
    

    # Create a VXLAN tunnel to Switch C.

    • The tunnel interface name is Tunnel 3.

    • The source address and destination address of the tunnel interface are 2.2.2.2 and 3.3.3.3, respectively.

    [SwitchB] interface tunnel 3 mode vxlan
    [SwitchB-Tunnel3] source 2.2.2.2
    [SwitchB-Tunnel3] destination 3.3.3.3
    [SwitchB-Tunnel3] quit
    

    # Assign Tunnel 2 and Tunnel 3 to VXLAN 10.

    [SwitchB] vsi vpna
    [SwitchB-vsi-vpna] vxlan 10
    [SwitchB-vsi-vpna-vxlan-10] tunnel 2
    [SwitchB-vsi-vpna-vxlan-10] tunnel 3
    [SwitchB-vsi-vpna-vxlan-10] quit
    [SwitchB-vsi-vpna] quit
    

    # On Ten-GigabitEthernet 1/0/1, create Ethernet service instance 1000 to match VLAN 2.

    [SwitchB] interface ten-gigabitethernet 1/0/1
    [SwitchB-Ten-GigabitEthernet1/0/1] service-instance 1000
    [SwitchB-Ten-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 2
    

    # Map Ethernet service instance 1000 to VSI vpna.

    [SwitchB-Ten-GigabitEthernet1/0/1-srv1000] xconnect vsi vpna
    [SwitchB-Ten-GigabitEthernet1/0/1-srv1000] quit
    [SwitchB-Ten-GigabitEthernet1/0/1] quit
    
  5. Configure Switch C:

    # Enable L2VPN.

    <SwitchC> system-view
    [SwitchC] l2vpn enable
    

    # Enable Layer 2 forwarding for VXLANs.

    [SwitchC] undo vxlan ip-forwarding
    

    # Create a VSI named vpna, and create VXLAN 10.

    [SwitchC] vsi vpna
    [SwitchC-vsi-vpna] vxlan 10
    [SwitchC-vsi-vpna-vxlan-10] quit
    [SwitchC-vsi-vpna] quit
    

    # Enable the IGMP snooping feature.

    [SwitchB] igmp-snooping
    [SwitchB -igmp-snooping] quit
    

    # Enable IGMP snooping for VSI vpna.

    [SwitchC] vsi vpna
    [SwitchC-vsi-vpna] igmp-snooping enable
    

    # Enable dropping unknown multicast data packets for VSI vpna.

    [SwitchC-vsi-vpna] igmp-snooping drop-unknown
    

    # Specify 3.3.3.3 as the source IP address of IGMP general queries in VSI vpna.

    [SwitchC-vsi-vpna] igmp-snooping general-query source-ip 3.3.3.3
    

    # Enable the IGMP snooping querier.

    [SwitchC-vsi-vpna] igmp-snooping querier
    [SwitchC-vsi-vpna] quit
    

    # Assign an IP address to Loopback 0. This address will be used as the source address of the VXLAN tunnels to Switch A and Switch B.

    [SwitchC] interface loopback 0
    [SwitchC-Loopback0] ip address 3.3.3.3 255.255.255.255
    [SwitchC-Loopback0] quit
    

    # Create a VXLAN tunnel to Switch A.

    • The tunnel interface name is Tunnel 1.

    • The source address and destination address of the tunnel interface are 3.3.3.3 and 1.1.1.1, respectively.

    [SwitchC] interface tunnel 1 mode vxlan
    [SwitchC-Tunnel1] source 3.3.3.3
    [SwitchC-Tunnel1] destination 1.1.1.1
    [SwitchC-Tunnel1] quit
    

    # Create a VXLAN tunnel to Switch B.

    • The tunnel interface name is Tunnel 3.

    • The source address and destination address of the tunnel interface are 3.3.3.3 and 2.2.2.2, respectively.

    [SwitchC] interface tunnel 3 mode vxlan
    [SwitchC-Tunnel3] source 3.3.3.3
    [SwitchC-Tunnel3] destination 2.2.2.2
    [SwitchC-Tunnel3] quit
    

    # Assign Tunnel 1 and Tunnel 3 to VSI vpna.

    [SwitchC] vsi vpna
    [SwitchC-vsi-vpna] vxlan 10
    [SwitchC-vsi-vpna-vxlan-10] tunnel 1
    [SwitchC-vsi-vpna-vxlan-10] tunnel 3
    [SwitchC-vsi-vpna-vxlan-10] quit
    [SwitchC-vsi-vpna] quit
    

    # On Ten-GigabitEthernet 1/0/1, create Ethernet service instance 1000 to match VLAN 2.

    [SwitchC] interface ten-gigabitethernet 1/0/1
    [SwitchC-Ten-GigabitEthernet1/0/1] service-instance 1000
    [SwitchC-Ten-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 2
    

    # Map Ethernet service instance 1000 to VSI vpna.

    [SwitchC-Ten-GigabitEthernet1/0/1-srv1000] xconnect vsi vpna
    [SwitchC-Ten-GigabitEthernet1/0/1-srv1000] quit
    [SwitchC-Ten-GigabitEthernet1/0/1] quit
    

Verifying the configuration

# Display dynamic router port information for VSI vpna on Switch A.

[SwitchA] display igmp-snooping router-port vsi vpna 
VSI vpna:
  Router ports (1 in total):
    Tun2 (VXLAN ID 10)                        (00:04:17)

# Display dynamic router port information for VSI vpna on Switch B.

[SwitchB] display igmp-snooping router-port vsi vpna 
VSI vpna:
  Router ports (1 in total):
    Tun3 (VXLAN ID 10)                        (00:04:07)