Example: Configuring Nonstop Active Routing for PIM
Understanding Nonstop Active Routing for PIM
Nonstop active routing configurations include two Routing Engines that share information so that routing is not interrupted during Routing Engine failover. When nonstop active routing is configured on a dual Routing Engine platform, the PIM control state is replicated on both Routing Engines.
This PIM state information includes:
- Neighbor relationships
- Join and prune information
- RP-set information
- Synchronization between routes and next hops and the forwarding state between the two Routing Engines
The PIM control state is maintained on the backup Routing Engine by the replication of state information from the master to the backup Routing Engine and having the backup Routing Engine react to route installation and modification in the [instance].inet.1 routing table on the master Routing Engine. The backup Routing Engine does not send or receive PIM protocol packets directly. In addition, the backup Routing Engine uses the dynamic interfaces created by the master Routing Engine. These dynamic interfaces include PIM encapsulation, de-encapsulation, and multicast tunnel interfaces.
![]() | Note: The clear pim join, clear pim register, and clear pim statistics operational mode commands are not supported on the backup Routing Engine when nonstop active routing is enabled. |
To enable nonstop active routing for PIM (in addition to the PIM configuration on the master Routing Engine), you must include the following statements at the [edit] hierarchy level:
- chassis redundancy graceful-switchover
- routing-options nonstop-routing
- system commit synchronize
Example: Configuring Nonstop Active Routing with PIM
This example shows how to configure nonstop active routing for PIM-based multicast IPv4 and IPv6 traffic.
Requirements
Before you begin:
- Configure the router interfaces. See the Network Interfaces Configuration Guide.
- Configure an interior gateway protocol or static routing. See the Routing Protocols Configuration Guide.
- Configure a multicast group membership protocol (IGMP or MLD). See Understanding IGMP and Understanding MLD.
- For this feature to work with IPv6, the routing device must be running Junos OS Release 10.4 or above.
Overview
Junos OS supports nonstop active routing in the following PIM scenarios:
- Dense mode
- Sparse mode
- SSM
- Static RP
- Auto-RP (for IPv4 only)
- Bootstrap router
- Embedded RP on the non-RP router (for IPv6 only)
- BFD support
![]() | Note: Multicast VPNs are not supported with nonstop active routing. Policy-based features (such as neighbor policy, join policy, BSR policy, scope policy, flow maps, and RPF check policy) are not supported with nonstop active routing. |
This example uses static RP. The interfaces are configured to receive both IPv4 and IPv6 traffic. R2 provides RP services as the local RP. Note that nonstop active routing is not supported on the RP router. The configuration shown in this example is on R1.
Figure 1 shows the topology used in this example.
Figure 1: Nonstop Active Routing in PIM Domain

Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
R1
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure nonstop active routing on R1:
Synchronize the Routing Engines.
Enable graceful Routing Engine switchover.
[edit]user@host# set chassis redundancy graceful-switchoverConfigure R1’s interfaces.
[edit]user@host# edit interfaces[edit interfaces]user@host# set so-0/0/1 unit 0 description "to R0 so-0/0/1.0" user@host# set so-0/0/1 unit 0 family inet address 10.210.1.2/30 user@host# set so-0/0/1 unit 0 family inet6 address FDCA:9E34:50CE:0001::2/126 user@host# set fe-0/1/3 unit 0 description "to R2 fe-0/1/3.0" user@host# set fe-0/1/3 unit 0 family inet address 10.210.12.1/30 user@host# set fe-0/1/3 unit 0 family inet6 address FDCA:9E34:50CE:0012::1/126 user@host# set fe-1/1/0 unit 0 description "to H1" user@host# set fe-1/1/0 unit 0 family inet address 10.240.0.250/30 user@host# set fe-1/1/0 unit 0 family inet6 address ::10.240.0.250/126 user@host# set lo0 unit 0 description "R1 Loopback" user@host# set lo0 unit 0 family inet address 10.210.255.201/32 primary user@host# set lo0 unit 0 family iso address 47.0005.80ff.f800.0000.0108.0001.0102.1025.5201.00 user@host# set lo0 unit 0 family inet6 address abcd::10:210:255:201/128 user@host# exitConfigure OSPF for IPv4 on R1.
[edit]user@host# edit protocols ospf[edit protocols ospf]user@host# set traffic-engineeringuser@host# set area 0.0.0.0 interface so-0/0/1.0 metric 100 user@host# set area 0.0.0.0 interface fe-0/1/3.0 metric 100 user@host# set area 0.0.0.0 interface lo0.0 passive user@host# set area 0.0.0.0 interface fxp0.0 disable user@host# set area 0.0.0.0 interface fe-1/1/0.0 passiveConfigure OSPF for IPv6 on R1.
[edit]user@host# edit protocols ospf3[edit protocols ospf3]user@host# set area 0.0.0.0 interface fe-1/1/0.0 passive user@host# set area 0.0.0.0 interface fe-1/1/0.0 metric 1 user@host# set area 0.0.0.0 interface lo0.0 passive user@host# set area 0.0.0.0 interface so-0/0/1.0 metric 1 user@host# set area 0.0.0.0 interface fe-0/1/3.0 metric 1Configure PIM on R1. The PIM static address points to the RP router (R2).
[edit]user@host# edit [edit protocols pim]user@host# set protocols pim rpstatic address 10.210.255.202 user@host# set protocols pim rp static address abcd::10:210:255:202 user@host# set protocols pim interface lo0.0 user@host# set protocols pim interface fe-0/1/3.0 mode sparse user@host# set protocols pim interface fe-0/1/3.0 version 2 user@host# set protocols pim interface so-0/0/1.0 mode sparse user@host# set protocols pim interface so-0/0/1.0 version 2 user@host# set protocols pim interface fe-1/1/0.0 mode sparse user@host# set protocols pim interface fe-1/1/0.0 version 2Configure per-packet load balancing on R1.
[edit]user@host# edit policy-options policy-statement load-balance[edit policy-options policy-statement load-balance]user@host# set then load-balance per-packetApply the load-balance policy on R1.
[edit]user@host# set routing-options forwarding-table export load-balanceConfigure nonstop routing on R1.
[edit]user@host# set routing-options nonstop-routinguser@host# set routing-options router-id 10.210.255.201
Step-by-Step Procedure
For troubleshooting, configure system log and tracing operations.
- Enable system log messages.[edit]user@host# set system syslog archive size 10m user@host# set system syslog file messages any info
- Trace interface operations.[edit]user@host# set interfaces traceoptions file dcd-trace user@host# set interfaces traceoptions file size 10m user@host# set interfaces traceoptions file files 10 user@host# set interfaces traceoptions flag all
- Trace IGP operations for IPv4.[edit]user@host# set protocols ospf traceoptions file r1-nsr-ospf2 user@host# set protocols ospf traceoptions file size 10m user@host# set protocols ospf traceoptions file files 10 user@host# set protocols ospf traceoptions file world-readable user@host# set protocols ospf traceoptions flag error user@host# set protocols ospf traceoptions flag lsa-update detail user@host# set protocols ospf traceoptions flag flooding detail user@host# set protocols ospf traceoptions flag lsa-request detail user@host# set protocols ospf traceoptions flag state detail user@host# set protocols ospf traceoptions flag event detail user@host# set protocols ospf traceoptions flag hello detail user@host# set protocols ospf traceoptions flag nsr-synchronization detail
- Trace IGP operations for IPv6.[edit]user@host# set protocols ospf3 traceoptions file r1-nsr-ospf3 user@host# set protocols ospf3 traceoptions file size 10m user@host# set protocols ospf3 traceoptions file world-readable user@host# set protocols ospf3 traceoptions flag lsa-update detail user@host# set protocols ospf3 traceoptions flag flooding detail user@host# set protocols ospf3 traceoptions flag lsa-request detail user@host# set protocols ospf3 traceoptions flag state detail user@host# set protocols ospf3 traceoptions flag event detail user@host# set protocols ospf3 traceoptions flag hello detail user@host# set protocols ospf3 traceoptions flag nsr-synchronization detail
- Trace PIM operations.[edit]user@host# set protocols pim traceoptions file r1-nsr-pim user@host# set protocols pim traceoptions file size 10m user@host# set protocols pim traceoptions file files 10 user@host# set protocols pim traceoptions file world-readable user@host# set protocols pim traceoptions flag mdt detail user@host# set protocols pim traceoptions flag rp detail user@host# set protocols pim traceoptions flag register detail user@host# set protocols pim traceoptions flag packets detail user@host# set protocols pim traceoptions flag autorp detail user@host# set protocols pim traceoptions flag join detail user@host# set protocols pim traceoptions flag hello detail user@host# set protocols pim traceoptions flag assert detail user@host# set protocols pim traceoptions flag normal detail user@host# set protocols pim traceoptions flag state detail user@host# set protocols pim traceoptions flag nsr-synchronization
- Trace all routing protocol functionality.[edit]user@host# set routing-options traceoptions file r1-nsr-sync user@host# set routing-options traceoptions file size 10m user@host# set routing-options traceoptions flag nsr-synchronization user@host# set routing-options traceoptions flag commit-synchronize
- Trace forwarding table operations.[edit]user@host# set routing-options forwarding-table traceoptions file r1-nsr-krt user@host# set routing-options forwarding-table traceoptions file size 10m user@host# set routing-options forwarding-table traceoptions file world-readable user@host# set routing-options forwarding-table traceoptions flag queue user@host# set routing-options forwarding-table traceoptions flag route user@host# set routing-options forwarding-table traceoptions flag routes user@host# set routing-options forwarding-table traceoptions flag synchronous user@host# set routing-options forwarding-table traceoptions flag state user@host# set routing-options forwarding-table traceoptions flag asynchronous user@host# set routing-options forwarding-table traceoptions flag consistency-checking
If you are done configuring the device, commit the configuration.
[edit]user@host# commit
Results
From configuration mode, confirm your configuration by entering the show chassis, show interfaces, show policy-options, show protocols, show routing-options, and show system commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.
Verification
To verify the configuration, run the following commands:
- show pim join extensive
- show pim neighbors inet detail
- show pim neighbors inet6 detail
- show pim rps inet detail
- show pim rps inet6 detail
- show multicast route inet extensive
- show multicast route inet6 extensive
- show route table inet.1 detail
- show route table inet6.1 detail
Configuring PIM Sparse Mode Graceful Restart
You can configure PIM sparse mode to continue to forward existing multicast packet streams during a routing process failure and restart. Only PIM sparse mode can be configured this way. The routing platform does not forward multicast packets for protocols other than PIM during graceful restart, because all other multicast protocols must restart after a routing process failure. If you configure PIM sparse-dense mode, only sparse multicast groups benefit from a graceful restart.
The routing platform does not forward new streams until after the restart is complete. After restart, the routing platform refreshes the forwarding state with any updates that were received from neighbors during the restart period. For example, the routing platform relearns the join and prune states of neighbors during the restart, but it does not apply the changes to the forwarding table until after the restart.
When PIM sparse mode is enabled, the routing platform generates
a unique 32-bit random number called a generation identifier. Generation
identifiers are included by default in PIM hello messages, as specified
in the Internet draft draft-ietf-pim-sm-v2-new-10.txt
. When a routing platform receives PIM hello messages containing
generation identifiers on a point-to-point interface, the Junos OS
activates an algorithm that optimizes graceful restart.
Before PIM sparse mode graceful restart occurs, each routing platform creates a generation identifier and sends it to its multicast neighbors. If a routing platform with PIM sparse mode restarts, it creates a new generation identifier and sends it to neighbors. When a neighbor receives the new identifier, it resends multicast updates to the restarting router to allow it to exit graceful restart efficiently. The restart phase is complete when the restart duration timer expires.
Multicast forwarding can be interrupted in two ways. First, if the underlying routing protocol is unstable, multicast RPF checks can fail and cause an interruption. Second, because the forwarding table is not updated during the graceful restart period, new multicast streams are not forwarded until graceful restart is complete.
You can configure graceful restart globally or for a routing instance. This example shows how to configure graceful restart globally.
To configure graceful restart for PIM sparse mode:
- Enable graceful restart.[edit protocols pim]user@host# set graceful-restart
- (Optional) Configure the amount of time the routing device
waits (in seconds) to complete PIM sparse mode graceful restart. By
default, the router allows 60 seconds. The range is from 30 through
300 seconds. After this restart time, the Routing Engine resumes normal
multicast operation.[edit protocols pim graceful-restart]user@host# set restart-duration 120
- Monitor the operation of PIM graceful restart by running the show pim neighbors command. In the command output, look for the G flag in the Option field. The G flag stands for generation identifier. Also run the show task replication command to verify the status of GRES and NSR.