Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Weight

Direct answer

Weight is a Cisco-only BGP value that applies on the local router only and is never advertised to peers. The highest weight wins and it is checked first in best-path selection; locally originated routes get 32768 by default.

When to use this

Use it for a quick override on one router — make this router prefer a path regardless of every other attribute — or when one router ignores LOCAL_PREF and you need to find out why.

First 30 seconds

1. Cisco-only, local to the router; higher wins and it is checked first.

2. Default 0, or 32768 for locally originated routes.

3. neighbor X weight 100 or a route-map; not advertised to peers.

Operational verification

Weight set locally (neighbor weight or inbound route-map) → highest Weight wins before any other attribute → best path on this router only → RIB → this router's outbound traffic; other routers are unaffected

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard · IOS/IOS XE · Cisco IOS XE
Key commandshow ip bgp
Scope / prerequisiteUse it for a quick override on one router — make this router prefer a path regardless of every other attribute — or whe…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

6 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 First 30 seconds Verify boundary

Immediate answer: Verify Cisco-local Weight on all candidate paths and whether a policy set it before attributing best-path choice to external routing intent.

Verification chain: received path → inbound/local policy → Weight → LOCAL_PREF/other attributes → best path → RIB

Stop condition: Weight is local to the device; it does not propagate to peers or show network-wide exit policy.

Step 2 Operational verification and known-good state Verify boundary
show ip bgp
show ip bgp 203.0.113.0 255.255.255.0
show running-config | section router bgp

The table view has a Weight column for every path: 0 for learned routes, 32768 for local ones, anything else was configured. The detailed view prints weight <n> only when it is not 0. The configuration shows where a non-default value comes from.

Known-good: non-default Weights exist only where they were deliberately configured, and other routers in the AS reach the same decision by LOCAL_PREF — or the difference is intended.

Step 3 Verification and output interpretation Verify boundary

Inspect the Weight column/attribute for all candidate paths to the target prefix and confirm whether it is the first decisive difference. Compare the same prefix on other routers before assuming the AS has a consistent exit policy. After selection, verify RIB and CEF because local BGP preference still does not by itself show packet forwarding.

Step 4 Verification & troubleshooting Narrow the fault

1. show ip bgp <prefix> → weight appears on a path when it is not 0; show ip bgp has a Weight column.

2. Find where it is set: show running-config | section router bgp for neighbor … weight, and show route-map for set weight.

3. Run the same prefix lookup on another router in the AS. Does it choose differently, and is that intended?

4. After changing a Weight: clear ip bgp <neighbour> soft in.

Step 5 Failure signatures and troubleshooting branches Narrow the fault
  • A router ignores LOCAL_PREF. A Weight is set on it.
  • Two routers in the AS use different exits for the same prefix. One of them has a Weight; the other does not know.
  • A configured Weight has no effect. No soft clear was done, the route-map is on the wrong neighbour or direction, or the competing path is locally originated with 32768.
  • A locally originated prefix is preferred over a better external path. The 32768 default.
  • Nobody remembers why a neighbour has a Weight. A temporary override that was never removed.
Step 6 When the problem is really fixed Narrow the fault
  • The path meant to win shows the higher Weight and is best on this router.
  • Other routers in the AS make the choice the design expects.
  • Every non-default Weight in the configuration has a known reason.
  • A traceroute from this router leaves through the intended neighbour.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

Cisco-specific and the first step of best-path selection; higher wins. Weight is never advertised, so it affects only the router where it is set. Default is 0 for learned routes and 32768 for routes the router originates itself.

Key checks

show ip bgp → Weight column. show ip bgp <prefix> → weight appears on a path when it is not 0. show running-config | section router bgp → neighbor … weight or a route-map with set weight.

ReferenceWhat it is2 sections · depth on demand

BGP scope — internal and external paths

