Related Documentation
- ACX Series
- Example: Controlling Static Routes in Routing and Forwarding Tables
- M Series
- Example: Controlling Static Routes in Routing and Forwarding Tables
- MX Series
- Example: Controlling Static Routes in Routing and Forwarding Tables
- T Series
- Example: Controlling Static Routes in Routing and Forwarding Tables
Example: Enabling Indirect Next Hops on the Packet Forwarding Engine
Understanding Indirect Next Hops
Junos OS supports the concept of an indirect next hop for all routing protocols that support indirectly connected next hops, also known as third-party next hops.
Because routing protocols such as internal BGP (IBGP) can send routing information about indirectly connected routes, Junos OS relies on routes from intra-AS routing protocols (OSPF, IS-IS, RIP, and static) to resolve the best directly connected next hop. The Routing Engine performs route resolution to determine the best directly connected next hop and installs the route to the Packet Forwarding Engine.
By default, Junos OS does not maintain the route for indirect next hop to forwarding next-hop binding on the Packet Forwarding Engine forwarding table. As a result, when a rerouting event occurs, potentially thousands of route to forwarding next-hop bindings must be updated, which increases the route convergence time. Figure 1 illustrates the route to forwarding next-hop bindings with indirect next hop disabled.
Figure 1: Route to Forwarding Next-Hop Bindings

You can enable 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. Figure 2 illustrates the route to forwarding next-hop bindings with indirect next hop enabled.
Figure 2: Route to Forwarding Indirect Next-Hop Bindings

See Also
- M Series
- Example: Optimizing Route Reconvergence by Enabling Indirect Next Hops on the Packet Forwarding Engine
- PTX Series
- Example: Optimizing Route Reconvergence by Enabling Indirect Next Hops on the Packet Forwarding Engine
- SRX Series
- Example: Optimizing Route Reconvergence by Enabling Indirect Next Hops on the Packet Forwarding Engine
- T Series
- Example: Optimizing Route Reconvergence by Enabling Indirect Next Hops on the Packet Forwarding Engine
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 3 shows the sample network.
Figure 3: Sample Topology for Indirect Next Hops

The CLI Quick Configuration section shows the full configuration on all of the devices in Figure 3. 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 fe-1/2/0 unit 1 family inet address 10.0.0.1/30user@R0# set lo0 unit 1 family inet address 1.1.0.1/32user@R0# set lo0 unit 1 family inet address 1.1.0.2/32user@R0# set lo0 unit 1 family inet address 1.1.0.3/32user@R0# set lo0 unit 1 family inet address 1.1.0.4/32user@R0# set lo0 unit 1 family inet address 1.1.0.5/32user@R0# set lo0 unit 1 family inet address 1.1.0.6/32user@R0# set lo0 unit 1 family inet address 1.1.0.7/32user@R0# set lo0 unit 1 family inet address 1.1.0.8/32user@R0# set 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 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 fe-1/2/0 unit 2 family inet address 10.0.0.2/30user@R1# set fe-1/2/1 unit 5 family inet address 10.0.0.5/30user@R1# set fe-1/2/2 unit 9 family inet address 10.0.0.9/30user@R1# set lo0 unit 2 family inet address 1.1.1.1/32
Configure BGP.
[edit protocols]user@R1# set bgp export send-localuser@R1# set bgp export send-staticuser@R1# set bgp group int type internaluser@R1# set bgp group int local-address 1.1.1.1user@R1# set bgp group int neighbor 2.2.2.2- Configure OSPF.[edit protocols]user@R1# set ospf area 0.0.0.0 interface fe-1/2/1.5user@R1# set ospf area 0.0.0.0 interface fe-1/2/2.9user@R1# set ospf area 0.0.0.0 interface lo0.2
- Configure the routing policies.[edit]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 acceptuser@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.[edit]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.[edit]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 fe-1/2/0 unit 14 family inet address 10.0.0.14/30user@R2# set fe-1/2/1 unit 18 family inet address 10.0.0.18/30user@R2# set fe-1/2/2 unit 21 family inet address 10.0.0.21/30;user@R2# set lo0 unit 3 family inet address 2.2.2.2/32
Configure BGP.
[edit]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]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.[edit]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.[edit]user@R2# set routing-options autonomous-system 65500
- Enable indirect next hops in the forwarding plane.[edit]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-hopshow krt indirect-next-hop
Indirect Nexthop:
Index: 1048575 Protocol next-hop address: 10.255.3.1
RIB Table: __mpls-oam__.mpls.0
Label: Swap 299968
Policy Version: 0 References: 1
Locks: 2 0x95bc514
Flags: 0x3
INH Session ID: 0xa
INH Version ID: 1
Ref RIB Table: unknown
Next hop: 50.50.244.9 via ge-2/0/2.0
Label operation: Swap 299968, Push 299792(top)
Label TTL action: no-prop-ttl, no-prop-ttl(top)
Session Id: 0x9
IGP FRR Interesting proto count : 0
Meaning
The 0x3 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 from the configuration, this flag changes to 0x2. Junos MX series routers with Trio Modular Port Concentrator (MPC) chipset supports indirect-next-hop by default and can not be disabled. Thus, even if indirect-next-hop is not configured under forwarding-options, the feature will work by default. Thus, 0x3 flag is not applicable for Trio Modular Port Concentrator (MPCs).
![]() | 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. |
See Also
- ACX Series
- Understanding Indirect Next Hops
- M Series
- Understanding Indirect Next Hops
- SRX Series
- Understanding Indirect Next Hops
- T Series
- Understanding Indirect Next Hops
Related Documentation
- ACX Series
- Example: Controlling Static Routes in Routing and Forwarding Tables
- M Series
- Example: Controlling Static Routes in Routing and Forwarding Tables
- MX Series
- Example: Controlling Static Routes in Routing and Forwarding Tables
- T Series
- Example: Controlling Static Routes in Routing and Forwarding Tables


