in

IEOC - Internetwork Expert's Online Community

Welcome to Internetwork Expert's Online Community - IEOC - a place for CCIE and CCENT candidates to connect, share, and learn. Our Online Community features CCIE forums and discussions for all tracks including Routing & Switching, Voice, Security, Service Provider, and Storage. Through these online communities you can discuss your questions with thousands of your peers, hundreds of CCIE's and Internetwork Expert's own team of world renowned CCIE instructors and authors, Brian Dennis - Quintuple CCIE #2210, Scott Morris - Quad CCIE #4713, Brian McGahan – Triple CCIE #8593, Petr Lapukhov - Quad CCIE #16379, Anthony Sequeira - CCIE #15626, Keith Barker - Dual CCIE #6783, and Marvin Greenlee - Triple CCIE #12237.
Latest post 10-27-2009 11:22 AM by jonbov. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-06-2008 7:17 AM

    BGP local-as no-prepend

    All,

     

    So, I was playing around this morning with the local-as command in bgp.  I wanted to make sure I really understood all the options, including the new dual-as option.  So I started by reading the cisco documentation.  I thought I was pretty familiar with the local-as command with the no-prepend option.  According to CCO the no-prepend option "configures the router to not prepend the local autonomous system number to routes that are received from external peers. "  Well that just sounded kind of confusing.  Is it supposed to no prepend the configured AS to any route it advertises, or just routes that it learned via another eBGP speaker.

    I decided to lab it out.  I have three routers running eBGP.  R2 is connected to R8 and R8 is connected to R1 with the following configs:

    R2:

    router bgp 22
     no synchronization
     bgp log-neighbor-changes
     network 200.0.0.2 mask 255.255.255.255
     neighbor 200.2.8.8 remote-as 88
     neighbor 200.2.8.8 local-as 200
     no auto-summary

    R8:

    router bgp 88
     no synchronization
     bgp log-neighbor-changes
     network 200.0.0.8 mask 255.255.255.255
     neighbor 200.1.8.1 remote-as 18
     neighbor 200.1.8.1 local-as 75
     neighbor 200.2.8.2 remote-as 200
     no auto-summary

    R1:

    router bgp 11
     no synchronization
     bgp log-neighbor-changes
     network 200.0.0.1 mask 255.255.255.255
     neighbor 200.1.8.8 remote-as 75
     neighbor 200.1.8.8 local-as 18
     no auto-summary

    A show ip bgp on R1 looks thus:

    *> 200.0.0.1/32     0.0.0.0                  0         32768 i
    *> 200.0.0.2/32     200.1.8.8                              0 75 88 200 22 i
    *> 200.0.0.8/32     200.1.8.8                0             0 75 88 i

    Ok that makes sense, everything is as it should be.  So, I add the no-prepend option to all the local-as statements.  This is a local-as change and naturally causes the session to re-establish.  Once the session re-establishes I get the following on R1 from show ip bgp:

    *> 200.0.0.1/32     0.0.0.0                  0         32768 i
    *> 200.0.0.2/32     200.1.8.8                              0 75 88 200 22 i
    *> 200.0.0.8/32     200.1.8.8                0             0 75 88 i

    As you can see nothing has changed.  Nothing is different.  As far as I can surmise this option does nothing.  It does not tell the router to not prepend the configured AS to any eBGP advertisement, including those from another eBGP speaker.  Only when I add the replace-as option does the show ip bgp output change on R1:

    *> 200.0.0.1/32     0.0.0.0                  0         32768 i
    *> 200.0.0.2/32     200.1.8.8                              0 75 200 i
    *> 200.0.0.8/32     200.1.8.8                0             0 75 i

     

    I have tried this on multiple routers, from 3750s and 2800s to 7600 RSP720s and GSRs.  I have tried different code trains including 12.0(S).  The results always seem to be the same.

    Is this right?  Am I reading the documentation right, but looking in the wrong place for the effects of this command?  Did something change since this command was documented?  What does the no-prepend option actually do?

     

     

    • Post Points: 5
  • 09-06-2008 8:36 AM In reply to

    Re: BGP local-as no-prepend

    Oh.  I think I understand now.  The router prepends the local-as to the eBGP route when it is learned from the eBGP speaker with the local-as command configured.  Then when it advertises the route to another eBGP speaker it adds the configured local-as.  So if I do a show ip bgp on R2 I see the following:

    *> 200.0.0.1/32     200.2.8.8                              0 88 75 18 11 i
    *> 200.0.0.2/32     0.0.0.0                  0         32768 i
    *> 200.0.0.8/32     200.2.8.8                0             0 88 i

    When I add the no-prepend option to all local-as statements, the table on R2 is as follows:

    *> 200.0.0.1/32     200.2.8.8                              0 88 18 11 i
    *> 200.0.0.2/32     0.0.0.0                  0         32768 i
    *> 200.0.0.8/32     200.2.8.8                0             0 88 i

    For some reason I was thinking about advertisements in the wrong direction.  This command works as advertised.  Sorry to have bothered you all... Hopefully someone else will find this post valuable ;) .

     

    • Post Points: 20
  • 10-24-2009 2:51 PM In reply to

    Re: BGP local-as no-prepend

    it is extremely valuable. The whole idea is weird but thats what CCIE candidates have to master. You learn routes from eBGP speakers, append local-as and then real as and then advertise the route to remote eBGP peer.

    • Post Points: 20
  • 10-27-2009 11:22 AM In reply to

    Re: BGP local-as no-prepend

    Be sure to check out all variants of BGP neighbour commands before CCIE lab

     

    Actually I ran into a real life network peering needing this with replace-as option last week:

    neighbor x.x.x.x local-as YYY no-prepend replace-as
    (and found replace-as  not supported on 12.2 SXD/6500/SUP720 )

     

    jonbov

    CCIE #25493 SP

     

     

    • Post Points: 5
Page 1 of 1 (4 items)
IEOC CCIE Forums Internetwork Expert CCIE Training
About IEOC | Terms of Use | RSS | Privacy Policy
© 2010 Internetwork Expert, Inc. All Rights Reserved