Study guide

7.1 Routing Policy Framework & Term Evaluation

JNCIS-ENT Enterprise Routing and Switching Study Guide 2026 Exam

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Exam Overview & Junos Enterprise Fundamentals

1.1 JNCIS-ENT Exam Logistics & Blueprint Breakdown 1.2 Junos CLI, Enterprise Platforms & Interface Families 1.3 Layer 2 Bridging Mechanics & Packet Forwarding

2 Chapter 2: VLANs & Inter-VLAN Routing

2.1 VLAN Segmentation and 802.1Q Tags 2.2 Access, Trunk, Native and Voice VLANs 2.3 IRB Architecture and Interface Families 2.4 IRB Configuration and Packet Walk 2.5 VLAN Configuration, Verification & Troubleshooting

3 Chapter 3: Spanning Tree Protocols

3.1 Layer 2 Loops and Root Bridge Election 3.2 STP Costs, Port Roles, States and BPDUs 3.3 RSTP Rapid Convergence & Link Types 3.4 MSTP Architecture & Spanning Tree Operations

4 Chapter 4: Layer 2 Security & Feature Protection

4.1 Edge BPDU and Root Protection 4.2 Loop Protection and Diagnostic States 4.3 Port Security, MAC Limiting & Persistent MAC Learning 4.4 DHCP Snooping, Dynamic ARP Inspection (DAI) & IP Source Guard 4.5 Layer 2 Firewall Filters: Types, Order and Actions

5 Chapter 5: Advanced Layer 2 Features & Storm Control

5.1 Storm Control & Broadcast/Multicast Suppression 5.2 MACsec Link Security and Key Agreement 5.3 LLDP and LLDP-MED Operations & Verification

6 Chapter 6: Protocol-Independent Routing & Load Balancing

6.1 Static, Aggregate, and Generated Routes 6.2 Routing Instances and RIB Groups 6.3 Junos Load Balancing & Filter-Based Forwarding (FBF) 6.4 Martian Routes and Route Acceptance

7 Chapter 7: Junos Routing Policy & Firewall Filters

7.1 Routing Policy Framework & Term Evaluation 7.2 Prefix Lists & Route Filters 7.3 Firewall Filters & Policers

8 Chapter 8: Open Shortest Path First (OSPF) Operation

8.1 OSPF Architecture & Neighbor Adjacency Formation 8.2 OSPF Areas & LSA Types 8.3 OSPFv2 & OSPFv3 Configuration and Verification

9 Chapter 9: Advanced OSPF Features & Routing Policies

9.1 OSPF Special Area Types 9.2 Route Summarization & OSPF Authentication 9.3 OSPF Diagnostics & Common Failure Scenarios

10 Chapter 10: Intermediate System to Intermediate System (IS-IS)

10.1 IS-IS Encapsulation and NET Identity 10.2 IS-IS Levels, Areas and Default Routing 10.3 IS-IS PDU Families and Neighbor Exchange 10.4 IS-IS Database Synchronization and DIS 10.5 IS-IS Configuration, Metrics & Troubleshooting

11 Chapter 11: Border Gateway Protocol (BGP)

11.1 BGP Roles, AS Numbers and TCP Transport 11.2 EBGP/IBGP Sessions, State Machine and Messages 11.3 BGP Attributes & Junos Path Selection Algorithm 11.4 BGP Configuration & Policy Implementation 11.5 BGP Scaling with Route Reflection & Diagnostics

12 Chapter 12: IP Tunneling & High Availability

12.1 GRE & IP-IP Tunneling Architecture 12.2 Link Aggregation (LAG/LACP) & Redundant Trunk Groups (RTG) 12.3 Virtual Chassis Roles and Elections 12.4 Virtual Chassis Links, Splits and Provisioning 12.5 Routing Engine Redundancy: GRES, NSR, NSB and GR 12.6 BFD Detection and VRRP Gateway Redundancy 12.7 Unified ISSU: Requirements and Verification

7.1 Routing Policy Framework & Term Evaluation

Key Takeaways Explain This Topic AI

Routing policies in Junos OS control route flow at two distinct junctions: importing routes from dynamic protocols into the Routing Information Base (inet.0) and exporting active routes from inet.0 into dynamic routing protocols.

Default routing policies vary strictly by protocol: BGP imports all valid routes and exports all active BGP routes, whereas OSPF/IS-IS flood their native link-state information; export policy controls redistribution and import policy affects supported local RIB installation.

A Junos policy statement comprises ordered terms evaluated sequentially from top to bottom; each term contains optional 'from' match criteria (evaluated with logical AND across conditions) and 'then' actions.

