cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
3392
Views
12
Helpful
34
Replies

BGP as-path prepend for specific destination

mirage
Level 1
Level 1

Dear all,

I have a following topology in my lab:

R1 (as 208097) -- > R2 ISP (as16010)  -- R3 (as 35805)

                                                |

                                      R4 (as 10101)

I want to

prepend

my announce for AS35805 only with

as-path access-list

and

route-map

like this:

R1

interface FastEthernet0/0
ip address 2.2.2.1 netmask 255.255.255.252
duplex auto
speed auto

router bgp 20809
no synchronization
bgp router-id 1.1.1.254
bgp log-neighbor-changes
network 1.1.1.0 netmask 255.255.255.0
neighbor 2.2.2.2 remote-as 16010
neighbor 2.2.2.2 route-map BGP_OUT_RMAP out

ip as-path access-list 50 permit ^20809 16010 35805$
ip as-path access-list 50 deny .*

ip prefix-list MM seq 10 permit 1.1.1.0/24

route-map BGP_OUT_RMAP permit 10

match ip address prefix-list MM
match as-path 50
set as-path prepend 20809 20809

 

But it doesn't work

Does it possible?

 

1 Accepted Solution

Accepted Solutions

Using the

AS-PATH

I can change the path from R2 instead of go direct it go through the R1 and R3 AS300 
what I do in R2 (backup) 

R2#show running-config
Building configuration...

Current configuration : 2114 bytes
!
upgrade fpd auto
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
!
!
ip source-route
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
!
interface FastEthernet0/0
ip address 10.0.0.2 255.255.255.0
duplex half
!
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
!
interface FastEthernet2/0
ip address 100.0.0.2 255.255.255.0
duplex auto
speed auto
!
!
interface FastEthernet2/1
no ip address
shutdown
duplex auto
speed auto
!
!
interface FastEthernet3/0
no ip address
shutdown
duplex auto
speed auto
!
!
interface FastEthernet3/1
no ip address
shutdown
duplex auto
speed auto
!
!
router bgp 100
no synchronization
bgp log-neighbor-changes
network 2.2.2.2 mask 255.255.255.255
neighbor 10.0.0.1 remote-as 100
neighbor 10.0.0.1 next-hop-self
neighbor 10.0.0.1 route-map MHM in
neighbor 100.0.0.4 remote-as 400
neighbor 100.0.0.4 route-map MHMb in
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip as-path access-list 100 permit ^300_600$
ip as-path access-list 100 permit ^300_500$
!
!
no cdp log mismatch duplex
!
!
!
!
route-map MHMb permit 10
set weight 500
!
route-map MHM permit 10
match as-path 100
set weight 1000
!
route-map MHM permit 20
!
!
!
control-plane
!
!
!
mgcp fax t38 ecm
mgcp behavior g729-variants static-pt
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
!

Screenshot (765).pngScreenshot (766).png

View solution in original post

34 Replies 34

Edson A. Hernandez
Spotlight
Spotlight

The

as-path

filter list should be

ip as-path access-list 50 permit ^$
ip as-path access-list 50 deny .*

NO it not possible.
if the AS20809 is origin of prefix then the

as-path

is it

AS-path

only no more

 ^$


what you can do in using same but in 35805 and here also you need from R2 (in your topology) send multipath hence the AS35805 can use as-prepend IN direction 

mirage
Level 1
Level 1

R2 is an ISP (in real life), so I unable to change anythig there.

Is there any way to solve my issue?

I want to accept incomming traffic from AS16010, and for any other AS after AS 16010 make this path as backup..

sorry your in your topology can point each AS for each router 
and which router you want to configure primary and backup R1 I think 
thanks 

So, it is not possible in this topology, correct?

You dont answer me, 
R1 you want to use primary and backup ?

check below

No,

This device is backup BGP link. But hase an direct access for AS16010. I want to use it only for them (as16010) when another device (not in topology) is active.

I see you edit the post
just want to mention which one need primary and backup 

Please, check full topology image.

R5 is a primary router, connected to primary isp. R1 is Backup router, connected to backup isp.

I want to load-balance incomming traffic as follows:

Incomming traffic from AS 35805 and 10101 to  AS 20809 need to receive via AS 34797,  and traffic from AS 16010 ONLY to AS20809 via R1.

For outgoing traffic all is done via local preferene and

as-path access-list

, but my trouble is inbound traffic.

topology full.png
if there is bgp between AS35805/AS10101 and primary ISP AS then it easy 

Yes, these AS have BGP connection between

then I will share the solution tonight 
MHM

Review Cisco Networking for a $25 gift card