Table of Contents
BGP AS Override –
BGP’s one of the key loop prevention mechanism is to match the AS number in the AS path of the received BGP update.
If the BGP AS-path attribute has the AS number of the receiving router in then that BGP route is not installed in the BGP routing table.
This BGP feature though useful for loop prevention can sometimes cause issues in the network (especially for a big enterprise spanning across multiple locations) where a customer has multiple sites spread geographically, connected by some ISP and using the same AS number.
Related – Top BGP Interview Questions
In this case, the routes from one site won’t be accepted at the other site as the AS number at both the sites is same.
To overcome this issue, BGP’s feature of AS Override will be used.
We will understand the feature using below topology wherein 2 sites of a customer will be connected through an ISP.
SCENARIO 1
In the below diagram a loopback 1.1.1.1 is advertised from SITE A and this update is forwarded by the ISP to customer remote SITE B. Since both SITE A & B use the same AS200 the route will be rejected once it is received at SITE B as per the BGP loop prevention mechanism.
Diagram 1: AS OVERRIDE DISABLED
Configuration on PE2
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 update-source Loopback0
!
address-family ipv4
exit-address-family
!
address-family vpnv4
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 send-community both
exit-address-family
!
address-family ipv4 vrf ISP
neighbor 9.9.45.5 remote-as 200
neighbor 9.9.45.5 activate
exit-address-family
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 4:4 (default for vrf ISP)
*>i 1.1.1.1/32 2.2.2.2 0 100 0 200 I >>>>>>>Route is installed here
*> 5.5.5.5/32 9.9.45.5 0 0 200 I
We see that PE2 is advertising the route of 1.1.1.1 to CE-B at site B but CE-B at site B wont accept that
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 4:4 (default for vrf ISP)
*>i 1.1.1.1/32 2.2.2.2 0 100 0 200 i
Total number of prefixes 1
Verifying Table at CE-B at Site B and we won’t see route for 1.1.1.1.
*> 5.5.5.5/32 0.0.0.0 0 32768 I
SCENARIO 2
In the below diagram the now we enable the AS OVERRIDE at the PE2 router. Now when any route received from SITE A is advertised to SITE B from PE2 instead of having AS path of “200, 100 “as before now the AS path would list 100,100.
When the route is received at SITE B it won’t find AS 200 in the AS path list and hence would accept the route (1.1.1.1 in our example).
Diagram 2: AS OVERRIDE ENABLED
PE2(config-router)#address-family ipv4 vrf ISPPE2(config-router-af)#nei
PE2(config-router-af)#neighbor 9.9.45.5 as
PE2(config-router-af)#neighbor 9.9.45.5 as-override
Verification:
Now we will see the route in the routing table on CE-B at site B
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 9.9.45.4 0 100 100 I >>>>>>>>>ISP over-writes its own AS twice
*> 5.5.5.5/32 0.0.0.0 0 32768 I
ABOUT THE AUTHOR
I am here to share my knowledge and experience in the field of networking with the goal being – “The more you share, the more you learn.”
I am a biotechnologist by qualification and a Network Enthusiast by interest. I developed interest in networking being in the company of a passionate Network Professional, my husband.
I am a strong believer of the fact that “learning is a constant process of discovering yourself.”
– Rashmi Bhardwaj (Author/Editor)