Terminating actions ('accept' and 'reject') halt policy evaluation immediately, while flow-control actions ('next term' and 'next policy') allow subsequent terms or chained policy statements to be evaluated.

If an evaluated route reaches the end of a policy chain without matching any explicit term with a terminating action, Junos executes the implicit protocol default action of the protocol where the policy is applied.

Last updated: October 2026

Routing Policy Framework & Term Evaluation

In Junos OS, routing policy provides a centralized, deterministic framework for controlling the exchange of routing information between protocol processes and the Routing Information Base (RIB, known as inet.0 for IPv4 unicast). While dynamic routing protocols calculate reachability based on standard algorithm metrics, enterprise network architects deploy routing policies to enforce administrative boundaries, redistribute routes across protocol boundaries, manipulate route path attributes, and prevent routing loops. Mastering policy construction, term execution order, and implicit protocol defaults is a core competency for the JNCIS-ENT examination.

1. Architectural Role of Routing Policies in Junos OS

Junos OS strictly decouples the control plane (running on the Routing Engine) from the forwarding plane (running on the Packet Forwarding Engine). Within the Routing Engine (RE), the routing protocol daemon ( rpd ) manages all routing protocols and maintains the routing table ( inet.0 ). Routing policies operate directly within rpd at two distinct junctions: Import and Export . +---------------------------------------------------------------------------------------------------+

  • | JUNOS ROUTING POLICY INTERACTION ARCHITECTURE |
  • +---------------------------------------------------------------------------------------------------+
  • | |
  • | +-------------------+ +------------------+ +-------------------+ |
  • | | Incoming Protocol | ====> | Routing Table | ====> | Outgoing Protocol | |
  • | | Updates (BGP/OSPF)| | (inet.0) | | Advertisements | |
  • | +-------------------+ +------------------+ +-------------------+ |
  • | | | | |
  • | v v v |
  • | [ IMPORT POLICY ] Active Route [ EXPORT POLICY ] |
  • | Controls which routes Selection Algorithm Controls which active |
  • | enter inet.0 (Preference/Metric) routes leave inet.0 |
  • | |
  • +---------------------------------------------------------------------------------------------------+
  • Import Policies vs. Export Policies

Import Policy: Evaluates routes received from routing protocol peers or neighbors before those routes are accepted into the Routing Information Base ( inet.0 ). An import policy can filter unwanted routes, alter route preferences, or tag prefixes before they participate in the route selection process.

Export Policy: Evaluates routes currently residing in inet.0 before advertising them to neighboring routers via dynamic routing protocols. An export policy controls redistribution (e.g., introducing static or direct routes into OSPF or BGP) and manipulates protocol-specific attributes (such as BGP AS-path, communities, or OSPF external metrics).

The Golden Active-Route Rule: Normal export uses active eligible routes . Hidden routes are unusable. Special features such as BGP advertise-inactive or add-path change normal advertisement behavior; they are explicit exceptions rather than evidence that every inactive route is exportable.

2. Junos Default Routing Policies by Protocol

When no user-defined routing policy is applied, Junos OS enforces built-in default routing policies . These defaults vary significantly across protocols to preserve protocol integrity and prevent accidental transit routing.

Protocol Default Import Behavior Default Export Behavior Technical Rationale

BGP Accept all valid BGP routes into inet.0 . Export all active BGP routes to peers; Reject all non-BGP routes. Facilitates global reachability exchange by default while blocking unintentional redistribution of IGP or static routes into the BGP autonomous system.

OSPF Accept all valid LSAs into the Link-State Database (LSDB). Reject all non-OSPF routes by default. (Native OSPF routes flood automatically). OSPF requires identical LSDB synchronization across all routers within an area; RIB import policy does not filter the area’s LSA flooding. Redistribution requires an explicit policy.

IS-IS Accept all valid LSPs into the Level 1 and Level 2 LSDBs. Reject all non-IS-IS routes by default. (Native IS-IS routes flood automatically). IS-IS import policy can restrict local RIB installation without changing LSP flooding or another router’s LSDB. Redistribution of external routes requires an explicit export policy.

RIP Accept all valid RIP updates from configured neighbors. Reject all routes by default. Prevents distance-vector routing loops and unbounded count-to-infinity propagation unless an administrator explicitly defines an export policy.

The Link-State Protocol Filtering Trap on the JNCIS-ENT Exam

A frequent misconception among enterprise engineers involves attempting to filter intra-area OSPF routes using an import policy. In Junos OS, you cannot filter OSPF intra-area (Area 0 or non-backbone) routes using an import policy . Because OSPF uses Dijkstra's Shortest Path First (SPF) algorithm, every router within an area must maintain an identical link-state database. If individual routers suppressed specific LSAs locally via import policies, the SPF tree would partition, causing catastrophic routing loops or black holes. Policy filtering in OSPF can only occur at Area Border Routers (ABRs) via summarization and type 3 LSA filtering, or at Autonomous System Boundary Routers (ASBRs) via export policies redistributing external routes (Type 5/7 LSAs).

