This section describes the configuration of AS path and local preference.
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 is route qualifiers like the community. The same process can be followed for AS path prepend and local preference.
The configuration supports at VRF level as follows:
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.
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 at VRF Level using Avi Load Balancer UI
The Avi Load Balancer supports configuring AS path from the UI.
Navigate to CREATE.
. ClickIn the CREATE VRF CONTEXT screen, navigate to BGP Peering tab and select the Enable BGP Peering check box. Provide the value for the AS-Path Prepend as shown below:
Configuring AS Path at VRF Level using Avi Load Balancer 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 the above use case, on the upstream router, the AS path has been prepended with N+1, wherein the N=AS path is defined while doing the configuration in the BGP profile.
Configuring Local Preference at VRF Level using Avi Load Balancer UI
Configuring AS path is supported using Avi Load Balancer UI.
Navigate to CREATE. Navigate to BGP Peering tab. Select Enable BGP Peering check box and choose iBGP option for Type. Provide the value for the Local Preference as shown below:
and clickAny configuration change in AS path prepend or local preference parameters can result in a BGP connection to the peers being flapped.
Configuring Local Preference at VRF Level using Avi Load Balancer CLI
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.
Local AS Override for an iBGP Profile in VRF
This feature is required for cases where 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 applies to the SE, the profile level local_as
will be overridden with the peer level remote_as
.
The following are a 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, all the peers must have the sameremote_as
value.
- Example Configuration
-
+----------------------------+-------------------------------------------------+ | 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 configuration, the only valid SE peering are as follows:
Peering with Peers
Quagga Configuration 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 results in all the BGP virtual services deployed in the SE with this VRF going to
OPER_DOWN
state.
Configuring AS Path at VS Level using Avi Load Balancer CLI
The following is the CLI to configure the AS path:
[admin:-ctrl1]: > configure vsvip vsvip-http-vs +-----------------------------+--------------------------------------------+ | Field | Value | +-----------------------------+--------------------------------------------+ | uuid | vsvip-757494e9-6a39-4b04-a332-9cd86b157361 | | name | vsvip-http-vs | | vip[1] | | | vip_id | 0 | | ip_address | 100.66.10.61 | | enabled | True | | discovered_networks[1] | | | subnet[1] | 100.66.10.0/24 | | auto_allocate_ip | False | | auto_allocate_floating_ip | False | | avi_allocated_vip | False | | avi_allocated_fip | False | | auto_allocate_ip_type | V4_ONLY | | placement_networks[1] | | | subnet | 100.66.10.0/24 | | prefix_length | 32 | | vrf_context_ref | global | | east_west_placement | False | | tenant_ref | admin | | cloud_ref | Default-Cloud | +-----------------------------+--------------------------------------------+ [admin:-ctrl1]: vsvip> bgp_num_as_path_prepend 3 [admin:-ctrl1]: vsvip> save +-----------------------------+--------------------------------------------+ | Field | Value | +-----------------------------+--------------------------------------------+ | uuid | vsvip-757494e9-6a39-4b04-a332-9cd86b157361 | | name | vsvip-http-vs | | vip[1] | | | vip_id | 0 | | ip_address | 100.66.10.61 | | enabled | True | | discovered_networks[1] | | | subnet[1] | 100.66.10.0/24 | | auto_allocate_ip | False | | auto_allocate_floating_ip | False | | avi_allocated_vip | False | | avi_allocated_fip | False | | auto_allocate_ip_type | V4_ONLY | | placement_networks[1] | | | subnet | 100.66.10.0/24 | | prefix_length | 32 | | vrf_context_ref | global | | east_west_placement | False | | bgp_num_as_path_prepend | 3 | | tenant_ref | admin | | cloud_ref | Default-Cloud | +-----------------------------+--------------------------------------------+
Configuring Local Preference at VS Level using Avi Load Balancer CLI
The following is the CLI to configure the local preference:
[admin:-ctrl1]: > configure vsvip vsvip-http-vs [admin:-ctrl1]: vsvip> bgp_local_preference 200 [admin:-ctrl1]: vsvip> save +-----------------------------+--------------------------------------------+ | Field | Value | +-----------------------------+--------------------------------------------+ | uuid | vsvip-757494e9-6a39-4b04-a332-9cd86b157361 | | name | vsvip-http-vs | | vip[1] | | | vip_id | 0 | | ip_address | 100.66.10.61 | | enabled | True | | discovered_networks[1] | | | subnet[1] | 100.66.10.0/24 | | auto_allocate_ip | False | | auto_allocate_floating_ip | False | | avi_allocated_vip | False | | avi_allocated_fip | False | | auto_allocate_ip_type | V4_ONLY | | placement_networks[1] | | | subnet | 100.66.10.0/24 | | prefix_length | 32 | | vrf_context_ref | global | | east_west_placement | False | | bgp_local_preference | 200 | | tenant_ref | admin | | cloud_ref | Default-Cloud | +-----------------------------+--------------------------------------------+