BGP Support for AS Path

Overview

This guide explains the configuring process of Autonomous System (AS) path and local preference for routes published over eBGP and iBGP respectively.

Notes:

  • The AS path prepend and local preference features works with the same pre-requisites/ ecosystem support that is listed in the BGP Support for Virtual Services.

  • The features are not supported for IPv6.

Prepending AS Path

When multiple paths to an IP address or prefix are available through BGP in a router, the router will prefer the path with the least number of AS identifiers in the path.

The BGP can signal lower priority to a route by prepending an arbitrary number of AS identifiers. This route will be picked only when the route with lower number of AS identifiers goes down.

This feature allows you to prepend AS identifiers in the path. This is applicable only for routes advertised over eBGP connections.

Setting Local Preference

You can set Local Preference field to communicate preference of the path to its peer.

Higher value means higher preference. This is applicable only over iBGP connections.

Use Cases

Use Case for AS Path

The following is the diagrammatic representation of an AS path use case:

as-pretend-path-use-case

You can deploy the same service in two different data centers involving two different Avi clusters. Both use the same VIP.

The upstream router to which both the SEs get connected will pick the path with the shortest AS path.

If the service with a short AS path gets disrupted, the system picks the one with the longer AS path. This is a method for deploying active stand-by across datacenters/geographies.

Use Case for Local Preference

The following is the diagrammatic representation of the local preference use case:

local-preference-use-case

You can deploy the same service in two different data centers involving two different Avi clusters. Both use the same VIP.

The upstream router to which both the SEs get connected will pick the path with the shortest local preference path.

If the service with a short local preference path gets disrupted, the system picks the one with the longer local preference path. This is a method for deploying active stand-by across datacenters/geographies.

Configuring AS Path and Local Preference

You can configure AS path and local preference as follows:

The community feature allows you to configure a default community string and separate community strings for address ranges and a default community string.

The AS path prepend and local preference are route qualifiers like community. The same process can be followed for AS path prepend and local preference.

The configuration will support setting a local preference value for all the VIP and SNAT routes advertised. This is a field in the BGP profile which is part of VRF.

The configuration supports setting the number of times the local AS is to be prepended in the VIP and SNAT routes advertised. This is a field in the BGP profile which is part of VRF.

Configuring AS Path using Avi CLI

The following is the CLI to configure the AS path:


[admin:ctlr1]: > configure vrfcontext global
[admin:ctlr1]: vrfcontext> bgp_profile
[admin:ctlr1]: vrfcontext:bgp_profile> num_as_path_prepend 5
[admin:ctlr1]: vrfcontext:bgp_profile> save
[admin:ctlr1]: vrfcontext> save
+-----------------------+-------------------------------------------------+
| Field                 | Value                                           |
+-----------------------+-------------------------------------------------+
| uuid                  | vrfcontext-4f58cb16-eedb-41d1-a125-538e512f11bb |
| name                  | global                                          |
| bgp_profile           |                                                 |
|   local_as            | 66000                                           |
|   ibgp                | False                                           |
|   keepalive_interval  | 60                                              |
|   hold_time           | 180                                             |
|   send_community      | True                                            |
|   num_as_path_prepend | 5                                               |
|   shutdown            | False                                           |
| system_default        | True                                            |
| lldp_enable           | True                                            |
| tenant_ref            | admin                                           |
| cloud_ref             | Default-Cloud                                   |
+-----------------------+-------------------------------------------------+

Network          Next Hop            Metric LocPrf Weight Path
*>100.64.1.126/32  100.64.1.69              0             0 65000 i
*>100.64.1.153/32  100.64.1.39              0             0 65000 65000 65000 65000 65000 65000 i

As per above use case, on the upstream router the AS path has been prepended with N+1, where in N=AS path defined while doing the configuration in BGP profile.

Configuring AS Path using Avi UI

Starting with Avi Vantage release 20.1.5, configuring AS path is supported using Avi UI as well. Navigate to Infrastructure > Routing > BGP Peering and provide the value for the AS-Path Prepend as shown below.

bgp-as-path

as-path

Configuring Local Preference

The following is the CLI to configure the local preference:


[admin:ctlr1]: > configure vrfcontext global
[admin:ctlr1]: vrfcontext:bgp_profile> local_preference 500
[admin:ctlr1]: vrfcontext:bgp_profile> save
[admin:ctlr1]: vrfcontext> save
+----------------------+-------------------------------------------------+
| Field            	| Value                                       	|
+----------------------+-------------------------------------------------+
| uuid             	| vrfcontext-b894161d-d517-4f11-ac78-ee869389fe1e |
| name             	| global                                      	|
| bgp_profile      	|                                             	|
|   local_as       	| 6000                                        	|
|   ibgp           	| True                                        	|
|   keepalive_interval | 60                                          	|
|   hold_time      	| 180                                         	|
|   send_community 	| True                                        	|
|   local_preference   | 500                                         	|
|   shutdown       	| False                                       	|
| system_default   	| False                                       	|
| tenant_ref       	| admin                                       	|
| cloud_ref        	| Default-Cloud                               	|
+----------------------+-------------------------------------------------+

