[Contents] [Prev] [Next] [Index]


Configure Route Lists

You can use routing policy to filter routes. You do this with route lists, which allow you to evaluate and process routes quickly. Using route lists, you can match groups of routes and then perform a common action on them, or you can perform an action on each individual route immediately.

To specify route prefixes in policies, include one or more route-filter options in the from statement of the policy-statement statement:

 [edit]
 policy-options { 
 	 policy-statement policy-name { 
 	 	 term term-name {
 	 	 	 from {
 	 	 	 	 match-conditions;
 	 	 	 	 route-filter destination-prefix match-type <actions>;
 	 	 	 	 prefix-list name;
 	 	 	 }
 	 	 	 to {
 	 	 	 	 match-conditions;
 	 	 	 }
 	 	 	 then actions;
 	 	 }
 	 prefix-list name {
 	 	 ip-addresses;
 	 }
 }
 

destination-prefix is the IP prefix specified as prefix/prefix-length. If you omit prefix-length, the default is /32.

match-type is the type of match to apply to the destination prefix. It can be one of the match types listed in Table 6. For examples of using the match types, see Examples: Specify Route Lists in Policies.

prefix-list name is the name of a list of IP address prefixes. For information on creating a named list of IP address prefixes, see Define a List of IP Address Prefixes.

actions is the action to take if the destination prefix matches. It can be one or more of the actions listed in Table 3 and Table 4.

In route lists, you can specify actions in two ways:

Table 6: Route List Match Types
Match Type
Match If ...
exact
prefix matches the route's prefix exactly, and prefix-length is equal to the route's prefix length.
longer
prefix matches the route's prefix exactly, and prefix-length is greater than the route's prefix length.
orlonger
prefix matches the route's prefix exactly, and prefix-length is equal to or greater than the route's prefix length.
upto prefix-length2
The route shares the same most-significant bits (described by prefix-length) and the route's prefix length falls between prefix-length and prefix-length2.
through destination-prefix
Matches all the following:
  • Route matches first destination prefix
  • Route matches second destination prefix for the number of bits in the prefix length
  • Number of bits in the route's prefix length is less than or equal to the number of bits in the second prefix
The through match type covers a corner case and you do not use it in most policy configurations.

 

To determine whether a route matches a prefix in the route list, all the prefixes in the route list are examined and a longest-match lookup is performed. (The order of different prefixes within the route list is not significant.) If a match occurs, the action associated with that prefix is taken. If the lookup does not yield a match, the policy term does not match the route.

 



If you specify multiple prefixes in the route list, only one prefix need match for a match to occur. The route list matching is effectively a logical OR operation.

 

Within a route list, you can configure the same destination prefix multiple times. In this case, the order of the prefixes is important, because the list of identical prefixes is searched linearly, and the first match type that matches the candidate route applies. In the following example, different match types are specified on the same prefix. The route 0.0.0.0/0 would be rejected, while the route 0.0.0.0/8 would be marked with next-hop self.

 0.0.0.0/0 exact reject;
 0.0.0.0/0 longer next-hop self;



[Contents] [Prev] [Next] [Index]