If I see an AS path like 1234 5678 2345 5678 6789, shall I conclude that the repeat was _unintentional_ and an error? Or can someone do that non-contiguous repeat intentionally? If so, what can one achieve by repeating an AS non-contiguously in an AS path?
Yes. I mean the same. You can see many in route-views archive. My question is "Is this a mistake?" or people can do this intentionally for some sort of _traffic engineering_.
It should not "just happen" as the AS-PATH attribute is the primary loop prevention mechanism. if a BGP speaker sees an update with its own AS number in it, that update is dropped.
It is certainly possible to force it. I set three routers up in the lab with three separate AS nos.
R9 (9) was the originator, R2 (2) a transit SS and R3 (3) the end AS. Setting route maps on R2 out on the neighbor statement:
route-map loop permit 10 match ip address 10 set as-path prepend 10 11 12 11 12 11 12 ! ! route-map add permit 10 match ip address 10 set as-path prepend 2
router bgp 9 neighbor 10.20.29.2 route-map loop out
with the "add" route map. the update was dropped at R2 - as it thought i had already been through AS 2.
With the loop I got: r2#sh ip bgp
BGP table version is 9, local router ID is 10.45.45.4 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete
So I namaged to force it. I also got the following on R3:
3660-r3#sh ip bgp BGP table version is 5, local router ID is 10.35.35.3 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.20.9.0/24 10.20.23.2 0 2 9 10 11
12 11 12 11 12 i
*> 10.35.35.0/24 0.0.0.0 0 32768 i
So it was onwards advertised.
Why would we want to do that? TBH I am struggling a little. Listing an AS could be used as a rudimentary propagation control - "I want this go go everywhere but AS 9,10 and 11" kind of thing.
The path length can be used to select routes, but it is a pretty blunt instrument.
Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.