Example: Configuring PIM snooping
Network configuration
As shown in Figure 21:
OSPF runs on the network.
Source 1 and Source 2 send multicast data to multicast groups 224.1.1.1 and 225.1.1.1, respectively.
Receiver 1 and Receiver 2 belong to multicast groups 224.1.1.1 and 225.1.1.1, respectively.
Router C and Router D run IGMP on HundredGigE 1/0/1. Router A, Router B, Router C, and Router D run PIM-SM.
HundredGigE 1/0/2 on Router A acts as a C-BSR and a C-RP.
Configure IGMP snooping and PIM snooping on Switch A. Then, Switch A forwards PIM protocol packets and multicast data packets only to the routers that are connected to receivers.
Figure 21: Network diagram
Procedure
Assign an IP address and subnet mask to each interface, as shown in Figure 21. (Details not shown.)
Configure OSPF on the routers. (Details not shown.)
Configure Router A:
# Enable IP multicast routing.
<RouterA> system-view [RouterA] multicast routing [RouterA-mrib] quit
# Enable PIM-SM on each interface.
[RouterA] interface hundredgige 1/0/1 [RouterA-HundredGigE1/0/1] pim sm [RouterA-HundredGigE1/0/1] quit [RouterA] interface hundredgige 1/0/2 [RouterA-HundredGigE1/0/2] pim sm [RouterA-HundredGigE1/0/2] quit
# Configure HundredGigE 1/0/2 as a C-BSR and a C-RP.
[RouterA] pim [RouterA-pim] c-bsr 10.1.1.1 [RouterA-pim] c-rp 10.1.1.1 [RouterA-pim] quit
Configure Router B:
# Enable IP multicast routing.
<RouterB> system-view [RouterB] multicast routing [RouterB-mrib] quit
# Enable PIM-SM on each interface.
[RouterB] interface hundredgige 1/0/1 [RouterB-HundredGigE1/0/1] pim sm [RouterB-HundredGigE1/0/1] quit [RouterB] interface hundredgige 1/0/2 [RouterB-HundredGigE1/0/2] pim sm [RouterB-HundredGigE1/0/2] quit
Configure Router C:
# Enable IP multicast routing.
<RouterC> system-view [RouterC] multicast routing [RouterC-mrib] quit
# Enable IGMP on HundredGigE 1/0/1.
[RouterC] interface hundredgige 1/0/1 [RouterC-HundredGigE1/0/1] igmp enable [RouterC-HundredGigE1/0/1] quit
# Enable PIM-SM on HundredGigE 1/0/2.
[RouterC] interface hundredgige 1/0/2 [RouterC-HundredGigE1/0/2] pim sm [RouterC-HundredGigE1/0/2] quit
Configure Router D:
# Enable IP multicast routing.
<RouterD> system-view [RouterD] multicast routing [RouterD-mrib] quit
# Enable IGMP on HundredGigE 1/0/1.
[RouterD] interface hundredgige 1/0/1 [RouterD-HundredGigE1/0/1] igmp enable [RouterD-HundredGigE1/0/1] quit
# Enable PIM-SM on HundredGigE 1/0/2.
[RouterD] interface hundredgige 1/0/2 [RouterD-HundredGigE1/0/2] pim sm [RouterD-HundredGigE1/0/2] quit
Configure Switch A:
# Enable the IGMP snooping feature.
<SwitchA> system-view [SwitchA] igmp-snooping [SwitchA-igmp-snooping] quit
# Create VLAN 100, and assign HundredGigE 1/0/1 through HundredGigE 1/0/4 to the VLAN.
[SwitchA] vlan 100 [SwitchA-vlan100] port hundredgige 1/0/1 to hundredgige 1/0/4
# Enable IGMP snooping and PIM snooping for VLAN 100.
[SwitchA-vlan100] igmp-snooping enable [SwitchA-vlan100] pim-snooping enable [SwitchA-vlan100] quit
Verifying the configuration
# On Switch A, display PIM snooping neighbor information for VLAN 100.
[SwitchA] display pim-snooping neighbor vlan 100 Total 4 neighbors. VLAN 100: Total 4 neighbors. 10.1.1.1 Ports (1 in total): HGE1/0/1 (00:32:43) 10.1.1.2 Ports (1 in total): HGE1/0/2 (00:32:43) 10.1.1.3 Ports (1 in total): HGE1/0/3 (00:32:43) 10.1.1.4 Ports (1 in total): HGE1/0/4 (00:32:43)
The output shows that Router A, Router B, Router C, and Router D are PIM snooping neighbors.
# On Switch A, display PIM snooping routing entries for VLAN 100.
[SwitchA] display pim-snooping routing-table vlan 100 Total 2 entries. FSM Flag: NI-no info, J-join, PP-prune pending VLAN 100: Total 2 entries. (*, 224.1.1.1) Upstream neighbor: 10.1.1.1 Upstream Ports (1 in total): HGE1/0/1 Downstream Ports (1 in total): HGE1/0/3 Expires: 00:03:01, FSM: J (*, 225.1.1.1) Upstream neighbor: 10.1.1.2 Upstream Ports (1 in total): HGE1/0/2 Downstream Ports (1 in total): HGE1/0/4 Expires: 00:03:11, FSM: J
The output shows the following information:
Switch A will forward the multicast data intended for multicast group 224.1.1.1 only to Router C.
Switch A will forward the multicast data intended for multicast group 225.1.1.1 only to Router D.