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

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

  • Starting with version 30.2.1, these features are 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 the 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.

Local Preference

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

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

Use Case for AS Path

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



You can deploy the same service in two different data centers involving two different Avi Load Balancer 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 data centers/ geographies.

Use Case for Local Preference

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



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

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

If the service with the highest local preference path gets disrupted, the system picks the one with the next highest local preference path. This is a method for deploying active stand-by across data centers/ geographies.

AS Path Prepend and Local Preference at VS Level

Starting with version 30.2.1, Avi Load Balancer supports AS path prepend and local preference at the virtual service level.

num_as_path_prepend & local_preference set inside VRFcontext applies to all the virtual services placed inside that VRF. It is a method for deploying active or standby across data centres/geographies.

In this case, the active datacenter attracts all the virtual service traffic and standby datacenter remains idle. Per-VS level as_path_prepend & local_preference settings can be used to make specific data center active or on standby for that virtual service. In this way, the resources of both data centers can be utilised efficiently. Per-VS level configuration takes precedence over VRF level configuration if both are present.

Note:

Per-VS config does not apply to SNAT IP.

Following are the config knobs:

Config Knob

Range

BGP Support

VsVip->bgp_num_as_path_prepend

Integer from 1 to 10

Applicable only over eBGP

VsVip->bgp_local_preference

0 to any positive integer

Applicable only over iBGP

Example
    iBGP peering
    VS1-1 (VIP=1.1.1.1) in VRF1 (datacenter1)
    VS1-2 (VIP=1.1.1.1) in VRF2 (datacenter2)

    VS2-1 (VIP=1.1.1.2) in VRF1 (datacenter1)
    VS2-2 (VIP=1.1.1.2) in VRF2 (datacenter2)
    
    By Setting
    VS1-1 VSVIP->local_preference = 200
    VS2-2 VSVIP->local_preference = 200

    From VRF1,
        1.1.1.1 will be advertised with local_preference = 200
        1.1.1.2 will be advertised with default local_preference = 100

    From VRF2,
        1.1.1.1 will be advertised with default local_preference = 100
        1.1.1.2 will be advertised with local_preference = 200
    
    For 1.1.1.1, datacenter1 becomes ACTIVE & datacenter2 STAND-BY
    For 1.1.1.2, datacenter2 becomes ACTIVE & datacenter1 STAND-BY