3. Structure of a Junos Policy Statement

Junos routing policies are defined centrally under the [edit policy-options] hierarchy and applied within the respective protocol or routing-options stanza. A policy statement consists of one or more named terms that house match conditions ( from ) and actions ( then ). [edit policy-options]

  • policy-statement <policy-name> {
  • term <term-name> {
  • from {
  • <match-conditions>;
  • }
  • then {
  • <actions>;
  • <action-modifiers>;
  • }
  • }
  • }
  • Evaluation Logic Inside a Term

Multiple Match Conditions ( from ): When multiple distinct match conditions are defined within a single term (e.g., matching both a protocol and a prefix list), Junos evaluates them using a logical AND . The route must satisfy all specified match criteria to trigger the term's action.

Multiple Arguments within a Single Match Condition: If a single match condition contains multiple arguments (e.g., from protocol [ ospf static direct ] ), Junos evaluates them using a logical OR . If the route matches any listed argument, that specific condition is satisfied.

Omitting the from Statement: If a term contains no from statement, it automatically matches all routes . Any route evaluated by this term immediately executes the specified then action.

Omitting a terminating action: Attribute changes do not themselves accept or reject a route. Evaluation proceeds through later terms/policies until a terminating action or the protocol default resolves the result.

4. Term Evaluation Mechanics: Terminating vs. Flow-Control Actions

Junos OS evaluates policy terms in strict sequential order from top to bottom . The first term in the stanza is evaluated first; if a route does not match, the second term is evaluated, continuing down the list.

Terminating Actions

Terminating actions immediately conclude evaluation for the route. Once a terminating action executes, Junos halts all further processing—no subsequent terms or policies in the chain are evaluated for that route:

accept : Accepts the route (installs it into inet.0 if an import policy, or advertises it if an export policy) and immediately terminates policy evaluation.

reject : Silently drops or blocks the route (prevents installation into inet.0 or prevents protocol advertisement) and immediately terminates policy evaluation.

Flow-Control Actions

Flow-control actions override the default termination behavior, enabling complex multi-stage evaluation pipelines:

next term : Applies configured route attribute modifiers and moves to evaluate the next term within the same policy statement. This is commonly used to apply an action modifier (like setting an administrative tag or community) before testing the route against subsequent criteria.

next policy : Skips all remaining terms in the current policy statement and moves directly to evaluate the first term of the next policy statement in a chained policy list.

Action Modifiers (Non-Terminating Properties)

Action modifiers alter the attributes of a route without terminating evaluation (unless coupled with an explicit terminating action):

metric <value> : Sets the internal multi-exit discriminator (MED) or protocol cost.

preference <value> : Overrides the default Junos route preference (administrative distance).

community (add | set | delete) <name> : Manipulates BGP community attributes.

as-path-prepend <asn-sequence> : Prepends autonomous system numbers to influence inbound BGP traffic.

tag <value> : Applies an internal 32-bit administrative tag used for downstream filtering. [edit policy-options policy-statement tag-and-accept]

  • set term term-1 from protocol static
  • set term term-1 then tag 200
  • set term term-1 then next term
  • set term term-2 from tag 200
  • set term term-2 then metric 50
  • set term term-2 then accept
  • 5. Policy Chains and The Implicit Protocol Default Action

In enterprise configurations, multiple policy statements can be applied in a chained list to an interface, protocol, or peer group: [edit protocols bgp group ebgp-peers]

user@router# set export [ scrub-routes set-communities advertise-prefixes ]

When a route is evaluated against a chained policy list:

The route enters scrub-routes and evaluates its terms sequentially.

If a term executes accept or reject , evaluation terminates completely.

If the route does not match any term, or if a term executes next policy , evaluation moves to the first term of set-communities .

If the route traverses all terms in all chained policies without matching an explicit terminating action, it encounters the implicit default protocol action .

The Implicit Default Fallthrough Trap: The implicit default action at the end of a policy chain is not a universal accept or reject. It is strictly determined by the protocol to which the policy is applied! If you apply a custom export policy to BGP that only matches and rejects RFC 1918 subnets, all other active BGP routes fall through to the end of the policy and are advertised by BGP's default export policy (which exports active BGP routes). Conversely, in OSPF export, any route falling through the policy is rejected by OSPF's default export policy.

Official references checked 2026-10-18: Protocol defaults and import scope .

Loading diagram... Junos Routing Policy Term Evaluation & Action Branching Flow