Live Experience

How Juniper Routing Policy Works.
A advantage of route lists over prefix lists is that each prefix can include an action. When a match occurs, the action is taken immediately instead of waiting to reach the then clause. When the list of prefixes is long, this speeds up the processing of routing traffic. The following simple policy illustrates how this works:
[edit policy-options policy-statement prefix-policy term 1 ]
# set from route-filter upto /7 accept 
# set from route-filter orlonger 
# set then reject 
[This policy accepts prefixes up to /7 and rejects everything longer.]
You can also use route lists as another way to manipulate the routing information in a route. Instead of screening routes by protocol or by other routing information they contain, you filter by destination prefix:
[edit policy-statement set-metric-igp]
# set term 1 from route-filter exact
# set term 1 from route-filter exact
# set term 1 from route-filter exact
# set term 1 then local-preference 300
# set term 1 then accept
# set term 2 then reject
# show
policy-statement set-metric-igp {
   term 1 {
        from {
             route-filter exact;
             route-filter exact;
             route-filter exact;
        then {
             preference 300;
   term 2 {
        then reject;
[This configuration sets the BGP local preference value on three specific prefixes and rejects any other prefixes]
When you create a policy you must apply it to your configured protocol. Because you create a policy and you must call this policy. Like:
# set protocols bgp group external-group import "PolicyName"


You are here: Home / Firewall & Policy / How Routing Policy Works.