Course contents

Module 3: Path SelectionLesson 3.1 (1 of 13 in this module)10 of 43 in the BGP course

BGP path attributes

R1 has two paths to 203.0.113.0/24 and can install only one. What information does BGP have to choose between them? Everything it knows is carried in path attributes, so let's learn to read them.

Advanced · 13 min read

You'll learn to name the main BGP path attributes, say which are well-known or optional and transitive or not, and read them in show ip bgp output.

A route is a prefix plus a description of its journey

A BGP UPDATE message carries two things: the destinations, called NLRI (network layer reachability information), and a set of path attributes that describe how to get there. One set of attributes applies to every prefix listed beside it. BGP has no metric like OSPF cost. It compares attributes.

One UPDATE: path attributes plus the prefixes they describe
One UPDATE: path attributes plus the prefixes they describeAn illustrative UPDATE from ISP A to R1. The path attributes ORIGIN, AS_PATH, NEXT_HOP and MED apply to the prefix 203.0.113.0/24 listed as network layer reachability information.UPDATE from ISP A to R1Path attributesNLRI (the destinations)ORIGIN: i (IGP)AS_PATH: 64501NEXT_HOP: 192.0.2.1MED: 0203.0.113.0/24One UPDATE can listseveral prefixes thatshare these attributes

On small screens, swipe sideways or focus the diagram and use the arrow keys.

A teaching view, not a byte-accurate capture. The attributes travel once and apply to every prefix listed beside them.

BGP chooses paths by comparing attributes, not by adding up link costs. To steer traffic you change an attribute on a route, so you need to know which attributes exist and who can see them.

Four categories, two questions

Every attribute answers two questions. Must every BGP router recognise it (well-known) or may a router not know it (optional)? And if a router does not recognise it, does it pass it on (transitive) or drop it (non-transitive)? Combining the answers gives four categories.

The four kinds of BGP path attribute
The four kinds of BGP path attributeA two by two grid. Well-known mandatory: ORIGIN, AS_PATH, NEXT_HOP. Well-known discretionary: LOCAL_PREF, ATOMIC_AGGREGATE. Optional transitive: COMMUNITY, AGGREGATOR. Optional non-transitive: MED, ORIGINATOR_ID, CLUSTER_LIST.Well-known: every router recognises itOptional: a router may not recognise itWell-known mandatoryORIGIN, AS_PATH, NEXT_HOPCarried in every UPDATEthat advertises a prefixOptional transitiveCOMMUNITY, AGGREGATORA router that does not knowthem passes them onWell-known discretionaryLOCAL_PREF, ATOMIC_AGGREGATERecognised by every router,but not required in every UPDATEOptional non-transitiveMED, ORIGINATOR_ID, CLUSTER_LISTA router that does not knowthem drops them

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Well-known means every BGP router must recognise the attribute. Transitive means a router that does not recognise it passes it on.

How far each attribute travels

Before the detail, one picture. Most confusion about attributes comes from expecting one to reach further than it does.

How far each attribute travels
How far each attribute travelsWeight stays on one router. LOCAL_PREF is shared inside one AS. MED is sent to a neighbouring AS and not beyond. AS_PATH and ORIGIN travel with the route across the internet, and communities travel if the routers send them.Weight: this router onlynever sentLOCAL_PREF: your own ASiBGP onlyMED: one neighbouring ASnot passed onAS_PATH, ORIGIN, COMMUNITY: the whole pathAS_PATH and ORIGIN always; COMMUNITY only if sent

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Pick the attribute whose reach matches what you want to influence: one router, your whole AS, a neighbour, or everyone downstream.

The rule behind every traffic decision

A route advertisement and the traffic that follows it move in opposite directions. Your neighbour tells you about 203.0.113.0/24, and you send packets to it. So there are two separate jobs, and each uses different attributes.

