Multicast forwarding over a GRE tunnel
Network requirements
As shown in Figure 28:
Multicast routing and PIM-DM are enabled on Switch A and Switch C.
Switch B does not support multicast.
OSPF is running on Switch A, Switch B, and Switch C.
Configure the switches so that the receiver host can receive the multicast data from the source.
Figure 28: Network diagram
Configuration procedure
Assign an IP address and subnet mask to each interface according to Figure 28. (Details not shown.)
Configure OSPF on all the switches. (Details not shown.)
Configure a GRE tunnel:
# Create service loopback group 1 on Switch A and specify the unicast tunnel service for the group
<SwitchA> system-view [SwitchA] service-loopback group 1 type tunnel
# Add GigabitEthernet 1/0/3 of Switch A to service loopback group 1. (GigabitEthernet 1/0/3 does not belong to VLAN 100 or VLAN 101.)
[SwitchA] interface gigabitethernet 1/0/3 [SwitchA-GigabitEthernet1/0/3] port service-loopback group 1 [SwitchA-GigabitEthernet1/0/3] quit
# Create a GRE tunnel interface Tunnel 0 on Switch A, and specify the tunnel mode as GRE/IPv4.
[SwitchA] interface tunnel 0 mode gre
# Assign an IP address to interface Tunnel 0, and specify its source and destination addresses.
[SwitchA-Tunnel0] ip address 50.1.1.1 24 [SwitchA-Tunnel0] source 20.1.1.1 [SwitchA-Tunnel0] destination 30.1.1.2 [SwitchA-Tunnel0] quit
# Create service loopback group 1 on Switch C, and specify the unicast tunnel service for the group.
<SwitchC> system-view [SwitchC] service-loopback group 1 type tunnel
# Add GigabitEthernet 1/0/3 of Switch C to service loopback group 1. (GigabitEthernet 1/0/3 does not belong to VLAN 200 or VLAN 102.)
[SwitchC] interface gigabitethernet 1/0/3 [SwitchC-GigabitEthernet1/0/3] port service-loopback group 1 [SwitchC-GigabitEthernet1/0/3] quit
# Create a GRE tunnel interface Tunnel 0 on Switch C, and specify the tunnel mode as GRE/IPv4.
[SwitchC] interface tunnel 0 mode gre
# Assign an IP address to interface Tunnel 0, and specify its source and destination addresses.
[SwitchC-Tunnel0] ip address 50.1.1.2 24 [SwitchC-Tunnel0] source 30.1.1.2 [SwitchC-Tunnel0] destination 20.1.1.1 [SwitchC-Tunnel0] quit
Enable IP multicast routing, PIM-DM, and IGMP:
# On Switch A, enable multicast routing, and enable PIM-DM on each interface.
[SwitchA] multicast routing [SwitchA-mrib] quit [SwitchA] interface vlan-interface 100 [SwitchA-Vlan-interface100] pim dm [SwitchA-Vlan-interface100] quit [SwitchA] interface vlan-interface 101 [SwitchA-Vlan-interface101] pim dm [SwitchA-Vlan-interface101] quit [SwitchA] interface tunnel 0 [SwitchA-Tunnel0] pim dm [SwitchA-Tunnel0] quit
# On Switch C, enable multicast routing.
[SwitchC] multicast routing [SwitchC-mrib] quit
# Enable IGMP on VLAN-interface 200 (the interface that connects to the receiver host).
[SwitchC] interface vlan-interface 200 [SwitchC-Vlan-interface200] igmp enable [SwitchC-Vlan-interface200] quit
# Enable PIM-DM on the other interfaces.
[SwitchC] interface vlan-interface 102 [SwitchC-Vlan-interface102] pim dm [SwitchC-Vlan-interface102] quit [SwitchC] interface tunnel 0 [SwitchC-Tunnel0] pim dm [SwitchC-Tunnel0] quit
On Switch C, configure a static multicast route, and specify the RPF neighbor toward the source as interface Tunnel 0 on Switch A.
[SwitchC] ip rpf-route-static 50.1.1.0 24 50.1.1.1
Verifying the configuration
# Send an IGMP report from Receiver to join multicast group 225.1.1.1. (Details not shown.)
# Send multicast data from Source to multicast group 225.1.1.1. (Details not shown.)
# Display PIM routing table information on Switch C.
[SwitchC] display pim routing-table Total 1 (*, G) entry; 1 (S, G) entry (*, 225.1.1.1) Protocol: pim-dm, Flag: WC UpTime: 00:04:25 Upstream interface: NULL Upstream neighbor: NULL RPF prime neighbor: NULL Downstream interface(s) information: Total number of downstreams: 1 1: Vlan-interface200 Protocol: igmp, UpTime: 00:04:25, Expires: - (10.1.1.100, 225.1.1.1) Protocol: pim-dm, Flag: ACT UpTime: 00:06:14 Upstream interface: Tunnel0 Upstream neighbor: 50.1.1.1 RPF prime neighbor: 50.1.1.1 Downstream interface(s) information: Total number of downstreams: 1 1: Vlan-interface200 Protocol: pim-dm, UpTime: 00:04:25, Expires: -
The output shows that Switch A is the RPF neighbor of Switch C and the multicast data from Switch A is delivered over the GRE tunnel to Switch C.