Configuring Additional BGP EVPN Features

This module discusses some features of BGP EVPN such as Dynamic BGP Peering, Route Map support, and so on.

Dynamic BGP Peering for EVPN

Dynamic BGP Peering feature allows BGP peering to a group of remote neighbors that are defined by a range of IP addresses. Each range can be configured as a subnet IP address. BGP dynamic neighbors are configured using a range of IP addresses and BGP peer groups.

For information about configuring Dynamic BGP Peering, see BGP Dynamic Neighbors.

In Cisco IOS XE Release 17.11.1, support for Dynamic BGP Peering is extended to the L2VPN EVPN address family. To understand how to configure, verify, and troubleshoot BGP Dynamic Peering for the EVPN address family, refer to Configure BGP DN for Multiple AF on Catalyst 9000 Series Switches.

Configuration Example for Dynamic BGP Peering

Here is a sample configuration for dynamic BGP peering for L2VPN EVPN Family:

router bgp 10
 bgp log-neighbor-changes
 bgp listen range 10.10.10.0/24 peer-group DN-GRP
 bgp listen limit 2
 neighbor DN-GRP peer-group
 neighbor DN-GRP remote-as 12 alternate-as 13 
 !
 address-family l2vpn evpn
  neighbor DN-GRP activate
  neighbor DN-GRP send-community extended
 exit-address-family
 !

EVPN Route Map Support

The Leaf, Spine and Border nodes of a BGP EVPN fabric support route map for L2VPN EVPN address-family. A route map allows you to check for certain match conditions and set a value. With the route map support, the BGP attributes and their values can be modified to customize the routing policy based on the requirement. The routing policy can be applied for both inbound and outbound EVPN routes.

EVPN routes contain many fields and carry attributes specific to EVPN. Using route maps, you can filter routes on the basis of these attributes. The following route-filtering and attribute-handling options are available for the routes belonging to the EVPN address family:

  • Matching based on IP prefix:

    You can use IPv4 or IPv6 prefix or host route that is embedded in EVPN prefix field to filter EVPN Type 2 and Type 5 routes.

  • Matching based on the EVPN route type:

    Seven types of network layer reachability information (NLRI) are available in EVPN and called the Route Types. You can filter the routes based on the EVPN route type. For Type 2, you can further filter the routes based on the MAC address or the MAC and IP addresses.

  • Setting a value:

    A set clause is used in a route map to set the BGP attributes, community, and so on. In a route map operation, after all the match statements are successful, the set clauses are executed.

Configuring Route Maps

You can configure route maps to filter the EVPN address-family routes. A route map evaluates match clauses until a successful match occurs. After the match occurs, the route map stops evaluating match clauses and starts executing set clauses, in the order in which they were configured. If a successful match does not occur, the route map “falls through” and evaluates the next sequence number of the route map until all configured route map entries have been evaluated or a successful match occurs.

Matching based on IP prefix

Use this procedure to filter the BGP EVPN routes based on the value of the EVPN prefix field. You can use the IPv4 or IPv6 prefix or host route that is embedded in the EVPN prefix field to filter the EVPN Type 2, Type 3, and Type 5 routes.

Procedure
  Command or Action Purpose

Step 1

configure terminal

Example:
Device# configure terminal

Enters global configuration mode.

Step 2

route-map route-map-name

Example:
Device(config)# route-map rmap1

Creates a route map and enters route-map configuration mode.

Step 3

match ip address prefix-list prefix-list-name

Example:
Device(config-route-map)# match ip address prefix-list plist1

Matches the BGP EVPN routes with the specified prefix-list.

Step 4

end

Example:
Device(config-router-af)# end

Exits route-map configuration mode and enters privileged EXEC mode.

Example

The following snippet is a sample configuration that matches an EVPN route based on IP prefix.

ip prefix-list plist1 permit 172.16.1.0/24
route-map rmap1
  match ip address prefix-list plist1
  set local-preference 222

Matching Based on EVPN Route Type

Procedure
  Command or Action Purpose

Step 1

configure terminal

Example:
Device# configure terminal

Enters global configuration mode.

Step 2

route-map route-map-name

Example:
Device(config)# route-map rmap1

Creates a route map and enters route-map configuration mode.

Step 3

match evpn route-type { 1 | 2 | 2-mac-only | 2-mac-ip | 3 | 4 | 5 | 6 }

Example:
Device(config-route-map)# match evpn route-type 6

Matches the BGP EVPN routes with the specified route type.

Step 4

end

Example:
Device(config-router-af)# end

Exits route-map configuration mode and enters privileged EXEC mode.

Example

The following snippet is a sample configuration that matches an EVPN route based on the route type 2.

route-map rmap1 permit 10 
 match evpn route-type 2
 set local-preference 222

Applying Route Maps

You can apply the route maps to filter the EVPN routes that are advertised to or received from a BGP peer and to set BGP attributes to specific routes.

After you've configured the route map with match and set clauses based on your requirements, use the following procedure to apply the route map at the inbound or outbound level.

Procedure

  Command or Action Purpose

Step 1

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 2

router bgp autonomous-system

Example:

Device(config)# router bgp 100

Enables a BGP routing process, assigns it an AS number, and enters router configuration mode. The AS number can be from 1 to 65535, with 64512 to 65535 designated as private autonomous numbers.

Step 3

neighbor {ip-address | peer-group-name } remote-as number

Example:

Device(config-router)# neighbor 10.1.1.2 remote-as 200

Adds an entry to the BGP neighbor table specifying that the neighbor that is identified by the IP address belongs to the specified AS.

Step 4

address-family l2vpn evpn

Example:

Device(config-router)# address-family l2vpn evpn

Specifies the L2VPN address family and enters address family configuration mode.

Step 5

neighbor ip-address activate

Example:

Device(config-router-af)# neighbor 10.1.1.2 activate

Enables the exchange of information with a BGP neighbor.

Step 6

neighbor ip-address route-map route-map-name {in | out}

Example:

Device(config-router-af)# neighbor 10.1.1.2 route-map rmap1 in

Applies a route map to incoming or outgoing routes.

Step 7

end

Example:

Device(config-router-af)# end

Exits address-family configuration mode and enters privileged EXEC mode.

Example

The following example shows how to configure a route map as an inbound neighbor policy.

ip prefix-list plist1 permit 10.1.1.0/24 
 route-map rmap1 permit 10
 match ip address prefix-list plist1
 set community comm1

 router bgp 100
 neighbor 10.1.1.2 remote-as 200
 address-family l2vpn evpn
  neighbor 10.1.1.2 activate   
  neighbor 10.1.1.2 route-map rmap1 in
!