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.




dummies

Source:http://www.dummies.com/how-to/content/how-to-apply-a-routing-policy-to-all-traffic-using.html

No comments:

Post a Comment