The article provides details if Juniper validates next hop reachability in static route
The route is present in routing table even though the next hop is not reachable .[This kind of routes will be mostly static routes]
Below is the topology and results verified in Lab :
Topology:
QFX1[20.0.0.1]-------------[20.0.0.2]QFX2 [30.0.0.2]----------[30.0.0.1]QFX3
Lab configuration and Results:
QFX1> show configuration routing-options |display set
set routing-options static route 30.0.0.0/30 next-hop 20.0.0.2
set routing-options static route 30.0.0.1/32 next-hop 20.0.0.2
Test1:
>>In order to reach 30.0.0.1 when static route is configured on QFX1 with next hop 20.0.0.2, when we run "show route" command , we can see static routein routing table with next hop 20.0.0.2. [Which is the ideal scenario]
QFX1> ping 20.0.0.2 rapid
PING 20.0.0.2 (20.0.0.2): 56 data bytes
!!!!!
--- 20.0.0.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 119.107/192.919/230.745/38.891 ms
QFX1>
show route
inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0
hidden)
+ = Active Route, - = Last Active, * = Both
20.0.0.0/30 *[Direct/0] 04:42:17
> via xe-0/0/1.0
20.0.0.1/32 *[Local/0] 04:42:17
Local via xe-0/0/1.0
30.0.0.0/30 *[Static/5] 04:42:17
> to 20.0.0.2 via xe-0/0/1.0
70.0.0.0/30 *[Direct/0] 06:59:06
> via xe-0/0/2.0
70.0.0.1/32 *[Local/0] 06:59:06
Local via xe-0/0/2.0
Test2:
>>When the next hop 20.0.0.2 is not
reachable and there is no arp present in
“arp table” still the static route is
present in routing table with next hop 20.0.0.2
qfx1>
20.0.0.0/30 *[Direct/0] 04:38:51
20.0.0.1/32 *[Local/0] 04:38:51
30.0.0.0/30 *[Static/5] 04:38:51
>to 20.0.0.2 via xe-0/0/1.0
70.0.0.0/30 *[Direct/0] 06:55:40
70.0.0.1/32 *[Local/0] 06:55:40
>>From the above tests we see , the static route is present on the device even when the next hop is not reachable as the directly connected interface is up and the IP address is the same subnet as the next hop.
>>The static route is present in the table as we have the next hop network address is present in the routing table which is as seen below
config on QFX1 :
set interfaces xe-0/0/1.0 family inet address 20.0.0.1/30
QFX1> show route
20.0.0.1/32 *[Local/0] 04:42:17. >>>>>>>>Local IP configured on the interface
In general the route selection, the reachability is decided by checking the next hop route entry in the routing table. If a valid entry for the next-hop is present in the routing table , the destination route will be placed in the routing and forwarding table.