cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2866
Views
0
Helpful
16
Replies

BGP route Manipulation

Hello Guys,

 

Here is the design and the objective:-

 

We have R1,R2 and R3 all connected via a core switch and from R3-R1 there is iBGP and from R3 to R2 there is iBGP too, now from LAN side the traffic goes to R3 always via VRRP. R2 and R1 both have an eBGP to a backbone MPLS.

For simplicity lets say R1 and R2 only knows a total of 4 subnets learnt and they will advertise that into iBGP, now when traffic go to R3 we need to make R1 primary and R2 secondary,the challenge is:- We need to have one of those 4 subnets to be preferred from R2 instead of R1 , so when R3 wants to go to that subney , it uses backup instead of primary.

 

Any thoughts?

If you have can you share the config.

I tried using local pref for that specific prefix on backup router to be higher than primary router for R3 but it ended up changing all the prefixes advertised from backup to R3 being all higher :S

Can someone help ? Thanks

Best Regards,
Dawoud
CCNP NSE4 CEH
16 Replies 16

Lets say all LAN can communicate to those 4 subnets, when traffic comes from LAN to R3, R3 needs to prefer all 4 to go to primary R1 except one subnet to be preferred via backup, we need simple solution if possible, I already know complex ones.

Much thanks

Best Regards,
Dawoud
CCNP NSE4 CEH

without see the topology it is difficult to find solution, 
R1,2,3 all connect to Core SW? I think this is wrong only R3 connect to Core SW and R3 connect to R1 and R2.
R1 have eBGP to ISP1
R2 have eBGP to ISP2 

we need to make load share for both ISP 

first R1 and R2 must advertise the same 4 subnet via iBGP to R3.

R3 have 4 subnet with two path via R1 and R2 

since we have only one Router "R3" use weight not LP to load share.

*Toward R1

route-map UPDATES-1 permit 10

match ip address 1

set weight 100

 

route-map UPDATES-1 permit 20

match ip address 2


*Toward R2  

route-map UPDATES-2 permit 10

match ip address 1

  

route-map UPDATES-2 permit 20

match ip address 2

set weight 100

 

Thanks, we won't need any load sharing but thanks for your efforts man , cheers !

Best Regards,
Dawoud
CCNP NSE4 CEH

this is load sharing since you make traffic for specific subnet via ISP1 and other traffic for ISP2.
for why the prefix not work 
remove the deny 0.0.0.0/0 from the match prefix list  since the route-map 20 have already for all not match prefix, remove this and try again.

Harold Ritter
Spotlight
Spotlight

Hi Dawoud,

 

> I tried using local pref for that specific prefix on backup router to be higher than primary router for R3 but it ended up

> changing all the prefixes advertised from backup to R3 being all higher :S

 

It is possible to set the local preference only for that one subnet. Can you please share the configuration you used on the backup router to set the local preference?

 

Regards,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)

Hi Harold,

Here you go , the local preference set for all routes from the other primary router are marked with 200 local preference.

 

route-map BACKUPROUTESOUT permit 10
match ip address DCMOVE
set local-preference 210
route-map BACKUPROUTESOUT permit 20
set local-preference 150


R2#sh ip prefix-list
ip prefix-list DCMOVE: 2 entries
seq 5 permit 4.4.4.4/32
seq 20 deny 0.0.0.0/0 le 32

Best Regards,
Dawoud
CCNP NSE4 CEH

neighbor 57.7.7.2 route-map BACKUPROUTESOUT in

 

 

Best Regards,
Dawoud
CCNP NSE4 CEH

I tried standard ACL to match and it worked, not sure what is wrong with my prefix list , can you illustrate?

Best Regards,
Dawoud
CCNP NSE4 CEH

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Mahmoud,

>> I tried using local pref for that specific prefix on backup router to be higher than primary router for R3 but it ended up changing all the prefixes advertised from backup to R3 being all higher :S

 

you have likely used a command like

neighbor y.y.y.y local-preference 200

 

Instead you need to use a route-map to be able to be selective in LP increase as suggested by Harold.

 

ip prefix-list  TEST permit 10.10.30.0/24

 

route-map SEL-LP-RISE permit 10

match address prefix TEST

set local-preference 200

! final empty route-map clause to accept all other prefixes with no changes

route-map SEL-LP-RISE permit 20

 

router bgp   <myAS>

neighbor y.y.y.y route-map SEL-LP-RISE in

 

You may need to clear the BGP session to see the effect.

 

Hope to help

Giuseppe

 

Hi Giuseppe,

route-map BACKUPROUTESOUT permit 10
match ip address DCMOVE
set local-preference 210
route-map BACKUPROUTESOUT permit 20
set local-preference 150


R2#sh ip prefix-list
ip prefix-list DCMOVE: 2 entries
seq 5 permit 4.4.4.4/32
seq 20 deny 0.0.0.0/0 le 32

 

neighbor 57.7.7.2 route-map BACKUPROUTESOUT in

Best Regards,
Dawoud
CCNP NSE4 CEH

I tried standard ACL to match and it worked, not sure what is wrong with my prefix list , can you illustrate?

Best Regards,
Dawoud
CCNP NSE4 CEH

Hello Dawood,

as explained by Paul Driver in order to match a prefix-list you need to use

route-map BACKUPROUTESOUT permit 10
match ip address prefix  DCMOVE
set local-preference 210
route-map BACKUPROUTESOUT permit 20
set local-preference 150

 

So your previous config didn't work because it was looking for a named ACL with name DCMOVE and not for the prefix-list.

Likely all prefixes had matched the last clause.

When using a standard ACL you have solved for this reason.

 

Hope to help

Giuseppe

 

Hello


@MahmoudDawoud0323 wrote:

Hello Guys,

 

Here is the design and the objective:-

 

We have R1,R2 and R3 all connected via a core switch and from R3-R1 there is iBGP and from R3 to R2 there is iBGP too, 


 

What about an ibgp peering between R2-R3?  You have no mention of route reflectors so then IBGP would require a full mesh peering.

Can you post the topology of this network and if possible the run config all all 3 rtrs into a file and attach to your post.


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