How to Configure a Login Banner on Junos Devices
How Junos Speeds Up the Data Center Network
How to Tighten the Password on Junos Root Login

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 {
     action;
   }
  term my-second-term {
   from neighbor 10.22.32.1;
   then {
     action;
   }
}

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
Collapse Switching Layers with Junos to Optimize Switching Infrastructure
How to Include Severity Values in Junos Syslog Messages
Help Tools in Junos Command-Line Interface (CLI)
Commands to Monitor Interfaces on Junos Devices
How to Configure BGP Route Reflection
Advertisement

Inside Dummies.com