cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1409
Views
1
Helpful
5
Replies

BGP AS-Path Changing

hopak
Level 1
Level 1

Hello There,

I have a Cisco Catalyst 8500 Router. I run BGP on this router. I have a neighborship with my datacenter and i get the full route from they.

I Want to replace the as-path to some networks/as paths by regex/static.

How can i do that?

What i want;

In my route table when i want to go 1.0.128.0/24 i must use the 0 42xxx 6939 4651 23969

*> 1.0.128.0/24 77.92.xxx.xx 200 0 42xxx 6939 4651 23969

But i want to use this path for going to 1.0.128.0/24 0 42xxx 159xx

Can i do that?

When i tried the prepend it does 42xxx 159xx 42xxx 6939 4651 23969

 

This is my bgp configuration;

this is my bgp configuration;
router bgp xxxx
bgp log-neighbor-changes
neighbor 77.92.xxx.xx remote-as 42xxx
neighbor 77.92.xxx.xx log-neighbor-changes
neighbor 77.92.xxx.xx ebgp-multihop 255
neighbor 77.92.xxx.xx transport connection-mode active
neighbor 77.92.xxx.xx update-source TenGigabitEthernet0/1/0
!
address-family ipv4
network 77.92.xxx.xx mask 255.255.255.224
neighbor 77.92.xxx.xx activate
neighbor 77.92.xxx.xx soft-reconfiguration inbound
neighbor 77.92.xxx.xx route-map PDC_IN in
neighbor 77.92.xxx.xx route-map PDC_OUT out
exit-address-family

route-map PDC_IN permit 10

set local-preference 200

!

route-map PDC_OUT permit 10

match ip address prefix-list announces

5 Replies 5

M02@rt37
VIP
VIP

Hello @hopak 

 

You want replace all AS-PATH in inbound ?

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

hopak
Level 1
Level 1

When i do it i will check from show ip bgp x.x.x.x

it shows me those path 42xxx 159xx 42xxx 6939 4651 23969
I apply this policy to in may i use this to out policy?

I want to specify also inbound and outbound as-path for some ip/asns

@hopak 

Modify full path is impossible. You could delete private ASN, replace-as with your ASN, prepend the AS-PATH in order to influence ingress flow.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

I think You can try

Use route-map 

And set as-path replace 

Note:- please note that even if this work you maybe see routing loop since you change attribute bgp use to detect loop.

Thanks

MHM

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @hopak ,

you can use local preference in a route-map to prefer a path over another

By the way you likely have a local preference set to 200 on the current best path

*> 1.0.128.0/24 77.92.xxx.xx 200 0 42xxx 6939 4651 23969

But i want to use this path for going to 1.0.128.0/24 0 42xxx 159xx

The route-map has to be applied inbound on the neighbor that you want to increase the local preference using prefix-lists you can do this in a selective way.

 

Hope to help

Giuseppe