local-as no-prepend replace-as

Hi, Can someone clarify the differences between these three:

A) .

router bgp 500

neighbor 10.0.0.2 local-as 200

B) .

router bgp 500

neighbor 10.0.0.2 local-as 200 no-prepend

C).

router bgp 500

neighbor 10.0.0.2 local-as 200 no-prepend replace-as

 

In my lab, I saw both A and B have the same result (200 500 in the as path). C only shows one (200 in the as path). Now I am confused. Please help!

Thanks!

 

Comments

  • no-prepend  Do not prepend local-as to updates from ebgp peers

    replace-as  Replace real AS with local AS in the EBGP updates

     

    You checked the AS-path from 10.0.0.2, right? The prefixes router in AS500 advertised to 10.0.0.2 were propably received through iBGP ? If you read explanation for "no-prepend" carefully, it only claims to affect only eBGP-received routes. Could this be the reason?

  • Yes, I did "show ip bgp" on the peer router (10.0.0.2) which is in AS 400. Yes, they are EBGP peer. I don't see any difference in the result by adding "no-prepend" keyword. Weird, that's way I am confused.

    Thanks!

  • Looks like the "no-prepend" option applies to inbound updates from ebgp peers and "replace-as" applies to outbound updates to ebgp peers.  Here are a few examples to illustrate the point from the online command reference for BGP.

     



    no-prepend Keyword Configuration: Example


    The following example configures BGP to not prepend autonomous system 500 to routes received from the 192.168.1.1 neighbor:


    router bgp 400


    address-family ipv4 multicast


     network 192.168.0.0


     neighbor 192.168.1.1 local-as 500 no-prepend 


    replace-as Keyword Configuration: Example


    The following example strips private autonomous system 64512 from
    outbound routing updates for the 172.20.1.1 neighbor and replaces it
    with autonomous system 600:


    router bgp 64512 


    address-family ipv4 unicast 


     neighbor 172.20.1.1 local-as 600 no-prepend replace-as 


     neighbor 172.20.1.1 remove-private-as 

    no-prepend  Do not prepend local-as to updates from ebgp peers

    replace-as  Replace real AS with local AS in the EBGP updates

     

    You checked the AS-path from 10.0.0.2, right? The prefixes router in AS500 advertised to 10.0.0.2 were propably received through iBGP ? If you read explanation for "no-prepend" carefully, it only claims to affect only eBGP-received routes. Could this be the reason?

     

  • Interestengly enough, you can use the combination "local-as no-prepend replace-as" to implement a for of "AS NATing" with BGP.

    For example, if you have the following configuration

     

    AS100--AS200--AS300

     

    You may want to make AS100 thinking that it peers with AS300 and AS300 thinking that it peers with AS100. To accomplish this, AS300 should be configured with "local-as no-prepend replace-as 300" on the peering with AS100 and with "local-as no-prepend replace-as 100" on the peering with AS 300. Furthermore, if you implement MPLS or any other kind of tunneling in AS200, you may make it looking like AS200 does not even exist, and AS100/300 peer directly.

  • Let's hope that Cisco doesn't include that scenario on a lab.  Although maybe they're adding MPLS to the lab for that specific reason.  [:P]

    Furthermore, if you implement MPLS or any other kind of tunneling in AS200, you may make it looking like AS200 does not even exist, and AS100/300 peer directly.
  • Interestengly enough, you can use the combination "local-as no-prepend replace-as" to implement a for of "AS NATing" with BGP.

    For example, if you have the following configuration

     

    AS100--AS200--AS300

     

    You may want to make AS100 thinking that it peers with AS300 and AS300 thinking that it peers with AS100. To accomplish this, AS300 should be configured with "local-as no-prepend replace-as 300" on the peering with AS100 and with "local-as no-prepend replace-as 100" on the peering with AS 300. Furthermore, if you implement MPLS or any other kind of tunneling in AS200, you may make it looking like AS200 does not even exist, and AS100/300 peer directly.


    I've used this command in a migration between 2 companies that are customers of the company I work for (I work for an ICT Service Provider). Its pretty awsome. :)

Sign In or Register to comment.