JNCIA-Junos study materials
JNCIA-Junos study resources

JNCIA-Junos: Routing Fundamentals

JNCIA-Junos · Work through your exam, one topic at a time.

All guide sections

Routing Fundamentals

RIB and FIB

The Routing Engine computes routes and rpd builds the routing table. For each prefix only the best route is active and installed into the forwarding table used by the PFE. In show route output, * marks an active route and > a selected route. A route that cannot be installed is shown as hidden with a reason - see show route hidden and show route detail.

Preference (Junos's answer to administrative distance)

Lower preference wins. Defaults: directly connected 0, static 5, OSPF internal 10, IS-IS level 1 internal 15, IS-IS level 2 internal 18, RIP 100, OSPF AS external 150, IS-IS external 160/165, BGP 170. Preference is compared only between routes for the same prefix, and it is editable.

Selection order

  1. Longest prefix match; 2) lowest preference; 3) lowest metric within the same protocol; 4) tie-breakers such as router ID, peer address or configuration order.

Static routes

set routing-options static route 0.0.0.0/0 next-hop 10.1.1.1. The next hop must be resolvable through a direct or known route, or the static route never becomes active. Options include discard (silently drop matching traffic), reject (return ICMP unreachable), no-readvertise, and qualified-next-hop for per-next-hop preference.

Traps

  • Believing a higher preference is better; it is worse.
  • Believing preference beats prefix length; longest match is always evaluated first.
  • Configuring an unreachable next hop and expecting the route to install.

Worked example

A static default 0.0.0.0/0 via the ISP (preference 5) competes with an OSPF default (preference 10); the static route wins. But for destination 10.1.1.1, an OSPF-learned 10.0.0.0/8 still wins over both defaults because it is the longest match.