BGP — local-preference for ingress path selection
- Routing
- Intermediate
- 12 min
- 3 steps
- Cisco IOS-style
Two ASes peering eBGP across a /30. On R1, set local-preference on inbound updates from R2 so that any future second exit toward AS 65002 would lose the best-path race against this one.
Open this lab in your browser →
Free · no install · no account
Scenario
Local-preference is iBGP-scoped — it influences best-path selection inside the local AS but isn't advertised to eBGP neighbours. The classic shape: ingress engineering. You receive the same prefix from two upstream peers; you mark the preferred peer's advertisement with a higher local-pref via inbound route-map. The local AS's iBGP propagates the local-pref; best-path selection picks the higher value. Default local-pref is 100. Higher wins. In this lab there's only one upstream (R2), but the configuration pattern (route-map → set local-preference → neighbor in) is the same as in a multi-homed setup. After commit, show ip bgp on R1 should show LocPrf 200 on the route to 192.168.2.0/24.
Topology
2 × router · Cisco IOS-style
R1— routerR2— router
What you will do
On
R1, define a route-mapLP-PREFERthat sets local-preference 200.Bind the route-map to the eBGP neighbour
10.0.12.2on inbound updates:neighbor 10.0.12.2 route-map LP-PREFER in.Verify with
show ip bgponR1. Look forLocPrf 200on the entry to192.168.2.0/24.
Open this lab in your browser →
More labs on this topic
- Syntax delta — static route (Extreme EXOS)Beginner · 4 min
- Syntax delta — static route (Cisco IOS)Beginner · 4 min
- Syntax delta — static route (Juniper Junos)Beginner · 5 min
- Syntax delta — static route (VyOS)Beginner · 5 min
- Static routes — fix hub-and-spokeBeginner · 12 min
- Static routes — egress-interface form (point-to-point)Beginner · 8 min
This lab in other languages
BGP — Local-Preference zur Ingress-Pfad-AuswahlBGP — local-preference para selección de ruta de entradaBGP — local-preference para seleção de caminho de entradaBGP — local-preference pour la sélection du chemin entrantBGP — ingress path selection के लिए local-preferenceBGP — 入方向路径选择的 local-preferenceBGP — local-preference per la selezione del percorso ingressBGP — イングレスパス選択のための local-preferenceBGP — ingress 경로 선택용 local-preferenceBGP — local-preference для выбора входящего путиBGP — ingress yol seçimi için local-preferenceBGP — local-preference cho chọn đường vào