Routing policies for EVPN
Create routing policies to control the EVPN routing information that will be imported and exported to the different routing tables.
Routing policies allow you to control the routing information that are imported and exported to the routing and forwarding tables. Starting in Junos OS 19.4R1, Junos has expanded routing policy support to include the creation and application of policy filters specific to EVPN routes.
Policies can be applied at the routing-instance level or at a BGP level. When you apply policies at the BGP level, they effect all EVPN routing instances. When applied at the routing-instance level, they effect the specified EVPN routing instance only. To apply the policy at the BGP level, include the vpn-apply-export statement at the [edit protocols bgp] hierarchy level and import or export the policy. To apply the policy at the routing-instance level, use vrf-export or vrf-import statement to apply the policy for that particular routing instance.
Policies are composed of match conditions, actions, and terms. For more information on policies, see Policy Framework Overview.
Table 1 lists the match conditions supported for use in filtering EVPN routes.
Table 1: List of Match Conditions for Filtering EVPN Routes
BGP EVPN routes can have a set of EVPN extended communities carried in the BGP update message path attribute, and as such, you can use these extended communities for filtering BGP EVPN routes. The EVPN specific information available in extended communities includes, for example, encapsulation type, MAC-mobility information, EVPN split-horizon label information, EVPN ESI split-horizon label, ESI mode, E-tree leaf label, and more.
Use the following syntax to specify BGP EVPN extended communities:
All values (including type) are in decimal; type is 2 octets, with the higher-order octet defining the type of extended community, and the low-order octet defining the community sub-type. val1 and val2 can be specified as [2 + 4] octets, or as [4 + 2] octets.
The extended communities most commonly used with BGP EVPN routes are provided here.
For full list of Extended Communities please refer to Border Gateway Protocol (BGP) Extended Communities .
You can filter BGP EVPN routes on the basis of Ethernet Segment Identifiers (ESIs) information for routes types 1, 2, 4, 7, and 8, which are the only types to include the ESI attribute in their prefix. (ESI values are encoded as 10-byte integers and are used to identify a multihomed segment.) Note that the evpn-esi matching statement is valid only together with “family evpn” matching statement.
You can filter BGP EVPN routes on the basis of EVPN Ethernet Tag information, which is part of the prefix of the EVPN route. This matching statement is valid only together with family evpn match statement.
Filtering BGP EVPN Type 2 routes based on if it has any IP address.
EVPN Type 2 MAC/IP Advertisement routes can have IP address in the prefix along with MAC address. The IP address carried in the MAC-IP Advertisement route can be either IPv4 or IPv6 address. It is possible to filter out Type 2 routes based on MAC address only, MAC+IPv4 address, or MAC+IPv6 address. To do so requires the following CLI statement be set:
Note that this match statement is valid only together with the family evpn match statement.
Set the local preference (LOCAL_PREF) attribute. The preference value can be a number in the range from 0 through 4,294,967,295.
(BGP only) Named MAC filter list. EVPN Type 2 routes have MAC address as part of the prefix, which you can use to create a list of MAC addresses.
Metric corresponds to the MED, and metric2 corresponds to the IGP metric if the BGP next hop loops through another router. You can specify up to four metric values, metric, metric2, metric3, and metric4.
next-hop (address | discard | next-table table-name | peer-address | reject | self)
Requires IBGP or EBGP confederations (third-party next hop must be advertised).
For EVPN, NLRI route types range from 1 to 8 (the first octet of the route prefix in the BGP update message is the EVPN route type).
Multiple route types can be specified in a single policy.
Set the BGP path origin attribute to one of the following values:
prefix-list-filter prefix-list-name match-type
Both prefix-list and prefix-list-filter match conditions are supported. prefix-list is similar to prefix-list-filter,with the exception that a match-type can be specified only with prefix-list-filter. You can specify prefix length qualifiers for the list of prefixes in the prefix list.
When used with EVPN NRLI route Types 2 and 5, the following are supported:
Value of the route-distinguisher (RD).
Filtering BGP EVPN routes based on RD is supported. The RD information is carried in the prefix of the EVPN route.
Named route filter or route filter list. You can specify prefix length qualifiers for the list of routes in the route filter list.
When used with EVPN NRLI route types 2 and 5, the following are supported:
When using policy filters to filter EVPN routes, in Junos OS Release 19.4R1 and later, the following policy actions are supported (that is, they can be specified as the then qualifier in the policy).
Table 2 lists actions that can be used when filtering EVPN routes.
Table 2: List of Actions for Filtering EVPN Routes
Accept a route.
Apply a configuration group to a policy. If you specify more than one group name, the first group listed takes priority over the next, and so on.
Disable inheritance of a configuration group. This action is useful when you use the apply-group statement in a policy but also want to override the values inherited from the configuration group for a specific parameter.
Appends one or more AS numbers at the beginning of the AS path. If you are specifying more than one AS number, include the numbers in quotation marks.
The AS numbers are added after the local AS number has been added to the path. This action adds AS numbers to AS sequences only, not to AS sets. If the existing AS path begins with a confederation sequence or set, the appended AS numbers are placed within a confederation sequence. Otherwise, the appended AS numbers are placed with a non-confederation sequence.
Accept or Reject any action log protocol by overriding them. This is a non-terminating policy action.
Skip to next policy or term.
Sets the BGP local preference attribute for the route. The preference can be a number from 0 through 4,294,967,295), with lower numbers being more preferred. Selected routes are installed into the forwarding table.
Set the priority for route installation: high, low, or medium. High priority routes are updated first in the in the RIB (routing table) and the FIB (forwarding table), before medium and low priority routes. Routes are placed in different priority queues according to the priority.
Rejects the route and does not propagate it. After a route is rejected, no other terms in the routing policy and no other routing policies are evaluated.
tag (add | subtract) tag2 (add | subtract) number
Change the tag value by the specified amount.