Routing policies for EVPN
SUMMARY 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 the device imports and exports to the routing and forwarding tables. Starting in Junos OS 19.4R1, Junos has expanded routing policy support to include creating and applying policy filters specific to EVPN routes.
You can apply policies at the routing-instance level or at the BGP group level. When you apply
policies at the BGP group level, they affect all EVPN routing instances.
When applied at the routing-instance level, they affect the specified EVPN
routing instance only. To apply the policy at the BGP group 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 the
vrf-export
or vrf-import
statement
to apply the policy for that routing instance.
You can modify EVPN Type 1 route advertisements through vrf-export
policy configuration. You must configure the policy with the accept
clause for the target communities you want advertised or they will be rejected by
the default policy action.
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.
Match Condition |
Description |
||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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 |
||||||||||||||||||||||||||||||||||||||||
|
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 |
||||||||||||||||||||||||||||||||||||||||
|
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 |
||||||||||||||||||||||||||||||||||||||||
|
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. |
||||||||||||||||||||||||||||||||||||||||
|
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:
|
||||||||||||||||||||||||||||||||||||||||
|
Both 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.
Action |
Description |
---|---|
accept |
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. |
|
Change the tag value by the specified amount. |