PracticeVideosBlogFlashcards

6.1 Static, Aggregate, and Generated Routes

Key Takeaways

  • Static routes in Junos OS are configured under [edit routing-options static] and carry a default route preference of 5, making them strictly preferred over internal OSPF (10) and IS-IS (15/18) routes.

  • Junos supports multiple next-hop options including remote IP addresses, point-to-point interfaces, discard (silent drop), and reject (drops traffic and returns an ICMP destination unreachable message).

  • Qualified next-hops enable deterministic floating static routes under a single prefix entry without requiring separate route configuration stanzas.

  • Aggregate routes require at least one active more-specific contributing route in the routing table, carry a default preference of 130, and install a reject next-hop by default.

  • Generated routes also require active contributing routes and share preference 130, but uniquely inherit the forwarding next-hop of the primary contributing route instead of dropping traffic.

Last updated: October 2026

Static, Aggregate, and Generated Routes

In Junos OS, protocol-independent routing features provide granular forwarding control without relying on dynamic neighbor negotiations or routing protocol update packets. Enterprise network engineers deploy static routes for predictable path selection, aggregate routes for hierarchical route summarization, and generated routes for conditional default routing. Mastering their configuration syntax, default route preferences, and forwarding behaviors is vital for the JNCIS-ENT examination.


1. Junos Static Routing Architecture

Static routes in Junos are defined globally under the [edit routing-options static] hierarchy or locally within a specific routing instance under [edit routing-instances <name> routing-options static]. Unlike dynamic protocols that periodically refresh reachability, static routes remain in the Routing Information Base (RIB, known as inet.0 for IPv4 unicast) while their next hop satisfies the configured resolution rules; an installed ARP-reachable subnet does not guarantee the remote service is healthy.

Next-Hop Types and Forwarding Actions

When configuring a static route in Junos, several next-hop types can be specified:

[edit routing-options static]
user@router# set route <destination-prefix> next-hop <target>
Next-Hop OptionForwarding BehaviorCommon Enterprise Use Case
IPv4 / IPv6 AddressResolves the Layer 3 address to an egress interface using connected reachability by default; supported recursive resolution requires its applicable resolve configuration.Standard gateway pointing to a neighboring router or upstream firewall.
Interface NameTransmits packets directly out the specified physical or logical interface.Strictly valid only on point-to-point links (e.g., GRE tunnels, serial links). Not valid on broadcast Ethernet interfaces without an explicit IP next-hop.
discardSilently drops matched packets without generating any ICMP error response back to the sender.Null-routing unauthorized subnets, blackholing DDoS traffic, or mitigating forwarding loops.
rejectDrops matched packets and immediately generates an ICMP Destination Unreachable (host or network unreachable) packet sent back to the source IP.Route summarization boundaries where downstream subnets do not exist, providing clean diagnostic feedback to clients.

Critical Junos Rule: You cannot configure an Ethernet interface (such as ge-0/0/0.0) as the bare next-hop of a static route on a broadcast multi-access network. Because Ethernet networks require Address Resolution Protocol (ARP) to map Layer 3 IP addresses to Layer 2 MAC addresses, Junos cannot resolve which specific host on the multi-access segment should receive the frame. An IP next-hop is mandatory on broadcast Ethernet links unless a qualified point-to-point encapsulation is used.


2. Qualified Next-Hops and Floating Static Routes

In conventional network operating systems, creating a backup "floating" static route requires entering a completely independent static route command containing an artificially inflated administrative distance. In Junos OS, multiple next-hops are organized cleanly under a single route prefix entry using the qualified-next-hop statement.

Qualified Next-Hop Configuration

Consider a scenario where an enterprise branch router forwards traffic toward corporate headquarters (10.50.0.0/16) via a primary high-speed fiber link (192.168.1.1), with a secondary cellular backup gateway (192.168.2.1):

[edit routing-options static]
user@router# set route 10.50.0.0/16 next-hop 192.168.1.1
user@router# set route 10.50.0.0/16 qualified-next-hop 192.168.2.1 preference 150

Under this configuration:

  1. The primary next-hop 192.168.1.1 inherits the default static route preference of 5.
  2. The secondary next-hop 192.168.2.1 is assigned an explicit preference of 150.
  3. Because lower preference values are superior in Junos, the primary next-hop is actively installed into the forwarding table (Packet Forwarding Engine).
  4. If the interface connecting to 192.168.1.1 goes operationally down or the next-hop becomes unreachable, Junos automatically activates the qualified next-hop 192.168.2.1 with preference 150 without deleting the route entry.

