Supported Platforms
Example: Optimizing Route Reconvergence by Enabling Indirect Next Hops on the Packet Forwarding Engine
This example shows how to use indirect next hops to promote faster network convergence (for example, in BGP networks) by decreasing the number of forwarding table changes required when a change in the network topology occurs.
Requirements
No special configuration beyond device initialization is required before configuring this example.
Overview
In this example, several devices are connected over unequal-cost paths. From Device R1 to Device R2, the path through Device R3 has a higher IGP metric than the path through Device R4. Device R1 has an internal BGP connection to Device R2. Device R0 injects multiple routes into the network, and Device R1 advertises those routes to Device R2. Because Device R2 is not directly connected to Device R1, Device R2’s forwarding table contains indirect next hops. An interior gateway protocol, in this case OSPF, is running on the internal links among Devices R1, R2, R3, and R4. Each router is advertising its loopback interface IPv4 address.
On Device R2, the indirect-next-hop statement enables Junos OS to maintain the indirect next hop to forwarding next-hop binding on the Packet Forwarding Engine forwarding table. As a result, fewer route to forwarding next-hop bindings need to be updated, which improves the route convergence time if a path fails.
Figure 1 shows the sample network.
Figure 1: Sample Topology for Indirect Next Hops

The CLI Quick Configuration section shows the full configuration on all of the devices in Figure 1. Otherwise, the example focuses on Device R0, Device R1, and Device R2.
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.
Device R0
Device R1
Device R2
Device R3
Device R4
Device R5
Configuring Device R0
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 Device R0:
- Configure the interfaces, including multiple routes that
can be injected into the network for demonstration purposes.[edit interfaces]user@R0# set interfaces fe-1/2/0 unit 1 family inet address 10.0.0.1/30
user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.1/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.2/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.3/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.4/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.5/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.6/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.7/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.8/32user@R0# set interfaces lo0 unit 1 family inet address 1.1.0.9/32 Configure a static default route for network reachability.
[edit routing-options]user@R0# set routing-options static route 0.0.0.0/0 next-hop 10.0.0.2If you are done configuring the device, commit the configuration.
[edit]user@R0# commit
Configuring Device 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 Device R1:
- Configure the interfaces, including multiple routes that
can be injected into the network for demonstration purposes.[edit interfaces]user@R1# set interfaces fe-1/2/0 unit 2 family inet address 10.0.0.2/30user@R1# set interfaces fe-1/2/1 unit 5 family inet address 10.0.0.5/30user@R1# set interfaces fe-1/2/2 unit 9 family inet address 10.0.0.9/30
user@R1# set interfaces lo0 unit 2 family inet address 1.1.1.1/32 Configure BGP.
[edit routing-options]user@R1# set protocols bgp export send-localuser@R1# set protocols bgp export send-staticuser@R1# set protocols bgp group int type internaluser@R1# set protocols bgp group int local-address 1.1.1.1user@R1# set protocols bgp group int neighbor 2.2.2.2- Configure OSPF.[edit protocols]user@R1# set protocols ospf area 0.0.0.0 interface fe-1/2/1.5user@R1# set protocols ospf area 0.0.0.0 interface fe-1/2/2.9user@R1# set protocols ospf area 0.0.0.0 interface lo0.2
- Configure the routing policies.user@R1# set policy-options policy-statement send-local from protocol localuser@R1# set policy-options policy-statement send-local from protocol directuser@R1# set policy-options policy-statement send-local then accept
user@R1# set policy-options policy-statement send-static from protocol staticuser@R1# set policy-options policy-statement send-static then accept - Configure a set of static routes to the set of interfaces
configured on Device R0.user@R1# set routing-options static route 1.1.0.2/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.1/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.3/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.4/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.5/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.6/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.7/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.8/32 next-hop 10.0.0.1user@R1# set routing-options static route 1.1.0.9/32 next-hop 10.0.0.1
- Configure the autonomous system (AS) identifier.user@R1# set routing-options autonomous-system 65500
If you are done configuring the device, commit the configuration.
[edit]user@R1# commit
Configuring Device R2
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 Device R2:
- Configure the interfaces, including multiple routes that
can be injected into the network for demonstration purposes.[edit interfaces]user@R2# set interfaces fe-1/2/0 unit 14 family inet address 10.0.0.14/30user@R2# set interfaces fe-1/2/1 unit 18 family inet address 10.0.0.18/30user@R2# set interfaces fe-1/2/2 unit 21 family inet address 10.0.0.21/30;
user@R2# set interfaces lo0 unit 3 family inet address 2.2.2.2/32 Configure BGP.
[edit routing-options]user@R2# set protocols bgp export send-localuser@R2# set protocols bgp group int type internaluser@R2# set protocols bgp group int local-address 2.2.2.2user@R2# set protocols bgp group int family inet unicastuser@R2# set protocols bgp group int family inet-vpn unicastuser@R2# set protocols bgp group int neighbor 1.1.1.1- Configure OSPF.[edit protocols]user@R2# set protocols ospf area 0.0.0.0 interface fe-1/2/0.14user@R2# set protocols ospf area 0.0.0.0 interface fe-1/2/1.18user@R2# set protocols ospf area 0.0.0.0 interface lo0.3
- Configure the routing policies.user@R2# set policy-options policy-statement send-local from protocol localuser@R2# set policy-options policy-statement send-local from protocol directuser@R2# set policy-options policy-statement send-local then accept
- Configure the AS identifier.user@R2# set routing-options autonomous-system 65500
- Enable indirect next hops in the forwarding plane.user@R2# set routing-options forwarding-table indirect-next-hop
If you are done configuring the device, commit the configuration.
[edit]user@R2# commit
Results
Confirm your configuration by issuing the show interfaces, show protocols, show policy-options, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Device R0
Device R1
Device R2
Configure Device R3, Device R4, and Device R5, as shown in CLI Quick Configuration.
Verification
Confirm that the configuration is working properly.
Verifying That the Routes Have the Expected Indirect-Next-Hop Flag
Purpose
Make sure that Device R2 is configured to maintain the indirect next hop to forwarding next-hop binding on the Packet Forwarding Engine forwarding table.
Action
user@R2> show krt indirect-next-hop
Indirect Nexthop: Index: 262143 Protocol next-hop address: 1.1.1.1 RIB Table: inet.0 Policy Version: 0 References: 4 Locks: 2 0x9290488 Flags: 0x1 Ref RIB Table: unknown Next hop: 10.0.0.17 via fe-1/2/1.18 Indirect Nexthop: Index: 262142 Protocol next-hop address: 10.0.0.1 RIB Table: inet.0 Policy Version: 0 References: 9 Locks: 2 0x9290570 Flags: 0x1 Ref RIB Table: unknown Next hop: 10.0.0.17 via fe-1/2/1.18
Meaning
The 0x1 flag in the output indicates that Device R2 is configured to maintain the indirect next hop to forwarding next-hop binding on the Packet Forwarding Engine forwarding table. When the indirect-next-hop statement is deleted or deactivated, this flag changes to 0x0.
![]() | Note: The show krt indirect-next-hop command is hidden and is therefore undocumented. The show krt indirect-next-hop command is shown here because this is the only command that verifies the indirect next-hop feature. The best verification method is, of course, monitoring network performance during reconvergence after a path failure. |