To specify a route list, include one or more route-filter or source-address-filter options in the from statement of the policy-statement at the [edit policy-options policy-statement policy-name term term-name] hierarchy level:
- [edit policy-options policy-statement policy-name term term-name]
- from {
- route-filter prefix match-type <actions>;
- source-address-filter source-prefix match-type <actions>;
- }
- then actions;
The route-filter option is typically used to match prefixes of any type except for unicast source addresses.
The source-address-filter option is typically used to match unicast source addresses in multiprotocol BGP (MBGP) and Multicast Source Discovery Protocol (MSDP) environments.
source-prefix is the IPv4 or IPv6 prefix specified as prefix/prefix-length. If you omit prefix-length for an IPv4 prefix, the default is /32. If you omit prefix-length for an IPv6 prefix, the default is /128. Prefixes specified in a from statement must be either all IPv4 addresses or all IPv6 addresses.
match-type is the type of match to apply to the destination prefix. It can be one of the match types listed in Table 25. For examples of the match types and the results when presented with various routes, see Table 26.
actions is the action to take if the destination prefix matches. It can be one or more of the actions listed in Table 15 and Table 16.
In route lists, you can specify actions in two ways:
The upto and prefix-length-range match types are similar in that both specify the most-signifcant bits and provide a range of prefix lengths that can match. The difference is that upto allows you to specify an upper limit only for the prefix length range, whereas prefix-length-range allows you to specify both lower and upper limits.
For more examples of these route list match types, see Examples: Configuring Route Lists.
Table 25: Route List Match Types for a Prefix List
|
Match Type |
Match Condition |
|---|---|
|
exact |
The route shares the same most-significant bits (described by prefix-length), and prefix-length is equal to the route’s prefix length. |
|
longer |
The route shares the same most-significant bits (described by prefix-length), and prefix-length is greater than the route’s prefix length. |
|
orlonger |
The route shares the same most-significant bits (described by prefix-length), and prefix-length is equal to or greater than the route’s prefix length. |
|
prefix-length-range prefix-length2–prefix-length3 |
The route shares the same most-significant bits (described by prefix-length), and the route’s prefix length falls between prefix-length2 and prefix-length3, inclusive. |
|
through destination-prefix |
All the following are true:
You do not use the through match type in most routing policy configurations. (For an example, see Examples: Configuring Route Lists.) |
|
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. |
Table 26: Match Type Examples