3. Junos Default Route Preferences (Administrative Distance)

Junos OS utilizes Route Preference (analogous to Administrative Distance in other platforms) to rank routes learned from different routing protocols or mechanisms. When multiple protocols offer a path to the exact same prefix, Junos installs the route with the lowest preference value into the active forwarding table.

+---------------------------------------------------------------------------------------------------+
| JUNOS OS DEFAULT ROUTE PREFERENCE VALUES                                                          |
+----------------------------------+------------------+---------------------------------------------+
| Routing Source / Protocol        | Default Value    | Operational Characteristics                 |
+----------------------------------+------------------+---------------------------------------------+
| Direct Interface Route           | 0                | Directly connected active subnet            |
| Local Interface Route            | 0                | Assigned IP address on router interface     |
| Static Route                     | 5                | Default static configuration                |
| OSPF Internal                    | 10               | Both intra-area (Area 0) and inter-area     |
| IS-IS Level 1 Internal           | 15               | Intra-area link-state routes                |
| IS-IS Level 2 Internal           | 18               | Inter-area backbone link-state routes       |
| RIP                              | 100              | Distance-vector routing updates             |
| Aggregate Route                  | 130              | Route summarization sink (reject next-hop)  |
| Generated Route                  | 130              | Route summarization with inherited next-hop |
| OSPF External (Type 5 / Type 7)  | 150              | AS-external and NSSA redistributed routes   |
| IS-IS Level 1 External           | 160              | Redistributed routes into Level 1           |
| IS-IS Level 2 External           | 165              | Redistributed routes into Level 2           |
| BGP (Both EBGP and IBGP)         | 170              | Uniform preference for all BGP routes       |
+----------------------------------+------------------+---------------------------------------------+

Critical Preference Traps on the JNCIS-ENT Exam

  • Static vs. OSPF Internal: In Cisco IOS, static routes have an administrative distance of 1, beating OSPF (110). In Junos, static routes have a preference of 5, which also beats internal OSPF (10). However, if an engineer configures a qualified static next-hop with preference 12, an internal OSPF route (preference 10) will supersede that static route!
  • Uniform BGP Preference: Many networking vendors assign EBGP an administrative distance of 20 and IBGP an administrative distance of 200. In Junos OS, both EBGP and IBGP share an identical default route preference of 170. Junos prefers EBGP over IBGP during the internal BGP path selection algorithm tie-breaker, not through the initial route preference mechanism.
  • OSPF External vs. Internal: OSPF intra-area and inter-area routes share preference 10, whereas OSPF external routes (Type 5 LSAs redistributed from static or BGP) receive a preference of 150, making them less preferred than IS-IS internal routes (15 and 18).

4. Aggregate Routes

An aggregate route (routing-options aggregate route <prefix>) synthesizes multiple more-specific routes into a broader summary prefix advertised to upstream peers. This reduces link-state database bloat and shields neighboring routers from flapping subnets.

Operating Characteristics of Aggregate Routes

  1. Contributing Route Requirement: By default, an aggregate route is inactive without a contributor; passive is an explicit exception. It requires at least one active, more-specific route within its address boundary present in the routing table (known as a contributing route). For example, configuring aggregate 172.16.0.0/16 requires an active route such as 172.16.1.0/24 or 172.16.2.0/24 in inet.0. If all contributing routes disappear, Junos makes the aggregate inactive unless configured otherwise.
  2. Default Next-Hop Action: By default, an aggregate route installs a reject next-hop in the forwarding table. If transit traffic arrives addressed to an IP within 172.16.0.0/16 that does not match an existing, more-specific subnet, the router drops the packet and responds with an ICMP unreachable message.
  3. Default Route Preference: Aggregate routes carry a default preference of 130.
  4. Policy Filtering: Contributing routes can be selectively restricted using the policy <policy-name> statement under the aggregate definition.
[edit routing-options]
user@router# set aggregate route 172.16.0.0/16
user@router# set aggregate route 172.16.0.0/16 policy filter-contributing-subnets

5. Generated Routes: The Forwarding Alternative

A generated route (routing-options generate route <prefix>) operates similarly to an aggregate route in that it synthesizes a prefix based on the presence of contributing routes. However, it exhibits one fundamental, high-impact distinction: a generated route inherits the forwarding next-hop of its primary contributing route.

Mechanics of Generated Routes

