Example: Configuring multicast forwarding over a GRE tunnel
Network configuration
As shown in Figure 33:
Multicast routing and PIM-DM are enabled on Switch A and Switch C.
Switch B does not support multicast.
Switch A, Switch B, and Switch C run OSPF.
Configure the switches so that the receiver host can receive the multicast data from the source.
Figure 33: Network diagram
Procedure
Assign an IP address and subnet mask for each interface, as shown in Figure 33. (Details not shown.)
Configure OSPF on all the switches. (Details not shown.)
Configure a GRE tunnel:
# On Switch A, create service loopback group 1, and specify the unicast tunnel service for the group.
<SwitchA> system-view [SwitchA] service-loopback group 1 type tunnel
# Add HundredGigE 1/0/3 to service loopback group 1. (HundredGigE 1/0/3 does not belong to VLAN 100 or VLAN 101.)
[SwitchA] interface hundredgige 1/0/3 [SwitchA-HundredGigE1/0/3] port service-loopback group 1 [SwitchA-HundredGigE1/0/3] quit
# Create a GRE tunnel interface Tunnel 2, and specify the tunnel mode as GRE/IPv4.
[SwitchA] interface tunnel 2 mode gre
# Assign an IP address to interface Tunnel 2, and specify its source and destination addresses.
[SwitchA-Tunnel2] ip address 50.1.1.1 24 [SwitchA-Tunnel2] source 20.1.1.1 [SwitchA-Tunnel2] destination 30.1.1.2 [SwitchA-Tunnel2] quit
# On Switch C, create service loopback group 1, and specify the unicast tunnel service for the group.
<SwitchC> system-view [SwitchC] service-loopback group 1 type tunnel
# Add HundredGigE 1/0/3 to service loopback group 1. HundredGigE 1/0/3 does not belong to VLAN 200 or VLAN 102.
[SwitchC] interface hundredgige 1/0/3 [SwitchC-HundredGigE1/0/3] port service-loopback group 1 [SwitchC-HundredGigE1/0/3] quit
# Create a GRE tunnel interface Tunnel 2, and specify the tunnel mode as GRE/IPv4.
[SwitchC] interface tunnel 2 mode gre
# Assign an IP address for interface Tunnel 2, and specify its source and destination addresses.
[SwitchC-Tunnel2] ip address 50.1.1.2 24 [SwitchC-Tunnel2] source 30.1.1.2 [SwitchC-Tunnel2] destination 20.1.1.1 [SwitchC-Tunnel2] quit
Enable IP multicast routing, PIM-DM, and IGMP:
# On Switch A, enable multicast routing.
[SwitchA] multicast routing [SwitchA-mrib] quit
# Enable PIM-DM on each interface.
[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 2 [SwitchA-Tunnel2] pim dm [SwitchA-Tunnel2] quit
# On Switch C, enable multicast routing.
[SwitchC] multicast routing [SwitchC-mrib] quit
# Enable IGMP on the receiver-side interface VLAN-interface 200.
[SwitchC] interface vlan-interface 200 [SwitchC-Vlan-interface200] igmp enable [SwitchC-Vlan-interface200] quit
# Enable PIM-DM on VLAN-interface 102.
[SwitchC] interface vlan-interface 102 [SwitchC-Vlan-interface102] pim dm [SwitchC-Vlan-interface102] quit
# Enable PIM-DM on Tunnel 2.
[SwitchC] interface tunnel 2 [SwitchC-Tunnel2] pim dm [SwitchC-Tunnel2] quit
On Switch C, configure a static multicast route to the source and specify Switch A as the RPF neighbor.
[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 the source to multicast group 225.1.1.1. (Details not shown.)
# Display PIM routing entries 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: Tunnel2 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.