cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7436
Views
35
Helpful
4
Replies

BGP AS Path and the Local-AS Command

Robert Juric
Level 1
Level 1

According to the BGP Best Path Selection Algorithm:

Paths from an external BGP (eBGP) neighbor if the local autonomous system (AS) appears in the AS_PATH. Such paths are denied upon ingress into the router and are not even installed in the BGP Routing Information Base (RIB).

During this evaluation, when it references the local AS, does it take into account any configured local-as commands or does it only evaluate the "router bgp <as-number>" AS against the routes AS_PATH?

4 Replies 4

Hello
That depends because you can negate the advertisement of the original ASN to a neighbor using the additional (Replace-as ) command

So I guess it will still advertise a local originated ASN ( bit a fake one), And their isnt anything I can see to negate this "Fake "ASN from still be checked in the bgp loop-prevention, as after all its still local to the ASN that originated

res
Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

The situation that I'm facing is occurring with an MPLS migration. We already had unique ASN for each site with Carrier A. We've started turning up Carrier B sites, but they assigned a new (and overlapping) ASN for all the sites. To accommodate this we configured the local-as command for the new Carrier B peers.

What I see in the AS path is the actual "router bgp ASN", then the "local-as ASN".

Carrier B assigned the same "local-as ASN" for most of our sites. I have only turned up one so far but I see this would be an issue. I wasn't sure if it would look for both its own "local-as ASN" and the "router bgp ASN" when evaluating the AS_PATH.

Hello
Please review the below -  labbed it up for you

R1(asn12) <---> R2(asn21)
R1 local-as = 111

local-as12

R1
router bgp 111
neighbour 172.1.12.2 remote-as 21
neighbour 172.1.12.2 local-as 12
network 1.1.1.1 mask 255.255.255.255

R2
router bgp 21
neighbour 172.1.12.1 remote-as 12
network 2.2.2.2 mask 255.255.255.255

R2#sh ip bgp | b N
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       172.1.12.1               0             0 12 111 i  <----advertises original as and fake

R1#sh ip bgp | b N
   Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       172.1.12.2               0             0 12 21 i  <----received prefix includes fake asn



local-as 12 noprepend

R2#sh ip bgp | b N
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       172.1.12.1               0             0 12 111 i

R1#sh ip bgp | b N
   Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       172.1.12.2               0             0 21 i  <------received prefix removes its original asn --- ONLY affects R1s BGP table


local-as 12 noprepend replace-as

R2#sh ip bgp | b N
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       172.1.12.1               0             0 12 i  <-------- Only fake asn is advertised

R1#sh ip bgp | b N
   Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       172.1.12.2               0             0 21 i


local-as 12 no-prepend replace-as dual-as - Allows bgp to peer on either the fake asn or the original one

R2(config)#router bgp 21
R2(config-router)#neighbor 172.1.12.1 remote-as 111
*Mar  1 00:31:42.587: %BGP-5-ADJCHANGE: neighbor 172.1.12.1 Down Remote AS changed
R2#
*Mar  1 00:31:44.323: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Mar  1 00:32:12.683: %BGP-5-ADJCHANGE: neighbor 172.1.12.1 Up

R2#sh ip bgp | b N
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       172.1.12.1               0             0 111 i

R1#sh ip bgp | b N
   Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       172.1.12.2               0             0 21 i

res
Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

I think I would need to use replace-as to supress the fake-as, since that is the one overlapping. I'm going to throw it in the lab tomorrow and I may have a better explanation.

Review Cisco Networking for a $25 gift card