O'Reilly logo

Junos® OS For Dummies®, 2nd Edition by Michael Bushong, Cathy Gadecki, Walter Goralski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring Route Filters

The fundamental purpose of routing policies is to prevent certain routes from being either accepted into your routing table or advertised to some adjacent router. Sometimes, matching specific routes or a set of routes is useful. To do so, you use a route filter.

Route filters match on specific IP addresses or ranges of prefixes. Much like other routing policies, they include some match criteria and then a corresponding match action. The basic configuration resembles the following:

[edit policy-options]
policy-statement my-route-filter {
   term router-filter-term {
      from {
         router-filter prefix/prefix-length match-type;
      }
      then {
         actions;
      }
   }
}

This basic configuration outline matches a route against the specified filter. If the route matches, the defined action is taken. If it doesn't, the next term or policy is evaluated. As with other policies, if no match occurs, the protocol default action executes.

An important difference between route filters and other policy match conditions is how multiple filters are handled. If you have more than one match condition, the conditions are treated as a logical AND, meaning all of them must be true for it to be considered a match. With route filters, the presence of multiple filters represents a logical OR, meaning it's a match if the route matches any of the configured filters.

Prefixes and prefix lengths

If you want to effectively create route filters, you need to make sure that you understand route prefixes and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required