07-27-2024 07:33 PM
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
Solved! Go to Solution.
07-28-2024 09:40 AM
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,
07-27-2024 07:46 PM - edited 07-27-2024 07:48 PM
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,
07-27-2024 08:00 PM
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.
07-27-2024 08:32 PM - edited 07-27-2024 09:09 PM
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,
07-27-2024 11:59 PM
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?
07-28-2024 09:40 AM
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,
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide