Forcing Traffic Through a Specific Next-Hop by Setting Static Route Preference
Your Juniper router is running OSPF with multiple neighbors. You have a prefix 10.10.10.0/24 that is being learned via OSPF from two different routers: Router A with metric 30 and Router B with metric 20. The OSPF route from Router B is active. You want to ensure that traffic to 10.10.10.0/24 uses the path through Router A instead, even though it has a higher metric. You cannot change the OSPF metric on Router A. Which action should you take?
⚠ Common exam trap
Candidates often confuse metric (cost) with preference (administrative distance) and think they must change the metric or reject routes, when in fact JUNOS allows preference manipulation via routing policies to influence route selection without altering the OSPF metric.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use a routing policy to increase the preference of the OSPF route from Router B.
In JUNOS, route preference (administrative distance) determines which route is installed in the routing table when multiple protocols or sources provide the same prefix. By default, OSPF internal routes have a preference of 10. You can use a routing policy to increase the preference of the OSPF route from Router B (making it less preferred), which will cause the route from Router A (with its default preference of 10) to become active, even though its metric is higher. This approach does not require changing the OSPF metric or removing the route from Router A.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use a routing policy to increase the preference of the OSPF route from Router B.
Why this is correct
Using a routing policy to increase the preference of the OSPF route from Router B makes that route less desirable in the Junos routing table. Since Junos selects the route with the lowest preference value, raising Router B's preference (say, from the default 10 to 15) leaves Router A's default OSPF route as the active path. This allows you to influence the active route selection centrally on the local router without changing OSPF metrics or filtering prefixes.
- ✗
Increase the metric on Router B for that prefix.
Why it's wrong here
In OSPF, the metric for a prefix is generated by the router that originates the route, so you cannot directly modify Router B's metric from your local device unless you control Router B's configuration. Even if you could increase that metric, it would affect the route's desirability for every neighbor, potentially leading to suboptimal routing elsewhere rather than simply preferring Router A. Moreover, the OSPF metric is just one factor in route selection; changing it is not a clean way to achieve local preference.
- ✗
Use a routing policy to reject the OSPF route from Router A.
Why it's wrong here
Rejecting the OSPF route from Router A in a routing policy would prevent that route from being installed into the local routing table, leaving only Router B's route for 10.10.10.0/24. That directly contradicts the goal of making Router A the preferred path; instead it forces traffic to Router B, which is exactly what you are trying to avoid. Additionally, an import policy that denies a route is applied to all prefixes from that neighbor, so it may unintentionally impact other OSPF-learned routes.
- ✗
Configure a static route to 10.10.10.0/24 pointing to Router A.
Why it's wrong here
A static route to 10.10.10.0/24 pointing to Router A would have a default preference of 5 in Junos, which is lower than OSPF's internal preference of 10. That means the static route would replace the OSPF route as the active route, but it is no longer an OSPF route—it is a manually configured static entry. This loses OSPF's dynamic convergence, may become stale if the network changes, and does not actually choose between the two OSPF paths, so it is not a valid way to achieve the intended preference.
Visual reference
Quick reference
Routing Protocol Comparison
| Protocol | Metric | Max Hops | Algorithm | Type |
|---|---|---|---|---|
| RIP v2 | Hop count | 15 | Bellman-Ford | Distance vector |
| OSPF | Cost (bandwidth) | Unlimited | Dijkstra (SPF) | Link state |
| EIGRP | Composite metric | Unlimited | DUAL | Hybrid |
| IS-IS | Cost | Unlimited | Dijkstra | Link state |
| BGP | Policy / attributes | Unlimited | Path vector | Path vector |
RIP's 15-hop limit makes it unsuitable for large networks. OSPF and EIGRP dominate modern enterprise deployments.
Go deeper
Related to this question
About these practice questions
This JN0-106 question is part of Courseiva's 326-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on JN0-106
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A router has an OSPF route to 10.10.10.0/24 with preference 10 and a static route to the same prefix with preference 5. Which route is active in the routing table?
easy- A.The OSPF route
- ✓ B.The static route
- C.Neither route
- D.Both routes
Why B: In Junos, the active route in the routing table is determined by the route preference (administrative distance). A lower preference value indicates a more trusted route. Here, the static route has a preference of 5, which is lower than the OSPF route's preference of 10, so the static route is preferred and becomes active.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This JN0-106 practice question is part of Courseiva's free Juniper Networks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the JN0-106 exam.