Example for Configuring a PIM-SM (ASM Model) Network
Networking Requirements
As shown in Figure 4-20, the network is connected to the Internet. Configure the PIM-SM protocol on the routers to enable them to provide ASM services for user hosts on the network. Then all the hosts in a multicast group can receive multicast data sent from any source to this group.
Configuration Roadmap
Configure an IP address for each interface on routers and a unicast routing protocol. PIM is an intra-domain multicast routing protocol that depends on a unicast routing protocol. The multicast routing protocol can work normally after the unicast routing protocol works normally.
Enable the multicast function on all routers providing multicast services. Before configuring other PIM-SM functions, you must enable the multicast function.
Enable PIM-SM on all interfaces of the routers. After PIM-SM is enabled, you can configure other PIM-SM functions.
Enable IGMP on the interface connected to user hosts. A receiver can join or leave a multicast group by sending IGMP messages. The leaf routers maintain the multicast member relationship using IGMP.
If PIM-SM and IGMP need to be enabled on the same user host, enable PIM-SM, and then enable IGMP.
Configure the interface connected to hosts to be PIM silent to prevent malicious hosts from simulating PIM Hello messages. In this manner, security of the PIM-SM domain is ensured.
If the user network segment is connected to multiple routers, such as RouterB and RouterC in this example, do not enable PIM silent on interfaces that connect these routers to user hosts.
Configure the RP. The RP is the forwarding core of the PIM-SM network. It is recommended that you configure the RP on a router that has more multicast flows, for example, RouterE in Figure 4-20.
Set the BSR boundary on the interface connected to the Internet. The Bootstrap message cannot pass through the BSR boundary. Therefore, the BSR serves only this PIM-SM domain. In this manner, multicast services can be controlled effectively.
Procedure
- Configure an IP address for each interface and configure the unicast routing protocol.
# Configure an IP address and mask for each interface according to Figure 4-20. Configure OSPF on each router to ensure IP connectivity between them, and enable them to dynamically update routing information. The configuration of RouterB, RouterC, RouterD, and RouterE are similar to the configuration of RouterA, and are not provided here.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 192.168.5.1 24 [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] ip address 10.110.1.1 24 [RouterA-GigabitEthernet2/0/0] quit [RouterA] interface gigabitethernet 3/0/0 [RouterA-GigabitEthernet3/0/0] ip address 192.168.1.1 24 [RouterA-GigabitEthernet3/0/0] quit [RouterA] ospf [RouterA-ospf-1] area 0 [RouterA-ospf-1-area-0.0.0.0] network 10.110.1.0 0.0.0.255 [RouterA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255 [RouterA-ospf-1-area-0.0.0.0] network 192.168.5.0 0.0.0.255 [RouterA-ospf-1-area-0.0.0.0] quit [RouterA-ospf-1] quit
- Enable multicast routing on all routers and PIM-SM on all interfaces.
# Enable multicast routing on all routers and enable PIM-SM on all interfaces. The configurations of RouterB, RouterC, RouterD, and RouterE are similar to the configuration of RouterA, and are not mentioned here.
[RouterA] multicast routing-enable [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] pim sm [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] pim sm [RouterA-GigabitEthernet2/0/0] quit [RouterA] interface gigabitethernet 3/0/0 [RouterA-GigabitEthernet3/0/0] pim sm [RouterA-GigabitEthernet3/0/0] quit
- Enable IGMP on the interface connected to user hosts.
# Enable IGMP on the interface that connects RouterA to user hosts. The configurations of RouterB and RouterC are similar to the configuration of RouterA, and are not mentioned here.
[RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] igmp enable
- Enable PIM silent on the interface of RouterA.
[RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] pim silent
- Configure the RP.
The RP can be configured in two modes: the static RP and the dynamic RP. The static RP can be configured together with the dynamic RP. You can also configure only the static RP or the dynamic RP. When the static RP and the dynamic RP are configured simultaneously, you can adjust parameters to specify the preferred RP.
This example shows how to configure a static RP and a dynamic RP together and to specify the dynamic RP as the preferred RP and the static RP as the standby RP.
# Configure a dynamic RP. Configure one or more routers in the PIM-SM domain as the C-RP and C-BSR. In this example, RouterE is configured as both the C-RP and C-BSR. Set the service range of the RP and specify the locations of the C-BSR and C-RP on RouterE.
[RouterE] acl number 2008 [RouterE-acl-basic-2008] rule permit source 225.1.1.0 0.0.0.255 [RouterE-acl-basic-2008] quit [RouterE] pim [RouterE-pim] c-bsr gigabitethernet 4/0/0 [RouterE-pim] c-rp gigabitethernet 4/0/0 group-policy 2008
# Configure a static RP. Specify IP addresses for RPs on all routers. The configuration of RouterA is used as an example. The configurations of RouterB, RouterC, RouterD, and RouterE are similar to the configuration of RouterA, and are not mentioned here.
If you enter preferred to the right of static-rp X.X.X.X, the static RP is selected as the RP in the PIM-SM domain.
[RouterA] pim [RouterA-pim] static-rp 192.168.2.2
- Configure the BSR boundary on the interface connecting RouterD to the Internet.
[RouterD] interface gigabitethernet 2/0/0 [RouterD-GigabitEthernet2/0/0] pim bsr-boundary [RouterD-GigabitEthernet2/0/0] quit
- Verify the configuration.
# Run the display pim interface command to view the configuration and running status of PIM on the interface. The PIM configuration on RouterC is as follows:
<RouterC> display pim interface VPN-Instance: public net Interface State NbrCnt HelloInt DR-Pri DR-Address GE1/0/0 up 0 30 1 10.110.2.2 (local) GE2/0/0 up 1 30 1 192.168.3.2
# Run the display pim bsr-info command to view information about BSR election on routers. For example, BSR information on RouterA and RouterE is as follows (C-BSR information is also displayed on RouterE):
<RouterA> display pim bsr-info VPN-Instance: public net Elected AdminScoped BSR Count: 0 Elected BSR Address: 192.168.4.2 Priority: 0 Hash mask length: 30 State: Accept Preferred Scope: Not scoped Uptime: 01:40:40 Expires: 00:01:42 C-RP Count: 1 <RouterE> display pim bsr-info VPN-Instance: public net Elected AdminScoped BSR Count: 0 Elected BSR Address: 192.168.4.2 Priority: 0 Mask length: 30 State: Elected Scope: Not scoped Uptime: 00:00:18 Next BSR message scheduled at :00:01:42 C-RP Count: 1 Candidate AdminScoped BSR Count: 0 Candidate BSR Address is: 192.168.4.2 Priority: 0 Hash mask length: 30 State:Elected Scope: Not scoped Wait to be BSR: 0
# Run the display pim rp-info command on routers to check RP information. RP information on RouterA is as follows:
<RouterA> display pim rp-info VPN-Instance: public net PIM-SM BSR RP Number:1 Group/MaskLen: 225.1.1.0/24 RP: 192.168.4.2 Priority: 0 Uptime: 00:45:13 Expires: 00:02:17 PIM SM static RP Number:1 Static RP: 192.168.2.2
# Run the display pim routing-table command to view the PIM multicast routing table on the routers. The multicast source 10.110.3.100/24 sends messages to the multicast group 225.1.1.1/24. HostA and HostB join the multicast group 225.1.1.1/24. Take RouterA and RouterB as an example. The command output is as follows:
By default, when the receiver's DR receives the first multicast packet, it triggers an SPT switchover and creates a new (S, G) entry. The (S, G) entry displayed on the router is the (S, G) entry created after the SPT switchover completes.
[RouterA] display pim routing-table VPN-Instance: public net Total 1 (*, G) entry; 1 (S, G) entry (*, 225.1.1.1) RP: 192.168.4.2 Protocol: pim-sm, Flag: WC UpTime: 00:13:46 Upstream interface: GigabitEthernet3/0/0 Upstream neighbor: 192.168.1.2 RPF prime neighbor: 192.168.1.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet2/0/0 Protocol: igmp, UpTime: 00:13:46, Expires:- (10.110.3.100, 225.1.1.1) RP: 192.168.4.2 Protocol: pim-sm, Flag: SPT ACT UpTime: 00:00:42 Upstream interface: GigabitEthernet1/0/0 Upstream neighbor: 192.168.5.2 RPF prime neighbor: 192.168.5.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet2/0/0 Protocol: pim-sm, UpTime: 00:00:42, Expires:- [RouterB] display pim routing-table VPN-Instance: public net Total 1 (*, G) entry; 1 (S, G) entry (*, 225.1.1.1) RP: 192.168.4.2 Protocol: pim-sm, Flag: WC UpTime: 00:10:12 Upstream interface: GigabitEthernet1/0/0 Upstream neighbor: 192.168.2.2 RPF prime neighbor: 192.168.2.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet2/0/0 Protocol: igmp, UpTime: 00:10:12, Expires:- (10.110.3.100, 225.1.1.1) RP: 192.168.4.2 Protocol: pim-sm, Flag: SPT ACT UpTime: 00:00:42 Upstream interface: GigabitEthernet1/0/0 Upstream neighbor: 192.168.2.2 RPF prime neighbor: 192.168.2.2 Downstream interface(s) information: Total number of downstreams: 1 1: GigabitEthernet2/0/0 Protocol: pim-sm, UpTime: 00:00:30, Expires:-
Configuration Files
RouterA configuration file
# sysname RouterA # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 192.168.5.1 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 10.110.1.1 255.255.255.0 pim silent pim sm igmp enable # interface GigabitEthernet3/0/0 ip address 192.168.1.1 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 10.110.1.0 0.0.0.255 network 192.168.1.0 0.0.0.255 network 192.168.5.0 0.0.0.255 # pim static-rp 192.168.2.2 # return
RouterB configuration file
# sysname RouterB # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 192.168.2.1 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 10.110.2.1 255.255.255.0 pim sm igmp enable # ospf 1 area 0.0.0.0 network 10.110.2.0 0.0.0.255 network 192.168.2.0 0.0.0.255 # pim static-rp 192.168.2.2 # return
RouterC configuration file
# sysname RouterC # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 10.110.2.2 255.255.255.0 pim sm igmp enable # interface GigabitEthernet2/0/0 ip address 192.168.3.1 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 10.110.2.0 0.0.0.255 network 192.168.3.0 0.0.0.255 # pim static-rp 192.168.2.2 # return
RouterD configuration file
# sysname RouterD # multicast routing-enable # interface GigabitEthernet1/0/0 ip address 10.110.3.1 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 10.110.4.1 255.255.255.0 pim sm pim bsr-boundary # interface GigabitEthernet3/0/0 ip address 192.168.1.2 255.255.255.0 pim sm # interface GigabitEthernet4/0/0 ip address 192.168.4.1 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 10.110.3.0 0.0.0.255 network 10.110.4.0 0.0.0.255 network 192.168.1.0 0.0.0.255 network 192.168.4.0 0.0.0.255 # pim static-rp 192.168.2.2 # return
RouterE configuration file
# sysname RouterE # multicast routing-enable # acl number 2008 rule 5 permit source 225.1.1.0 0.0.0.255 # interface GigabitEthernet1/0/0 ip address 192.168.5.2 255.255.255.0 pim sm # interface GigabitEthernet2/0/0 ip address 192.168.3.2 255.255.255.0 pim sm # interface GigabitEthernet3/0/0 ip address 192.168.2.2 255.255.255.0 pim sm # interface GigabitEthernet4/0/0 ip address 192.168.4.2 255.255.255.0 pim sm # ospf 1 area 0.0.0.0 network 192.168.2.0 0.0.0.255 network 192.168.3.0 0.0.0.255 network 192.168.4.0 0.0.0.255 network 192.168.5.0 0.0.0.255 # pim c-bsr GigabitEthernet4/0/0 c-rp GigabitEthernet4/0/0 group-policy 2008 static-rp 192.168.2.2 # return