Routes flow one way, traffic flows the other
Routes flow one way, traffic flows the otherThe remote network advertises 203.0.113.0/24 towards the company through ISP A. The company sends traffic for it back along the same path. Policy on routes the company receives steers outbound traffic. Policy on routes the company advertises steers inbound traffic.Your companyAS 64500ISP AAS 64501Remote networkAS 64503203.0.113.0/24 sits in the remote networkgreen: route advertisementblue: user trafficTraffic you SENDChange what you receive:weight, LOCAL_PREF(inbound route map)Traffic you RECEIVEChange what you advertise:AS_PATH prepend, MED,communities, more-specifics

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Every BGP traffic-engineering decision starts with this question: am I changing what I hear, or what I tell?
  • Outbound traffic (you send): you control it fully. Change how you rank the routes you receive: weight on one router, LOCAL_PREF for the whole AS.
  • Inbound traffic (you receive): you can only influence it, because other networks make the decision. Change what you advertise: AS_PATH prepending, MED, communities the provider honours, and more-specific prefixes.

The rest of the lesson takes each attribute in turn: what it is, how a router uses it, and how you use it to move traffic. All examples use the course network: the company (AS 64500) has R1 connected to ISP A (192.0.2.1, AS 64501) and R2 connected to ISP B (192.0.2.5, AS 64502), and the company owns 198.51.100.0/24.

Weight: steer one router

What it is. A Cisco-only number from 0 to 65535, kept on the router and never sent. Routes the router originated get 32768, everything else 0. It is the first value compared, and the highest wins.

How it influences traffic. Outbound only, and only for traffic that passes through that router. Use it when one router needs a different exit from the rest of the AS, for example a router at a remote site that should always use its local ISP.

route-map ISPA-WEIGHT permit 10 set weight 300 ! router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 route-map ISPA-WEIGHT in end clear ip bgp 192.0.2.1 soft in

R1. Every route from ISP A gets weight 300 on R1 only. A one-line alternative is neighbor 192.0.2.1 weight 300.

Weight is not shared
Weight is not sharedR1 and R2 can disagree.R1Weight 300 on ISP AExits via ISP AR2No weight setMay choose adifferent exitvs

On small screens, swipe sideways or focus the diagram and use the arrow keys.

This is why weight is a poor tool for a policy the whole AS should follow.

LOCAL_PREF: steer the whole AS

What it is. A number carried in iBGP that says how much this AS prefers a route. Default 100, highest wins. It is compared second, after weight, so an unset weight never interferes.

How it influences traffic. Outbound, for every router in the AS at once. The edge router that receives the route sets the value, iBGP carries it to the others, and all of them pick the same exit. It is the standard tool for "ISP A is primary, ISP B is backup".

Local preference chooses the exit for the whole AS
Local preference chooses the exit for the whole ASISP A, R1, R2 and ISP B in a row. R1 sets local preference 200 on routes from ISP A. R2 keeps the default 100 for routes from ISP B. iBGP carries local preference 200 from R1 to R2, so both routers leave through R1 and ISP A.Company AS 64500local-pref 200iBGP carries 200local-pref 100 (default)ISP AAS 64501R1RID 1.1.1.1R2RID 2.2.2.2ISP BAS 64502Both routers prefer the path through R1 and ISP AThe ISP B path stays in the table as the backup

On small screens, swipe sideways or focus the diagram and use the arrow keys.

LOCAL_PREF travels inside the AS, so one setting on R1 steers R2 as well. Weight would only have changed R1.
route-map ISPA-IN permit 10 set local-preference 200 ! router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 route-map ISPA-IN in end clear ip bgp 192.0.2.1 soft in

R1. Routes from ISP A now carry local preference 200. ISP B routes keep 100, so R1 and R2 both leave through ISP A while it is up.

You can set different values for different prefixes, which gives you load sharing: send traffic for some destinations out of ISP A and the rest out of ISP B, by matching prefixes in the route map.