Weight is a Cisco-local preference used when comparing internal or external BGP candidates. Higher Weight wins before LOCAL_PREF among otherwise eligible candidates; a next hop must still be resolvable. Weight is not a standardized transmitted BGP path attribute and is not propagated to iBGP peers. Two routers receiving the same AS_PATH and communities can therefore select different exits because their local Weight differs. The retained eBGP examples illustrate an input source, not a propagation scope.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

What it is

Weight is a Cisco-specific number that a router assigns to paths in its own BGP table. The highest value wins, and it is checked before anything else. It is not a BGP attribute: it is never sent to any neighbour.

ReferenceWhy it matters1 section · depth on demand

Why it matters

Weight is the strongest tool and the narrowest. One command makes this router prefer one neighbour's routes regardless of what the attributes say — handy on a single router with two providers, or as a temporary override. The same property makes it a trap in a larger AS: only this router changes its mind, the others keep following LOCAL_PREF, and routers in the same AS end up using different exits.

ReferenceImportant terms & boundaries6 sections · depth on demand

Key points

  • Range 0–65535; higher wins; first step of best-path selection on Cisco.
  • Default 0 for learned routes, 32768 for routes the router originates itself.
  • Local to the router where it is set; not part of any update.
  • Set for everything from one neighbour with neighbor <ip> weight <n>, or selectively with set weight in an inbound route-map.
  • For a preference that the whole AS should share, use LOCAL_PREF instead.
  • Because local routes get 32768, a router prefers its own origination over a learned copy of the same prefix.

In depth

Weight is a Cisco-only preference on one router

Weight is step 1 in Cisco's best path order. Higher wins. The Cisco document describes it as Cisco-specific and local to the router: it's never advertised to any peer. Locally originated routes get weight 32768 and learned routes 0.

R1(config)# router bgp 64500
R1(config-router)# neighbor 192.0.2.1 weight 200
R1(config)# route-map PREFER-A permit 10
R1(config-route-map)# match ip address prefix-list CLOUD
R1(config-route-map)# set weight 500
R1(config-router)# neighbor 192.0.2.1 route-map PREFER-A in
R1# show ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*>  0.0.0.0          192.0.2.1                0             200 64510 i
*                    192.0.2.5                0             0   64511 i
*>  198.51.100.0/24  0.0.0.0                  0         32768 i

When to use weight

UseReason
One edge router with two ISPsSimple outbound preference on that router only
A temporary override on one router during maintenanceDoesn't change policy anywhere else
Preferring a direct path over the same prefix via iBGPApplies before LOCAL_PREF

For a preference that must apply to the whole AS, use LOCAL_PREF.

Pitfalls

PitfallEffect
Weight on one router, LOCAL_PREF elsewhereThat router may disagree with the rest of the AS, causing asymmetric routing
neighbor … weightApplies to all routes from that neighbour
Forgotten maintenance weightSilently overrides later LOCAL_PREF policy

Check

show ip bgp shows weight in its own column. For a single prefix, show ip bgp <prefix> shows weight only when it's non-zero.

Documented example, not captured output.

Quick reference

Weight is a Cisco-specific value applied on the local router only and never advertised. It is the first attribute in Cisco's best-path selection; the highest weight wins. Locally originated routes get 32768, learned routes 0.

router bgp 65010
 address-family ipv4 unicast
  neighbor 203.0.113.1 weight 200
! or per prefix via route-map
route-map W-IN permit 10
 match ip address prefix-list CRITICAL
 set weight 500

Documented example, not captured output.

Use weight only for router-local decisions; LOCAL_PREF is the tool for AS-wide policy.

Mechanics and state ownership

Weight is assigned at the moment a path enters the router's BGP table, by the neighbour setting or the inbound route-map, and stays with that path locally. Because the best-path comparison starts with it, nothing that arrives in an update can outrank it — not LOCAL_PREF, not a shorter AS_PATH.

The default of 32768 for locally originated routes has a visible consequence. A router that originates a prefix with a network statement keeps preferring its own route even when a neighbour advertises the same prefix with a high LOCAL_PREF, because the comparison never gets past Weight.