While an aggregate route functions as a summary route intended to blackhole/reject unassigned address space, a generated route is designed to actively forward packets. When multiple contributing routes exist within the generated prefix boundary, Junos elects a primary contributing route using the following deterministic selection sequence:

  1. Prefer the contributing route with the lowest route preference, then its preference2 where applicable.
  2. Break a remaining tie using the numerically lowest destination prefix, rather than its next-hop address.
  3. If destination addresses tie, use the lower prefix length. Only a usable forwarding contributor supplies a generated route’s next hop.

The generated route extracts the physical next-hop interface and gateway address from this primary contributing route and installs them as its own forwarding destination in the forwarding table.

Enterprise Use Case: Conditional Default Routing

A common enterprise design pattern is generating a default route (0.0.0.0/0) conditioned upon upstream transit reachability:

[edit routing-options]
user@router# set generate route 0.0.0.0/0 policy match-public-bgp

In this deployment, the router only introduces and maintains a default route in inet.0 as long as active BGP routes matching match-public-bgp exist in the table. Furthermore, all transit packets matched to 0.0.0.0/0 are forwarded directly out the next-hop of the primary contributing BGP route. If the upstream provider links fail and the BGP routes withdraw, the generated default route automatically collapses, preventing internal hosts from sending packets into a dead-end link.


6. Comparison: Static vs. Aggregate vs. Generated Routes

FeatureStatic RouteAggregate RouteGenerated Route
Hierarchy[edit routing-options static][edit routing-options aggregate][edit routing-options generate]
Default Preference5130130
Contributing Routes Needed?No (remains active as long as next-hop is resolvable)Yes (requires at least one active more-specific route)Yes (requires at least one active more-specific route)
Default Next-Hop ActionSpecified target IP, interface, discard, or rejectreject (drops traffic & sends ICMP unreachable)Inherited from the primary contributing route
Forwarding CapabilityForwards directly or drops based on configured targetSinks non-contributing transit trafficActively forwards transit traffic toward primary contributor
Primary Enterprise UseFixed host routes, edge default paths, out-of-band managementBGP/OSPF route summarization, loop suppressionConditional default routes tied to upstream transit availability

7. Verification and Troubleshooting CLI Commands

To inspect protocol-independent routes in Junos OS, utilize the following operational commands:

user@router> show route 10.50.0.0/16 detail
user@router> show route 172.16.0.0/16 exact
user@router> show route table inet.0 protocol aggregate
user@router> show route table inet.0 protocol static

When evaluating aggregate or generated routes, appending the detail or extensive switch displays the active contributing routes, the primary contributor, and the exact next-hop inheritance tree. If an aggregate route is missing from show route, verify that at least one contributing route exists in inet.0 with an active next-hop.

Output note: Command output shown here is a schematic teaching example, not a captured device session. Field names and feature support depend on platform and Junos release.

Official references checked 2026-10-18: Contributor selection.

Loading diagram...
Contributing Route Evaluation: Aggregate vs Generated Routes
Test Your Knowledge

When an aggregate route is configured in Junos OS under [edit routing-options aggregate route 172.16.0.0/12], what is the default next-hop behavior applied to packets destined to unassigned subnets within that aggregate block?

A

Junos forwards the packet to the next-hop of the lowest-metric contributing route.

B

Junos silently drops the packet using a discard next-hop without notifying the sender.

C

Junos drops the packet and transmits an ICMP destination unreachable message back to the sender using a reject next-hop.

D

Junos floods the packet out all active interfaces participating in the primary routing instance.

Test Your Knowledge

An EX Series switch learns the prefix 10.100.0.0/16 via internal OSPF (intra-area) with a metric of 20, via EBGP with an AS-path length of 1, and also has a static route configured for 10.100.0.0/16 with default settings. Which route will Junos OS install as active in inet.0?

A

The static route, because Junos assigns static routes a default preference of 5, which beats OSPF internal (preference 10) and BGP (preference 170).

B

The OSPF route, because dynamic routing protocols always supersede static configurations in Junos unless qualified.

C

The EBGP route, because external BGP carries an administrative preference of 20 in Junos.

D

Both the static and OSPF routes, resulting in equal-cost load sharing across both next-hops.

Test Your Knowledge

An engineer needs to create a summary route in Junos OS that only remains active as long as at least one public BGP route exists in the routing table, and the summary route must actively forward transit packets out the next-hop of the primary contributing route. Which Junos routing-options statement meets these criteria?

A

set routing-options static route 0.0.0.0/0 qualified-next-hop discard preference 130

B

set routing-options aggregate route 0.0.0.0/0 policy match-bgp-routes

C

set routing-options rib-groups default-leak import-rib [ inet.0 default.inet.0 ]

D

set routing-options generate route 0.0.0.0/0 policy match-bgp-routes

Sections you finish are checked off in the contents.