Network labs Docs Open simulator →

BGP — local-preference for ingress path selection

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

What you will do

  1. On R1, define a route-map LP-PREFER that sets local-preference 200.

  2. Bind the route-map to the eBGP neighbour 10.0.12.2 on inbound updates: neighbor 10.0.12.2 route-map LP-PREFER in.

  3. Verify with show ip bgp on R1. Look for LocPrf 200 on the entry to 192.168.2.0/24.

Open this lab in your browser →

More labs on this topic

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