Scope is the thing to keep in mind. LOCAL_PREF is shared by the whole AS, MED is a message to the neighbouring AS, AS_PATH travels everywhere — Weight stops at the router. Used on one of several BGP routers in an AS it creates a private opinion that the others do not know about.

State model and selection mechanics

Weight is evaluated very early in Cisco BGP best-path selection and affects only the local router. Routes originated locally commonly receive a high default Weight, while learned routes commonly have zero unless policy changes it. Because Weight never propagates, two routers in the same AS can choose different exits for the same prefix if their local Weight policies differ.

Limits and common misconceptions

Weight is Cisco-specific local policy, not a standard BGP attribute carried in UPDATE messages. It should not be used as an implicit substitute for network-wide design. A route with higher Weight can beat a shorter AS_PATH or better MED, which is expected behavior when Weight policy exists.

ReferenceConfiguration & state1 section · depth on demand

Policy and configuration model

Use Weight only when a router-local decision is actually intended. For AS-wide exit policy, LOCAL_PREF is usually easier to reason about because it propagates over iBGP. If Weight is set by neighbor or route-map policy, scope it to the intended prefixes and document why the preference should not be shared with other BGP speakers.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

Cisco IOS / IOS XE RFC 4271Make this router prefer all paths learned from 192.0.2.2

Assumptions: Lab addressing; local AS 65000; eBGP neighbours already Established; route-refresh supported.

router bgp 65000
 address-family ipv4 unicast
  neighbor 192.0.2.2 weight 500
!
! then: clear ip bgp 192.0.2.2 soft in

Expected output

Cisco IOS / IOS XE RFC 4271show ip bgp 203.0.113.0 255.255.255.0

Expected state: The path with weight 500 is best although the other path has the higher LOCAL_PREF.

BGP routing table entry for 203.0.113.0/24
Paths: (2 available, best #1, table default)
  65010
    192.0.2.2 from 192.0.2.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, weight 500, valid, external, best
  65020
    10.0.0.2 from 10.0.0.2 (4.4.4.4)
      Origin IGP, metric 0, localpref 200, valid, internal
! Illustrative output, not captured Evidence.
Weight is compared before LOCAL_PREF, so 500 beats the default 0 even though path 2 has LOCAL_PREF 200. The rest of the AS does not see this Weight and will still prefer path 2 — a common cause of routers disagreeing about the exit.
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 4271

Authoritative/upstream documentation reviewed for bounded claims in Routing → BGP → eBGP → Weight. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%
Embedded reference data

Quick lookup tables

Weight · routing reference

Compact path-selection and evidence boundaries for fast lookup.

PropertyWeight
ScopeOne router
AdvertisementNot sent to peers
PreferenceHigher wins
Typical useRouter-local exit choice

Weight operational reference

Topic-specific bounded interpretation: known-good BGP state, suspicious signatures and the next technical proof boundary.

BoundaryKnown-good for WeightSuspicious signatureNext proof
Session/inputCorrect peer, AF and prefix contextTransport, FSM or prefix eligibility disagreesPeer detail and exact prefix
Attribute/policyCisco-local BGP Weight as a non-advertised per-router preference, with higher values preferred and no automatic consistency across other routers in the AS matches intended policyone router choosing a different exit because Weight was configured only locally, an inbound route-map assigning Weight to unintended prefixes, operators expecting Weight to propagate to peers, a locally originated path winning due to its local value, or a high-Weight path selected while NEXT_HOP/RIB/FIB state prevents usable forwardingCompare candidate paths and policy
Route/forwardingExpected best path reaches RIB/FIBBGP state exists but installed path disagreesRIB/FIB/CEF and next-hop proof
ClosureOriginal test passes for explained reasonSymptom moved, was bypassed or state was forcedRegression/failover test
Confirmation

Confirm action

Continue?