Online Test Banks
Score higher
See Online Test Banks
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

How to Apply a Routing Policy to All Traffic Using Junos

At times, you may want a routing policy to apply to all routing protocol traffic regardless of the match condition. That is, you need to “match all routes.” In these cases, all you need to do is omit the from statement within the policy. If there is no from statement, Junos OS applies the match action to all traffic:

[edit policy-options]
policy-statement accept-all-routes {
  term accept-all {
   then accept;

In this case, because there is nothing to match against, all routing protocol traffic is subject to the specified action. In this case, all routes are accepted for import or export, depending on how you apply the policy.

This last configuration is actually a little different than what you’ll see on the router. Because you have only a single match condition, the router simplifies the configuration and collapses multiple lines into one, omitting the brackets:

[edit policy-options]
policy-statement my-sample-policy {
  term my-first-term {
   from protocol ospf;
   then {
  term my-second-term {
   from neighbor;
   then {

The preceding configuration is identical in meaning to the previous my-sample-policy, but it’s streamlined a bit and matches what you’ll see in the configuration file if you issue a show configuration command after creating the policy.

blog comments powered by Disqus

Inside Sweepstakes

Win $500. Easy.