Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

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.

Note:

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.

Table 1: List of Match Conditions for Filtering EVPN Routes

Match Condition

Description

community [names]

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:

  • set policy-options community name members type:val1:val2

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.

High-order

Low-order (Sub-type)

Type (Hex)

Type (Dec)

Name

0x03

0x0c

0x030c

780

BGP Encapsulation

0x03

0x0d

0x030d

781

Default Gateway

0x06

0x00

0x0600

1536

EVPN MAC Mobility

0x06

0x01

0x0601

1537

EVPN ESI Label

0x06

0x02

0x0602

1538

EVPN ES-Import Route Target

0x06

0x04

0x0604

1540

EVPN Layer 2 Attributes

0x06

0x05

0x0605

1541

EVPN E-Tree

For full list of Extended Communities please refer to Border Gateway Protocol (BGP) Extended Communities .

evpn-esi

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.

evpn-etag

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.

evpn-mac-route

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:

  • from evpn-mac-route [ mac-ipv4 | mac-ipv6 | mac-only ]

Note that this match statement is valid only together with the family evpn match statement.

local-preference

Set the local preference (LOCAL_PREF) attribute. The preference value can be a number in the range from 0 through 4,294,967,295.

mac-filter-list

(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

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).

  • discard—The next-hop address is replaced by a discard next hop.

  • next-table—The routing device performs a forwarding lookup in the specified table.

  • self—The next-hop address is replaced by one of the local routing device’s addresses, as determined by the advertising protocol, typically the local IP address used for the BGP adjacency.

  • specify peer-address—The next-hop address is replaced by the peer’s IP address (import only), typically an advertising routing device or another directly connected routing device.

nlri-route-type

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.

origin

Set the BGP path origin attribute to one of the following values:

  • egp—Path information originated in another AS.

  • igp—Path information originated within the local AS.

  • incomplete—Path information learned by some other means.

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:

  • from prefix-list-filter [ exact | longer | orlonger ]

route-distinguisher

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.

route-filter

route-filter-list

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:

  • from route-filter [ address-mask | exact | longer | orlonger | prefix-length-range | through | upto ]

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

Action

Description

accept

Accept a route.

apply-groups group-name

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.

apply-groups-except group-name

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.

as-path-prepend

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.

default-action

Accept or Reject any action log protocol by overriding them. This is a non-terminating policy action.

next

Skip to next policy or term.

preference

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.

priority

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.

reject

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.