Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

ASR 9000 route-policy on ipv4 and vpnv4 neighbors

Hi
To reduce configuraton i would like to use the same route-policy for ipv4 and vpnv4 routes from the same neighbors on ASR 9000.

I know that a "pass all" route-policy will work just fine, also a route-policy like this works fine:

route-policy eBGP_NEIGHBORS
    set local-preference 50
  endif
end-policy
!

!

!

But why doesn´t this route-policy work?

rd-set EXT_SERVICES_PRIMARY
  1.1.1.1:*
end-set
!
rd-set EXT_SERVICES_SECUNDARY
  2.2.2.2:*
end-set
!

route-policy eBGP_NEIGHBORS
  if rd in EXT_SERVICES_PRIMARY then
    set local-preference 120
  elseif rd in EXT_SERVICES_SECUNDARY then
    set local-preference 20
  else
    set local-preference 80
  endif
end-policy
!

The effect of this is that vpnv4 routes looks just fine but ipv4 routes is missing in bgp table. I have tryed all kind of configs but it just will not work, what am i missing?

The idea of this route-policy is that routes advertised by rd 1.1.1.1 will act as primary and rd 2.2.2.2 as secundary.
1.1.1.1 and 2.2.2.2 is handleing the same routes.
1.1.1.1 is located in one AS and 2.2.2.2 in an other AS
my ASR that i am working on is in a third AS
And alla other routes will have a default local-pref of 80
 

 

 

3 REPLIES
Cisco Employee

Hello Daniel, Trust your are

Hello Daniel,

 

Trust your are doing great.

 

Please try the below config and check if it helps you out 

 

route-policy eBGP_NEIGHBORS
  if rd in EXT_SERVICES_PRIMARY then
    set local-preference 120
  elseif rd in EXT_SERVICES_SECUNDARY then
    set local-preference 20
  endif
    set local-preference 80
  end-policy.

 

Regards,

Mohit

 

** Please do not forget to rate the post if it is helpful

 

Community Member

HiSorry for the delay, i am

Hi
Sorry for the delay, i am multitasking different projects.

It looks like the route-policy handles every row before execute.
So..
if (match something) then set local-pref 120
if or elseif (match something) then set local-pref 20
if, elseif och endif set local-pref 80

Everythiing will be local-pref 80

 

This looks like it is working

community-set EXT-PRIMARY
  *:1030
end-set
!
community-set EXT-TERTIARY
  *:1010
end-set
!
community-set EXT-SECONDARY
  *:1020
end-set
!
route-policy EXT_SERVICES
  if community matches-any EXT-PRIMARY then
    set local-preference 1030
  endif
  if community matches-any EXT-SECONDARY then
    set local-preference 1020
  endif
  if community matches-any EXT-TERTIARY then
    set local-preference 1010
  endif
end-policy
!
route-policy eBGP_WAN-1GB
  set local-preference 80
  apply EXT_SERVICES
end-policy
!
Every route will have local-pref 80 but not whats in route-policy EXT_SERVICES
But dont forget to allox communitys to exchange between eBGP neighbors.

Thanks
/Daniel

Community Member

If you watch the if statement

If you watch the if statement, you're challenging that if the RD is something, or else, else... but, maybe, it doesn't work if you don't have an RD.

 

Based on the Mohit's answer I think that maybe, that's the reason.

 

route-policy eBGP_NEIGHBORS
  if rd in EXT_SERVICES_PRIMARY then
    set local-preference 120
  elseif rd in EXT_SERVICES_SECUNDARY then
    set local-preference 20
  else   <<< So if not "EXT_SERVICES_PRIMARY" and not "EXT_SERVICES_SECUNDARY", but stills in "if rd.."
    set local-preference 80
  endif

 

Mohit's:

route-policy eBGP_NEIGHBORS
  if rd in EXT_SERVICES_PRIMARY then
    set local-preference 120
  elseif rd in EXT_SERVICES_SECUNDARY then
    set local-preference 20
  endif
    set local-preference 80 >>>> Outside the if statement!
  end-policy.

 

Let us know if the Mohit's answer worked! Just to learn something new :)

287
Views
0
Helpful
3
Replies
CreatePlease to create content