05-24-2024 06:48 AM
In my lab setup, I have the following connections:
R1 advertises the IP address 1.1.1.1 to R2 via eBGP. R2 then forwards 1.1.1.1 to R3 using iBGP, with the next-hop-self attribute configured on R2.
However, I've noticed that when R3 receives the route for 1.1.1.1, the eBGP ASN from R1 is still present. I was under the impression that in iBGP, the ASN should be stripped and not included.
Can someone confirm if this is the expected behavior?
Solved! Go to Solution.
05-24-2024 07:07 AM - edited 05-24-2024 01:27 PM
Hi @Gucamole ,
This is the expected behavior. The AS path should be preserved as updates propagate through the network to prevent routing loops.
A good example of why this is useful would be for instance if you connected R3 to R1. R3 would advertise 1.1.1.1 to R1 and R1 would look at the AS path and drop the update as it detects that its own ASN is part of the AS path.
Regards,
05-24-2024 07:01 AM - edited 05-24-2024 08:18 AM
With and without next-hop self the ASN always keep not modify unless you use route-map set as.
Why the ASN is important it one of bgp way to detect loop' when router see it ASN in prefix it will not accept this prefix and that why the ibgp not add ASN to prefix (since all ibgp peer in same ASN).
More clarify
ibgp not add it own ASN to prefix when send prefix to other ibgp' and it keep other ASN in prefix when it send to other ibgp peer.(keep only)
ebgp add it own ASN to prefix when send it to other ebgp' it own ASN is additional to other ASN in prefix (keep it and add it own ASN).
MHM
05-25-2024 09:52 AM - edited 05-25-2024 10:02 AM
this for you
this lab how you can add AS path prepend of peer ASN
and how peer detect it ASN in as-path and drop prefix
again this for LOOP detect
and for ibgp the ibgp peer dont ADD it ASN in AS-path that why the prefix dont drop between ibgp peers
MHM
05-24-2024 07:07 AM - edited 05-24-2024 01:27 PM
Hi @Gucamole ,
This is the expected behavior. The AS path should be preserved as updates propagate through the network to prevent routing loops.
A good example of why this is useful would be for instance if you connected R3 to R1. R3 would advertise 1.1.1.1 to R1 and R1 would look at the AS path and drop the update as it detects that its own ASN is part of the AS path.
Regards,
05-24-2024 07:28 AM
Hello @Gucamole ,
what you see is expected.
BGP has many attributes that are attached to a prefix NLRI.
The BGP next-hop is the attribute afffected by the command next-hop self
the AS path is another BGP attribute that is not changed by next-hop self.
As already explained the AS path is used for loop avoidance and R3 receives an AS path that contains R1's ASN only + origin code.
Hope to help
Giuseppe
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide