cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5069
Views
5
Helpful
2
Replies

BGP routing- as path prepend config question

fkleininger
Level 1
Level 1

I have 2 cpe routers R3  and R4 running BGP between them like so:

Cust CORE >>>>Customer FW#1 >>>>R3>>>>>>>>>>T3>>>>>> Juniper PE >>>>>MPLS cloud

Cust CORE >>>>Customer FW#1  >>>R4  >>>>>>>>>>T3>>>>>>.Juniper PE>>>>>MPLS Cloud

...and also running BGP with PE routers.

3 customr subnets

10.10.162.0/24

10.10.166.0/24

10.10.161.0 /24

R3 was primary and R4 was the Backup.  R3 is the Perfered route since  R4 advertises a less perfered route configured with the as path prepend command.

My question :  i need to make only the .161 subnet more perfered for inbound traffic over the R4 circuit and have inbound traffic for the other 2 subnet perfer R3  

 

Still new to BGP, any suggestions/steps for cutover are  appreciated.

thx

2 Replies 2

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Fkleininger,

you  just need to use route-maps to perform selective AS path prepending

R3:

prepend only net 10.10.161.0/24

ip prefix-list prefix_prepended_r3 seq 5 permit 10.10.161.0/24

route-map select-prepend-r3 permit 10

match ip address prefix prefix_prepended_r3

set as-path prepend yourASN your ASN yourASN

route-map select-prepend-r3 permit 20

! empty  route-map  block to advertise the other IP prefixes without any prepending

router bgp yourASN

neigh PE1-address route-map select-prepend-r3 out

R4:

mirrored configuration

ip prefix-list prefix_prepended_r4 seq 5 permit 10.10.162.0/24

ip prefix-list prefix_prepended_r4 seq 10 permit 10.10.166.0/24

route-map select-prepend-r4 permit 10

match ip address prefix prefix_prepended_r4

set as-path prepend yourASN your ASN yourASN

route-map select-prepend-r4 permit 20

! empty route-map  block to advertise the other IP prefixes without any prepending

router bgp yourASN

neigh PE2-address route-map select-prepend-r4 out

note: another access-list or prefix-list can be used if you want to control what CE nodes advertise to PE nodes in the eBGP sessions so you need simply a match ip address or match ip address prefix statement in second route-map block

Hope to  help

Giuseppe

Aloha fkleininger,

You say you are already advertising these subnets from R3 and R4. Can I ask what is your current method for advertising these?  While ip prefix-lists will work they may be unneccessary depending on your current configuration.

Example, lets say I have two connections as you do R1 and R2 and I am assigned the following IP address block 47.47.160.0/19.  I can advertise this block through both routers in such a way that I never use as-path prepending or ip prefix-lists.

On R1 I advertise the following: (/19, /20 lower half, all even /24s)

network 47.47.160.0 mask 255.255.224.0     (advertises the whole /19)

network 47.47.160.0 mask 255.255.240.0     (advertise the lower /20)

network 47.47.160.0 mask 255.255.255.0     (advertises an even /24)

network 47.47.162.0 mask 255.255.255.0   

"     "     "     "     "     "     "     "     "     "

network 47.47.190.0 mask 255.255.255.0

On R2 I advertise as follows: (/19, /20 upper half, all odd /24s)

network 47.47.160.0 mask 255.255.224.0     (advertises the whole /19)

network 47.47.176.0 mask 255.255.240.0     (advertises the upper /20)

network 47.47.161.0 mask 255.255.255.0     (advertises an odd /24)

network 47.47.163.0 mask 255.255.255.0

"     "     "     "     "     "     "     "     "     "

network 47.47.191.0 mask 255.255.255.0

This is just an example and shows how you can influence which router will be used on the return path to your network.  All even /24s go through R1 and all odd /24s go through R2.  In case of a router failure the other router takes over due to the "shorter" prefix through the redundant router.  I used no ip prefix-lists or as-path prepending to influence my preferred path.

Again, knowing how you are currently doing your advertisements will help in determining the best way to accomplish your new goal.

HTH