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

IOS XR Route Policy

mspdog22
Level 1
Level 1

Hello 

 

I am trying to build a route policy to set the LCOAL PREF along with a PREFIX SET. 

 

We are trying to set the Local Pref to 150 on all our IX session and 130 on all of our Transit connections.  

 

Here is my code. 

 

route-policy PEERING-OT
if destination in IPV4-PREFIXES then
set local-preference 150
else
drop
endif
end-policy

 

 

 

1 Accepted Solution

Accepted Solutions

Hi @mspdog22 ,

This should be pretty simple then.

The inbound policy to set the LP to 150:

route-policy policy1

set local-preference 150

end

and the outbound policy to advertise your local prefixes and prepend your AS 3 times:

route-policy policy2
if destination in IPV4-PREFIXES then
prepend as-path <your AS number> 3
else
drop
endif
end-policy

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

View solution in original post

5 Replies 5

Harold Ritter
Cisco Employee
Cisco Employee

Hi @mspdog22 ,

If the IPV4-PREFIXES prefix set contains all of the prefixes that you expect to accept from the peer, then the policy is fine. All the prefixes matching the prefix set will get their local preference set to 150. All prefixes not matching the prefix set will be dropped. Is that your expectation?

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

The prefix set is our prefixes on our router to protect us from becoming a transit AS. 

We have an IX port and we want to set the local pref to 150 and also prepend our as 2 times on the IX peering session. 

 

Just trying to find the correct code as i am still a bit new to ios xr. 

Hi @mspdog22 ,

> We have an IX port and we want to set the local pref to 150 and also prepend our as 2 times on the IX      > peering session. 

Do you want to set the LP on the outbound policy towards the IX peering session?

If so, the local preference is not the right BGP attribute to use. The local preference is used to influence outbound traffic and therefore needs to be set in an inbound policy on the IX peering session. 

The as-path prepend on the other end would be done on the outbound policy applied to the IX peering session.

Can you please clarify what you are trying to achieve?

Regards,


Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

mspdog22
Level 1
Level 1

Yes

 

We want to set the LOCAL PREF on our peering session. We want all traffic on our ix peer to be preferred path going outbound. We will set the LOCAL PREF or our transit peers to 130 and we will set all of our downstream sessions to 200. Then will will prepend our as 3 times on the transit connections and then prepend our ix port 2 times with certain peers that we have a peering session with.. 

 

Does that help?

 

 

Hi @mspdog22 ,

This should be pretty simple then.

The inbound policy to set the LP to 150:

route-policy policy1

set local-preference 150

end

and the outbound policy to advertise your local prefixes and prepend your AS 3 times:

route-policy policy2
if destination in IPV4-PREFIXES then
prepend as-path <your AS number> 3
else
drop
endif
end-policy

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México