cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3527
Views
0
Helpful
3
Replies

Can we configure AS-Path Prepend and Local-AS <ASN> no-prepend replace-as

uzair.baig
Level 1
Level 1

Hi,

 

I have a EBGP neighbor. I am forming EBGP neighborship using local-as command, becuase I don't want to advertise my actual ASN.

 

config is as below.

 

router bgp 65111

 vrf ABC
router-id 10.75.0.2
address-family ipv4 unicast
network A.B.C.D/32
neighbor 10.75.0.22
remote-as 64747
local-as 21112 no-prepend replace-as
description ** TO MY-NEIGHBOR **
address-family ipv4 unicast

 

I want to advertise my network A.B.C.D/32 with higher number of AS-PATH. 

 

route-map ASP permit 10

set as-path prepend 21112  21112  11111

 

Route-map with AS-Prepend is configured for the same neighbor.

 

router bgp 65111

 vrf ABC

network A.B.C.D/32

neighbor 10.75.0.22

local-as 21112 no-prepend replace-as
description ** TO MY-NEIGHBOR **
address-family ipv4 unicast

 route-map ASP out

 

Will the BGP AS-PATH Prepend attribute works for the neighbor which have neighborship using "local-as <ASN> no-prepend replace-as" command enabled

3 Replies 3

Reza Sharifi
Hall of Fame
Hall of Fame

Hi,

Yes, the command "local-as no-prepend replace-as" should replace your AS (65111) with 21112  21112  11111.

HTH

John Luft
Level 1
Level 1

There are a couple of pieces to this. 

 

First: Your route-map.

The route-map needs the matching conditions. So, you would create an access-list with the routes you want to prepend and then another to allow either all other routes or just the ones you want to use without being prepended.

An example for this:

router bgp 65100
 network 172.16.0.0
 network 172.17.0.0
 neighbor 10.69.232.70 remote-as 65200
 neighbor 10.69.232.70 route-map set-as-path out
!
route-map set-as-path 10 permit
 match address 1
 set as-path prepend 65100 65100
!
route-map set-as-path 20 permit
 match address 2
!
access-list 1 permit 172.16.0.0 0.0.255.255
access-list 1 permit 172.17.0.0 0.0.255.255
!
access-list 2 permit 0.0.0.0 255.255.255.255

So in this example, the route-map will only prepend 172.16.0.0/16 and 172.17.0.0/16 routes but still allows all routes.

 

Second: The no-prepend option in the local-as configuration does preclude any route-map prepending you do. It stops the routes received from the eBGP Neighbor from being prepended by your local ASN.

So, yes, you can still prepend with the route-map even with the no-prepend option in the local-as config.

 

Here are some references you can use for further research if you wish:

Cisco guide for BGP Local-AS

Cisco Guide for IP Route Filtering in BGP

Cisco Guide for DUAL AS Configuration

 

While these guides are not exactly for your equipment, the information about the commands, their usages and most syntax are still applicable.

I hope this helps!

 

--------------------------------

When you make the world a better place for someone else, you make the world a better place.

Hello,

 

with your config, the advertised will have the path in bold in the topology table of the neighbor:


Router#sh ip bgp topology *

Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 192.168.12.1 0 0 21112 21112 21112 11111 i

Review Cisco Networking for a $25 gift card