cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1475
Views
0
Helpful
6
Replies

order of ASNs in the BGP path

kschleppenbach
Level 4
Level 4

Two questions on the order of ASNs.

1) Is there a way, via a show command or debug, to see what the AS path is that I am advertising for individual routes on the router Cisco router that is doing the advertisements? That is, how can I independently verify that paramenters like local-as and prepends are working as intended?

2) Definition of "prepend". Documentation describes the local-as command as prepending the local-as to the actual AS. I agree. As observed, router BGP 2 with a nei local-as 3 gives a path of 3 2. But when using a route-map to set prepends, if I Prepend (meaning "before") 3 3, the actual path is 3 2 3 3. It actually Appends. This of course is an inconsistant path. I would have to prepend 2 2 to get a valid path of 3 2 2 2. Therefore there is no way to add additional local-as to the path. Am I misinterpreting the meaning of prepend when used in a route-map? Thanks

6 Replies 6

network.king
Level 4
Level 4

Hi,

Path prepend is done when an update is sent to the Other AS , so the receiving router would only receive with multiple AS for a routing update , so I think we would not be able to see in our router , but make a try with " debug ip bgp out or debug ip bgp updates " , pls make sure you have quite less number of routes.

2.As said , you have misinterpreted , AS path prepend means " prepend my AS number along with only your AS update " -- rather than prepending the AS for the whole update.

Hope this helps.

regards

vanesh k

vanesh,

Thanks

I tried the debug. The path is listed but it is blank.

00:17:31: BGP(0): 20.0.0.2 send UPDATE (format) 10.0.0.0/8, next 20.0.0.1, metric 0, path

Looks like the only way to see the path is on the receiving router.

I am mulling over your answer to part 2. Will follow up soon.

Vanesh,

Given the config and output below, I would say that local-as command Prepends to the native AS but a route-map prepend command actually Appends. Then it appears there is not a way to prepend the local-as, it has to be the native AS. Not that not having that capability is an issue, just trying to understand where ASNs are added in the path by the different functions.

RTA#

router bgp 1

no synchronization

bgp log-neighbor-changes

network 10.0.0.0

redistribute connected

neighbor 20.0.0.2 remote-as 2

neighbor 20.0.0.2 local-as 3

neighbor 20.0.0.2 route-map prepend out

no auto-summary

!

route-map prepend permit 10

set as-path prepend 3 3 3

RTB#

router bgp 2

no synchronization

bgp log-neighbor-changes

neighbor 20.0.0.1 remote-as 3

no auto-summary

#sh ip bgp

BGP table version is 3, local router ID is 30.0.0.1

Network Next Hop Metric Weight Path

10.0.0.0 20.0.0.1 0 0 3 1 3 3 3 i

Hi friend,

When a BGP update is sent to the EBGP Peers the routers appends its own AS at the end for that route.

When you say you are prepending AS, your are actually prepending your AS to the AS number that will be appended to the route by your EBGP peer.

Eg.. if RA sends the route 10.0.0.0/8 with AS 1 to RB in AS2 which in turn send to RC in AS3 then C sees the route as 10.0.0.0/8 2 1

Now when you prepend AS-1 on RA RC will see the route as 10.0.0.0/8 2 1 1 1 1

i.e prepended the AS before RB appended its AS number

HTH, rate if it does

Narayan

Hi ,

To explain in your way

#sh ip bgp -- when not path prepended

BGP table version is 3, local router ID is 30.0.0.1

Network Next Hop Metric Weight Path

10.0.0.0 20.0.0.1 0 0 1 3 i

When path prepended with "3 3 3"

#sh ip bgp

BGP table version is 3, local router ID is 30.0.0.1

Network Next Hop Metric Weight Path

10.0.0.0 20.0.0.1 0 0 1 3 3 3 3 i

So here you need to see

#sh ip bgp

BGP table version is 3, local router ID is 30.0.0.1

Network Next Hop Metric Weight Path

10.0.0.0 20.0.0.1 0 0 1 "3 3 3" 3 i

"3 3 3" is prepended to you AS 3 and sent as an update along with others .

Hope this helps.

Pls rate all posts

regards

vanesh k

Vanesh,

I agree with your last explanation except that I have introduced local-as. This is an actual config and sh ip bgp output. In the path 3 1 3 3 3, the first 3 is the appended local-as, the 1 is the actual AS configured under BGP, the last 3 3 3 is from the route-map set as-path command. They seem out of place to me. I would have expected 3 3 3 3 1.

RTA#

router bgp 1

no synchronization

bgp log-neighbor-changes

network 10.0.0.0

redistribute connected

neighbor 20.0.0.2 remote-as 2

neighbor 20.0.0.2 local-as 3

neighbor 20.0.0.2 route-map prepend out

no auto-summary

!

route-map prepend permit 10

set as-path prepend 3 3 3

RTB#

router bgp 2

no synchronization

bgp log-neighbor-changes

neighbor 20.0.0.1 remote-as 3

no auto-summary

#sh ip bgp

BGP table version is 3, local router ID is 30.0.0.1

Network Next Hop Metric Weight Path

10.0.0.0 20.0.0.1 0 0 3 1 3 3 3 i