BGP AS-PATH with Outbound and Inbound route-map

From: mohmmad imran <imran_mohmmad_at_yahoo.com>
Date: Tue, 12 Oct 2010 14:16:35 -0700 (PDT)

Needs a bit help on this.

Topology looks like:-
R1 and R3 are in as 10
R2 and R6 are in as 20
R1-----eBGP Peer with------ R2
R3-----eBGP Peer with------ R6
 R1 and R3 in AS 10 advertise two network 10.10.1.0/24 and 10.10.2.0/24 to R2 and R6 in As 20.
R1 is in AS 10 advertise prefixes to R2 after AS path prepending (AS 30). When I check the BGP on R2 it actually shows the pre-pended AS numbers after the neighbor AS number 10, so actually it appends the AS numbers instead of prepending.

My understanding was that the origin of the prefix stays same and by prepending few other AS numbers we are just making the path longer but as you can see below this completely changes the origin of both prefixes from AS 10 to AS 20.

R1#
router bgp 10
network 10.10.1.0 mask 255.255.255.0
network 10.10.2.0 mask 255.255.255.0
neighbor 192.168.1.2 remote-as 20
neighbor 192.168.1.2 route-map AS-PATH-OUT out

route-map AS-PATH-OUT permit 10
 set as-path prepend 30
R2#sh ip bgp
BGP table version is 16, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? b incomplete
 Network Next Hop Metric LocPrf Weight Path
*> 10.10.1.0 192.168.1.1 0 0 10 30 i
*> 10.10.2.0 192.168.1.1 0 0 10 30 i

R3 is in AS 10 advertise prefixes to R6, R6 modify the AS-PATH by prepending (AS 30). When I check the BGP table on R6 it actually shows the pre-pended AS numbers before the neighbor AS number 10, so actually it prepend the AS numbers instead of appending it like it did in previous case.

R3#
router bgp 10
network 10.10.1.0 mask 255.255.255.0
network 10.10.2.0 mask 255.255.255.0
neighbor 192.168.3.6 remote-as 20
R6#
router bgp 20
neighbor 192.168.3.3 remote-as 10
neighbor 192.168.3.3 route-map AS-PATH-IN in
route-map AS-PATH-IN permit 10
 set as-path prepend 30

R6#sh ip bgp
BGP table version is 16, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? b incomplete
 Network Next Hop Metric LocPrf Weight Path
*> 10.10.1.0 192.168.3.3 0 0 30 10 i
*> 10.10.2.0 192.168.3.3 0 0 30 10 i

Can someone please help me to understand, why we have this different behavior.

Thanks

Blogs and organic groups at http://www.ccie.net
Received on Tue Oct 12 2010 - 14:16:35 ART

This archive was generated by hypermail 2.2.0 : Mon Nov 01 2010 - 06:42:06 ART