Illustrative Cisco IOS XE output written for this lesson, not a router capture
R2#show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 11
Paths: (2 available, best #2, table default)
  64502
    192.0.2.5 from 192.0.2.5 (12.12.12.12)
      Origin IGP, metric 0, localpref 100, valid, external
  64501
    10.255.0.1 from 10.255.0.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 200, valid, internal, best
On R2 the path through ISP A (learned from R1) has localpref 200 and wins, even though R2's own ISP B path is external. LOCAL_PREF is compared before eBGP over iBGP.

AS_PATH: how routes are measured, and prepending

What it is. The list of autonomous systems a route crossed, newest first. It prevents loops and, after weight and LOCAL_PREF, it is the main measure of distance: the shortest path wins.

The AS path grows by one AS at every eBGP hop
The AS path grows by one AS at every eBGP hopAS 64503 originates 203.0.113.0/24 with an empty AS path inside its own AS. It sends the route to AS 64501, which sees AS path 64503 and adds its own number when passing it to AS 64500, which sees AS path 64501 64503.Prefix 203.0.113.0/24AS 64503Originates the prefixAS_PATH: (empty)AS 64501ISP AAS_PATH: 64503AS 64500Your companyAS_PATH: 64501 64503UPDATEUPDATEIf AS 64500 saw 64500 inside the path, it would drop the route

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Each AS prepends its own number when it advertises a route to an eBGP neighbour. A router that finds its own AS number in a path drops the route, which is how BGP prevents loops.

An AS adds its number only when the route leaves it over eBGP. Over iBGP the path does not change.

How it influences traffic. Inbound. Other networks compare path lengths, so if you make the path through ISP B look longer, networks that have a choice send their traffic through ISP A. You do this by adding your own AS number several times to the paths you advertise to ISP B.

Prepending makes one path look longer to the rest of the internet
Prepending makes one path look longer to the rest of the internetA remote network in AS 64510 hears the company prefix through ISP A with AS_PATH 64501 64500, length 2, and through ISP B with AS_PATH 64502 64500 64500 64500, length 4, because the company prepended its own AS twice on the ISP B session. The shorter path through ISP A wins.Remote networkAS 64510ISP AAS 64501ISP BAS 64502AS_PATH: 64501 64500length 2, preferredAS_PATH: 64502 64500 64500 64500length 4, less attractiveCompanyAS 64500set as-path prepend 64500 64500(on the session to ISP B)

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The company adds copies of its own AS number on the ISP B session only. Remote routers compare AS_PATH length before they look at anything the company cannot influence.
route-map ISPB-OUT permit 10 match ip address prefix-list COMPANY-ONLY set as-path prepend 64500 64500 64500 ! router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.5 route-map ISPB-OUT out end clear ip bgp 192.0.2.5 soft out

R2. ISP B and its customers now see 64500 four times in the path to 198.51.100.0/24 instead of once.

There is a second, reverse use: you can also filter by AS_PATH with an AS-path access list, to accept or reject routes based on who originated them or which ASes they crossed. That is covered in the filtering lesson.

MED: ask a neighbour to use one link

What it is. Multi-exit discriminator, shown as metric. A number you attach to routes you advertise to a neighbouring AS to suggest which of several links into your network it should use. Lower wins. A route with no MED counts as 0 on IOS.

How it influences traffic. Inbound, and only in one situation: you have two or more links to the same neighbouring AS. By default a router compares MED only between paths from the same neighbouring AS, and the neighbour does not pass it on. With two different ISPs, MED does nothing useful.

MED works with one neighbouring AS, not across two
MED works with one neighbouring AS, not across twoLeft: R1 and R2 both connect to ISP A. The company sends MED 50 on one link and MED 100 on the other, and ISP A prefers MED 50. Right: the company connects to ISP A and ISP B with MED 50 and MED 100. Different ASes do not compare these values and MED is not passed on.Two links to the same ISP: MED worksLinks to two ISPs: MED does not steerISP AAS 64501R1AS 64500R2AS 64500MED 50MED 100ISP A prefers the lower MEDISP AAS 64501ISP BAS 64502CompanyAS 64500MED 50MED 100No router compares the two values.MED is not passed on to other ASes.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

MED is a hint from one AS to one neighbouring AS. It cannot choose between two different providers.
! On R1 (preferred entry point) route-map TO-ISPA-MED permit 10 set metric 50 ! router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 route-map TO-ISPA-MED out ! On R3 (backup entry point, second link to ISP A) route-map TO-ISPA-MED permit 10 set metric 100 ! router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.9 route-map TO-ISPA-MED out

Two company routers, both connected to ISP A. ISP A compares 50 and 100 and sends traffic for the company prefix in through R1. R3 is a hypothetical second router, added here for this example.

Communities: ask the provider to do it for you

What it is. A tag, written like 64501:80, attached to a route. On its own it does nothing. A router that sees the tag can match it in a route map and act.

How it influences traffic. Mostly inbound, by borrowing the provider's own policy. Large providers publish a list of communities customers can attach: lower my local preference inside your network, prepend towards a given peer, do not announce to a region. That reaches inside networks you cannot configure.

A provider community changes the provider's choice
A provider community changes the provider's choiceFour steps from your route map to the provider's routing decision.You tagset community64501:80ISP A readsmatch community64501:80ISP A actsset local-pref80 inside ISP AResultInbound trafficprefers ISP B

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The community values are defined by each provider. 64501:80 is an example, not a standard.
route-map TO-ISPA permit 10 match ip address prefix-list COMPANY-ONLY set community 64501:80 ! router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 send-community neighbor 192.0.2.1 route-map TO-ISPA out end clear ip bgp 192.0.2.1 soft out

R1. 64501:80 is a hypothetical provider community meaning lower the local preference to 80 for this route. IOS does not send communities unless send-community is configured on the neighbour.

More-specific prefixes: the strongest inbound tool

None of the attributes above matter if a router has a route that is more specific, because the routing table looks for the longest prefix match before any BGP comparison. If you advertise 198.51.100.0/25 to ISP A and 198.51.100.128/25 to ISP B, and the /24 to both, traffic for each half goes through the provider that holds its /25, whatever the attributes say.

Splitting a prefix steers inbound traffic
Splitting a prefix steers inbound trafficEach half goes in through a different ISP.ISP A198.51.100.0/25plus the /24ISP B198.51.100.128/25plus the /24and

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Both ISPs also hear the /24, so if one link fails the other still carries everything.

NEXT_HOP and ORIGIN: usually correctness, rarely policy

NEXT_HOP is the address the router forwards to. Over eBGP the advertiser sets it to itself. Over iBGP it is not changed, which causes a classic fault.

NEXT_HOP: eBGP changes it, iBGP does not
NEXT_HOP: eBGP changes it, iBGP does notISP A advertises 203.0.113.0/24 to R1 over eBGP with next hop 192.0.2.1. R1 passes it to R2 over iBGP and by default leaves the next hop at 192.0.2.1, which R2 cannot reach. With next-hop-self, R1 sets the next hop to its own loopback 10.255.0.1.ISP AAS 64501R1AS 64500R2AS 64500eBGPiBGPNEXT_HOP 192.0.2.1set by ISP ADefault iBGP: NEXT_HOP stays 192.0.2.1R2 has no route to it, path not validWith next-hop-self on R1NEXT_HOP 10.255.0.1, R2 can reach itFix on R1: neighbor 10.255.0.2 next-hop-self

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The next hop is the address the router forwards packets to. A path whose next hop is unreachable is not valid, so it is never chosen as best.

As a traffic tool, next hop works indirectly: after the choice between paths is made, the IGP cost to the next hop breaks ties. Setting the next hop with a route map (set ip next-hop) is possible but rare, and it silently sends traffic somewhere the AS path did not suggest. Treat it as a last resort.

ORIGIN records how the route entered BGP and ranks below path length. It matters only when everything above ties, so it is a weak traffic tool. You can set it with set origin incomplete to make one path lose a tie, but prefer LOCAL_PREF or prepending.

The three ORIGIN values in order of preference
The three ORIGIN values in order of preferenceIGP, EGP and incomplete.i IGPEntered with the network commande EGPFrom the retired EGP protocol,almost never seen now? IncompleteEntered by redistribution,the source is not known

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Seen as the code before the path in show ip bgp.

Choosing the right attribute for the goal

Choosing the right attribute for the goal
Choosing the right attribute for the goalYou want to; Direction; Use; Configured on. One router uses a different exit: Outbound Weight That router, inbound route map The whole AS leaves via ISP A: Outbound LOCAL_PREF Edge router, inbound route map Others reach you mostly via ISP A: Inbound AS_PATH prepend Edge router, outbound route map to ISP B One ISP uses a preferred link into you: Inbound MED Both edge routers, outbound route map to the same ISP Change the provider's own policy: Inbound Community Edge router, outbound route map plus send-community Split traffic per destination block: Inbound More-specific prefixes network or aggregate statements per ISPYou want toDirectionUseConfigured onOne router uses adifferent exitOutboundWeightThat router, inboundroute mapThe whole ASleaves via ISP AOutboundLOCAL_PREFEdge router, inboundroute mapOthers reach youmostly via ISP AInboundAS_PATH prependEdge router, outboundroute map to ISP BOne ISP uses apreferred linkinto youInboundMEDBoth edge routers,outbound route map to thesame ISPChange theprovider's ownpolicyInboundCommunityEdge router, outboundroute map plussend-communitySplit traffic perdestination blockInboundMore-specific prefixesnetwork or aggregatestatements per ISP

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: the left box names the item, the others describe it.

When two of these disagree, the best-path order settles it. Weight and LOCAL_PREF are compared first, so they override everything an outsider does to your advertisements.

BGP best-path order on Cisco IOS XE
BGP best-path order on Cisco IOS XETen rows. A path must first be valid with a reachable next hop. Then Cisco IOS XE compares weight, local preference, local origination, AS_PATH length, origin, MED, eBGP over iBGP, IGP metric to the next hop and finally the tie-breakers. The first difference decides.Gate: the path must be valid, with a reachable next hop and not filtered1Weighthighest wins (Cisco only, local to this router)2LOCAL_PREFhighest wins (shared inside the AS)3Locally originatedpreferred over paths learned from peers4AS_PATH lengthshortest wins5ORIGINlowest wins: IGP, then EGP, then incomplete6MEDlowest wins (same neighbouring AS by default)7eBGP over iBGPan external path beats an internal one8IGP metric to next hoplowest wins9Tie-breakersoldest eBGP path, lowest router ID, lowest neighbour IPFirst difference wins. Steps 1 and 2 are the ones you configure most often.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The comparison stops at the first step where the paths differ. Later steps are never reached for that prefix.

Summary of the main attributes

What each common attribute does
What each common attribute doesThese attributes decide which path wins or how it is described.AS_PATHLists the ASes crossed; loop check and path lengthNEXT_HOPThe address to forward to; must be reachableLOCAL_PREFPreference inside the AS; highest winsMEDHint to a neighbouring AS; lowest winsCOMMUNITYA tag that policy can match and act on

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Attributes are the vocabulary of policy.
Summary of the main attributes
Summary of the main attributesAttribute; What it says; Default behaviour on Cisco IOS XE. AS_PATH: The AS numbers the route has crossed, most recent first Your AS is added when the route leaves your AS over eBGP. A router rejects an eBGP route whose AS_PATH already contains its own AS, which prevents loops. NEXT_HOP: The address to forward packets to eBGP sets it to the advertiser's address. iBGP leaves it unchanged. ORIGIN: How the route entered BGP i for a network statement, e for the old EGP, ? (incomplete) for redistribution. LOCAL_PREF: How much this AS prefers the route Sent only to iBGP peers. Default 100. Higher wins. MED: A hint to a neighbouring AS about which entry point to use Lower wins. A missing MED counts as 0. Not passed on to other ASes. Weight: Local preference on this one router (Cisco only) 0 for learned routes, 32768 for routes this router originated. Higher wins. Never sent.AttributeWhat it saysDefault behaviour on Cisco IOS XEAS_PATHThe AS numbers the route has crossed,most recent firstYour AS is added when the routeleaves your AS over eBGP. A routerrejects an eBGP route whose AS_PATHalready contains its own AS, whichprevents loops.NEXT_HOPThe address to forward packets toeBGP sets it to the advertiser'saddress. iBGP leaves it unchanged.ORIGINHow the route entered BGPi for a network statement, e for theold EGP, ? (incomplete) forredistribution.LOCAL_PREFHow much this AS prefers the routeSent only to iBGP peers. Default 100.Higher wins.MEDA hint to a neighbouring AS aboutwhich entry point to useLower wins. A missing MED counts as0. Not passed on to other ASes.WeightLocal preference on this one router(Cisco only)0 for learned routes, 32768 forroutes this router originated. Higherwins. Never sent.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: the left box names the item, the others describe it.

Reading the attributes of one prefix

The summary table hides most attributes. Ask for one prefix to see them all. This is R1 in the course network, which learned 203.0.113.0/24 from ISP A over eBGP and from R2 over iBGP.

From the command output to meaning
From the command output to meaningEach field in show ip bgp prefix answers a question.Path64501who originated itNext hop192.0.2.1where to sendmetric, localprefnumbers usedto decideStatusvalid, bestused or not

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read from the top: the path, the next hop, then the numbers that decided the choice.
Illustrative Cisco IOS XE output written for this lesson, not a router capture
R1#show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 4
Paths: (2 available, best #1, table default)
  64501
    192.0.2.1 from 192.0.2.1 (11.11.11.11)
      Origin IGP, metric 0, localpref 100, valid, external, best
  64502
    10.255.0.2 from 10.255.0.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, internal
Each block is one path. The bare number line is its AS_PATH. The next line gives NEXT_HOP, then the neighbour it came from and that neighbour's router ID in brackets. The last line packs ORIGIN, MED (shown as metric), LOCAL_PREF and the flags: valid means the next hop is reachable, external or internal tells you the session type, and best marks the winner.

Here the paths tie on origin, metric and local preference. The AS_PATH lengths are also equal at one AS each, so the next comparison in the best-path order, external over internal, decides. That order is the next lesson.

Where attribute questions go wrong

Expecting LOCAL_PREF to cross an AS border. It is sent only to iBGP peers. If an eBGP neighbour sends one, the receiving router ignores it. To influence another AS you use AS_PATH or MED, and those are covered in the inbound path-control lesson.

Three attribute misunderstandings
Three attribute misunderstandingsThese mistakes come from forgetting how far an attribute travels.Wrong expectationWeightLocal to one router,never advertisedLOCAL_PREFStays inside the AS,never sent to eBGP peersMEDCompared only for pathsfrom the same neighbouringAS by default

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Know which attributes cross AS borders and which stay inside.

Treating MED as a general-purpose steering tool. MED is compared only between paths from the same neighbouring AS by default, and the receiving AS does not pass it onward. It is a hint, not an instruction.

Forgetting that iBGP keeps the next hop. A path can arrive at R2 with a next hop R2 cannot reach and show no valid flag. The attribute is fine; the router simply cannot use the path.

Technical references: RFC 4271 (BGP-4) defines the attributes and their categories. Output above is illustrative, written for this lesson.

Check your attribute knowledge

Predict · scenario 1

R1 sets local preference 200 on routes from ISP A. Which routers hear that value?

Predict · scenario 2

Which attribute is a router most likely to drop when it does not recognise it?

Predict · scenario 3

show ip bgp shows a path without the valid flag and with next hop 192.0.2.1 on R2. Which attribute is the problem?

Predict · scenario 4

You want other networks to prefer ISP A when sending traffic to your prefix. Where do you configure AS_PATH prepending?

Predict · scenario 5

You have one link to ISP A and one to ISP B and set MED 50 and 100 respectively. What is the effect?

Predict · scenario 6

R1 has weight 300 on ISP A routes. R2 has only default weight and LOCAL_PREF 200 set by R1. Which statement is true?

FAQ

Is weight a BGP attribute?
No. Weight is a Cisco-specific value kept on one router. It is never sent in an UPDATE, so it cannot influence any other router. It is still the first thing Cisco IOS XE compares when it chooses a best path.
Why does a router drop an unknown optional non-transitive attribute?
Non-transitive means the attribute applies only to the next hop of the path. A router that does not understand it has no safe way to act on it, so it does not pass it along. An unknown optional transitive attribute is passed on with a flag showing a router did not recognise it.
Does a router change attributes when it passes a route on?
Yes. Leaving an AS, a router adds its AS number to AS_PATH and normally sets NEXT_HOP to itself. Inside an AS, iBGP leaves both unchanged by default, which is why next-hop-self exists.