Cisco – Is it possible to connect two private eBGP peers with the same AS number

bgpciscorouting

The Problem

A third party has implemented a small network and private BGP setup within one of our branches. We need to setup a eBGP peer relationship with this network. However we are both using the same private BGP AS number.

The Solution

  1. One of us changes our BGP AS number – This isn't out of the question, and even if there is another solution but its overly complex we may still do this.
  2. BGP Confederation – In my research it appears that setting up a BGP Confederation between the peers might be a work around. The basic idea would be to sub-divide the shared private AS number into multiple private AS numbers. I'm not entirely sure yet whether this would solve the problem properly.
  3. Other solutions? It is here I'm looking for more advice on whether it is possible to work around this problem is an effective way.

Best Answer

Yes.

Option 1 is likely your best bet for simplicity's sake, but you can use the confederation method if you don't want to change the ASN. You can also do neighbor x.x.x.x local-as <as> in the BGP config but this prepends an ASN of your choosing onto the path, rather than replace the ASN in the path, so updates from one router to the other would be dropped anyway. Unless there's a really good reason as to why you want to maintain the eBGP session, you can also migrate to an iBGP session vs eBGP.

As @DanielDib has pointed out below, a third option (if you're running a version of IOS that supports it) is to use local-as in conjunction with replace-as and no-prepend to strip your ASN from the AS_PATH and send a different one:

router bgp [your asn]
  neighbor x.x.x.x remote-as [peer-asn]
  neighbor x.x.x.x local-as [new asn] no-prepend replace-as