Description

This article explores route filters, their match types, and how to use them effectively with a practical example.

Solution

A route filter is a set of match conditions applied to routes to identify prefixes based on specified criteria. It enables precise control over which routes to import, export, or act upon in routing policies.

 

Route Filter Match Types - To understand how route filters work, consider the prefix 10.19.0.0/16 as the base example. Here are the commonly used match types:

 

1) Exact – The route must have the same prefix length. This would mean a route of 10.19.0.0/16 will match, but any 10.19.0.0 route with a longer prefix will not.
 
2) Longer – The prefix length of the route must be longer than the prefix specified. This would mean 10.19.0.0/16 would not match, but anything longer will. For example 10.19.0.0/20 or 10.19.0.0/24
 
3) Orlonger – The prefix length of the route can be equal to or longer. You can think of this as combining the exact and longer match types.
 
4) Upto – Matches from the specified prefix up to the prefix length you specify. So 10.19.0.0/16 upto /24 will match all routes in 10.19.0.0/16 up to a prefix-length of /24

Example of using route filter: Below is an example where a route filter is used to match a 10.19.1.2/32 exact route and import it into another routing instance.

set policy-options policy-statement Master-to-ABC term 1 from instance master
set policy-options policy-statement Master-to-ABC term 1 from route-filter 10.19.1.2/32 exact
set policy-options policy-statement Master-to-ABC term 1 then accept
set policy-options policy-statement Master-to-ABC term 2 then reject

After defining the routing policy, apply it to the desired routing instance where you want the route to be imported. This configuration ensures that the specified route is imported from the inet.0 table into the ABC routing instance.
 
[edit]
root@jtac-srx# show |display set
set routing-instances ABC routing-options instance-import Master-to-ABC
 
[edit]
root@jtac-srx#
 

Modification History

2024-11-23 : Article Created