One thing is not clear in your question - are you trying to influence localpref attribute of BGP updates or preference (also known as administrative distance) of BGP routes?
If you need to influence localpref of the routes (so that this router is the preferred exit point from your AS to the peer AS), then, as Steve already mentioned, you need to increase localpref of incoming prefixes from eBGP peering with import policy. I assume that you have iBGP peering with this router and you try to make this router as preferred exit point from your ASN to the peer ASN.
"local-preference
-Preference to assign to routes that are advertised to the group or peer."
https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/local-preference-edit-protocols-bgp.html
BUT, if you are trying to change preference of BGP itself from default of 170 to, for instance, 15, then that's a different story, you need to set preference under BGP group
https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/preference-edit-protocols-bgp.html
------------------------------
FARID AKHUNDOV
------------------------------
Original Message:
Sent: 03-01-2024 06:08
From: CHRISTIAN KNOEFEL
Subject: BGP Routing preference
Hi,
my MX204 is BGP - EBGP.
protocols {
bgp {
group PEERING-DCIX-FRA1 {
type external;
local-preference 300;
import BGP-PEERING-IN;
export BGP-PEERING-OUT;
peer-as 6695;
local-as 101010;
neighbor 80.81.192.157 {
family inet {
any {
prefix-limit {
maximum 350000;
}
}
}
}
}
I have set " local-preference 300;" to prioritize the outgoing data traffic to the routes learned by this AS. Unfortunately, the setting doesn't work. The routes remain at the value 170.
Can you help?
Thanks
Christian
------------------------------
CHRISTIAN KNOEFEL
------------------------------