Network               Next Hop            Metric LocPrf Weight Path
>i0.0.0.0/0         100.64.2.70             500      0 i
>i10.79.172.0/22    100.64.2.70    0        500      0 i

As per the above use case, on the upstream router, the local preference has been updated to the configured value.

Configuring Local Preference using Avi UI

Starting with Avi Vantage release 20.1.5, configuring AS path is supported using Avi UI as well. Navigate to Infrastructure > Routing > BGP Peering and provide the value for the Local Preference as shown below.

localpref

Note: Any configuration change in AS path prepend or local preference parameters can result in BGP connection to the peers being flapped.

Local AS Override for an iBGP Profile in VRF

This feature is required for cases where the the local AS in an iBGP profile on a VRF needs to be decided based on the peers reachable through the SE. For instance, the networks where routers that support only 2-byte AS number and more recent routers co-exist.

When a VRF and its BGP profile is deployed in an SE, if there are peer configurations with ibgp_local_as_override set and the peer subnet is applicable to the SE, the profile level local_as will be overriden with the peer level remote_as.

The following are few constraints in the configuration:

  • This feature is only for iBGP networks.

  • If there are multiple peers with subnets to the same TOR in the SE and ibgp_local_as_override is enabled, then all the peers should have the same remote_as value.

Example config


+----------------------------+-------------------------------------------------+
| Field                      | Value                                           |
+----------------------------+-------------------------------------------------+
| uuid                       | vrfcontext-553674bd-44b9-4a22-b4d6-8bf804e0f046 |
| name                       | global                                          |
| bgp_profile                |                                                 |
|   local_as                 | 100                                             |
|   ibgp                     | True                                            |
|   peers[1]                 |                                                 |
|     remote_as              | 200                                             |
|     peer_ip                | 100.64.3.10                                     |
|     subnet                 | 100.64.3.0/24                                   |
|     bfd                    | True                                            |
|     advertise_vip          | True                                            |
|     advertise_snat_ip      | True                                            |
|     advertisement_interval | 5                                               |
|     connect_timer          | 10                                              |
|     ebgp_multihop          | 0                                               |
|     shutdown               | False                                           |
|     ibgp_local_as_override | True                                            |
|   peers[2]                 |                                                 |
|     remote_as              | 200                                             |
|     peer_ip                | 100.64.4.10                                     |
|     subnet                 | 100.64.4.0/24                                   |
|     bfd                    | True                                            |
|     advertise_vip          | True                                            |
|     advertise_snat_ip      | True                                            |
|     advertisement_interval | 5                                               |
|     connect_timer          | 10                                              |
|     ebgp_multihop          | 0                                               |
|     shutdown               | False                                           |
|     ibgp_local_as_override | True                                            |
|   peers[3]                 |                                                 |
|     remote_as              | 300                                             |
|     peer_ip                | 100.64.5.10                                     |
|     subnet                 | 100.64.5.0/24                                   |
|     bfd                    | True                                            |
|     advertise_vip          | True                                            |
|     advertise_snat_ip      | True                                            |
|     advertisement_interval | 5                                               |
|     connect_timer          | 10                                              |
|     ebgp_multihop          | 0                                               |
|     shutdown               | False                                           |
|     ibgp_local_as_override | True                                            |
|   peers[4]                 |                                                 |
|     remote_as              | 100                                             |
|     peer_ip                | 100.64.6.10                                     |
|     subnet                 | 100.64.6.0/24                                   |
|     bfd                    | True                                            |
|     advertise_vip          | True                                            |
|     advertise_snat_ip      | True                                            |
|     advertisement_interval | 5                                               |
|     connect_timer          | 10                                              |
|     ebgp_multihop          | 0                                               |
|     shutdown               | False                                           |
|   keepalive_interval       | 60                                              |
|   hold_time                | 180                                             |
|   send_community           | True                                            |
|   shutdown                 | False                                           |
| system_default             | True                                            |
| lldp_enable                | True                                            |
| tenant_ref                 | admin                                           |
| cloud_ref                  | Default-Cloud                                   |
+----------------------------+-------------------------------------------------+

With the above config, the following are the only valid SE peering:

Peering with Peers Quagga Config Local AS
peering with peers[1] 200
peering with peers[2] 200
peering with peers[1] and [2] 200
peering with peers[3] 300
peering with peers[4] 100

Note: Any other combination of peering is invalid and result in all the BGP virtual services deployed in the SE with this VRF to go to OPER_DOWN state.