Configuration Local preference

Hello,
I want to set up locals preferences on my infra,

I want to set up locals preferences on my infra. I have made this configuration:
Building configuration…

Current configuration : 3234 bytes
!
! Last configuration change at 12:30:59 UTC Tue May 9 2023
! NVRAM config last updated at 08:59:06 UTC Tue May 9 2023
!
version 15.6
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-recovery
!
hostname C1_B
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
ip cef
!
!
!
!

no ipv6 cef
!
!
!
!
!
!
!
multilink bundle-name authenticated
l3-over-l2 flush buffers
asr901-storm-control-bpdu 1000
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
license udi pid A901-4C-F-D sn CAT2407U07L
bridge-domain 20
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface GigabitEthernet0/0
no ip address
negotiation auto
service instance 20 ethernet
encapsulation untagged
bridge-domain 20
!
!
interface GigabitEthernet0/1
no ip address
negotiation auto
!
interface GigabitEthernet0/2
no ip address
negotiation auto
service instance 10 ethernet
encapsulation untagged
bridge-domain 10
!
!
interface GigabitEthernet0/3
no ip address
negotiation auto
service instance 30 ethernet
encapsulation untagged
bridge-domain 30
!
!
interface GigabitEthernet0/4
no ip address
media-type auto-select
negotiation auto
!
interface GigabitEthernet0/5
no ip address
media-type auto-select
negotiation auto
!
interface GigabitEthernet0/6
no ip address
media-type auto-select
negotiation auto
!
interface GigabitEthernet0/7
no ip address
media-type auto-select
negotiation auto
!
interface GigabitEthernet0/8
no ip address
negotiation auto
qos-config scheduling-mode min-bw-guarantee
!
interface GigabitEthernet0/9
no ip address
negotiation auto
qos-config scheduling-mode min-bw-guarantee
!
interface GigabitEthernet0/10
no ip address
negotiation auto
qos-config scheduling-mode min-bw-guarantee
!
interface GigabitEthernet0/11
no ip address
negotiation auto
qos-config scheduling-mode min-bw-guarantee
!
interface FastEthernet0/0
no ip address
shutdown
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
description int gi0/2
ip address 192.168.1.2 255.255.255.0
ip ospf 1 area 0
!
interface Vlan20
description int gi0/0
ip address 192.168.25.1 255.255.255.0
!
interface Vlan30
description int gi0/3
ip address 192.168.102.118 255.255.255.0
!
router ospf 1
router-id 3.3.3.3
network 192.168.1.0 0.0.0.255 area 0
!
router bgp 65001
bgp log-neighbor-changes
bgp rpki server tcp 192.168.102.39 port 3323 refresh 600
neighbor 192.168.1.1 remote-as 65001
neighbor 192.168.25.2 remote-as 65002
neighbor 192.168.102.39 remote-as 65001
!
address-family ipv4
network 192.168.1.0
network 192.168.5.0
network 192.168.25.0
neighbor 192.168.1.1 activate
neighbor 192.168.25.2 activate
neighbor 192.168.102.39 activate
neighbor 192.168.102.39 route-map rpki in
exit-address-family
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
route-map rtmp-rpki permit 10
match rpki invalid
set local-preference 50
!
route-map rtmp-rpki permit 20
match rpki not-found
set local-preference 100
!
route-map rtmp-rpki permit 30
match rpki valid
set local-preference 200
!
!
!
control-plane
!
environment monitor
!
line con 0
line vty 0 4
login
!
exception crashinfo buffersize 128
!
!
end

BGP table version is 11, local router ID is 192.168.102.118
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

V* i 192.168.1.0 192.168.1.1 0 100 0 i
V*> 0.0.0.0 0 32768 i
N*> 192.168.2.0 192.168.25.2 0 0 65002 i
N* 192.168.25.0 192.168.25.2 0 0 65002 i
V*> 0.0.0.0 0 32768 i

What is missing in my configuration for the local pref to be displayed in sh ip bgp?
Best regards

In the BGP neighbor configuration for 192.168.102.39 you are referencing route-map rpki, while the name of your route-map is rtmp-rpki.

ok thanks for the mistake. The route map I have to activate it on the link between the rpki servers and the router or in the eBGP connection for the local preference to appear?

The “bgp rpki server” configuration is enough for your router to receive RPKI information from your validator software. You do not need to set up a BGP session between your router and the server running the validator.

Route maps can be used on eBGP peering sessions to influence the BGP decision process (for example changing local preference), based on the RPKI information. Note that in production environments it is recommended to drop RPKI invalid announcements, not lower their local preference.

See https://labs.ripe.net/documents/64/BGP_RPKI_Tofoni_Luciani_20200319.pdf for more details about the RPKI architecture and specific examples for Cisco routers.

1 Like