BGP Part 1: eBGP Neighbors and Route Policy
Black Belt: Advanced Routing
Bring up an eBGP session to an ISP on IOS XE, advertise your own prefix, and control what goes in and out with prefix-lists and route-maps. Along the way: why a prefix has to be in the routing table before BGP will announce it, how to see exactly what you send and receive, and how weight, local preference and AS-path prepending steer traffic.
Practice this in the lab
Every command in this lesson runs in the Practice Lab on two simulated IOS XE routers with two ISPs: BGP 1: eBGP neighbor and route policy. The lab shows what each ISP receives from you as you type.
eBGP and iBGP in One Minute
BGP is the protocol that carries routes between autonomous systems (an AS is one network under one administration, identified by an AS number). It runs over TCP port 179, and a router only talks to the neighbors you configure by hand. There is no discovery.
- eBGP (external BGP): the neighbor is in a different AS. This is how you peer with an ISP, a cloud provider or a partner.
- iBGP (internal BGP): the neighbor is in the same AS. This is how your own routers share what they learned from the outside.
The command is the same for both. The router decides which one a session is by comparing remote-as with its own AS number, and then applies a different set of rules to the routes. This lesson covers eBGP. Part 2 covers iBGP and compares the two side by side.
The Topology
Both lessons use the same small network. You are AS 65001 with two edge routers and two ISPs. Your public prefix is 198.51.100.0/24.
AS 64500 AS 64510
+---------+ +---------+
| ISP-A | | ISP-B |
+----+----+ +----+----+
| .2 | .6
| 203.0.113.0/30 | 203.0.113.4/30
| .1 eBGP | .5
+----+----+ +----+----+
| R1 +-----------------------+ R2 |
| 10.0.0.1| 10.1.12.0/30 (OSPF) | 10.0.0.2|
+---------+ .1 iBGP .2 +---------+
AS 65001
owns 198.51.100.0/24
In this lesson you configure R1 to ISP-A. ISP-A sends you a default route and 192.0.2.0/24.
About the numbers: AS 65001 is from the private range (64512 to 65534) and the addresses are documentation ranges, which is right for a lab. On the real internet you announce with a public AS number, and your ISP will give you the peering addresses.
Before BGP: Can You Reach the Neighbor?
BGP is a TCP session, so the two routers must be able to reach each other's peering address before anything else happens. For eBGP there is one more rule: by default the packets are sent with a TTL of 1, so the neighbor must be directly connected.
R1# configure terminal
R1(config)# interface GigabitEthernet0/0/0
R1(config-if)# description To ISP-A
R1(config-if)# ip address 203.0.113.1 255.255.255.252
R1(config-if)# no shutdown
R1(config-if)# end
R1# ping 203.0.113.2
!!!!!
Success rate is 100 percent (5/5)
If the ping fails, fix that first. BGP cannot help you with a Layer 1, 2 or 3 problem on the link.
Configure the eBGP Neighbor
R1(config)# router bgp 65001
R1(config-router)# bgp router-id 10.0.0.1
R1(config-router)# bgp log-neighbor-changes
R1(config-router)# no bgp default ipv4-unicast
R1(config-router)# neighbor 203.0.113.2 remote-as 64500
R1(config-router)# neighbor 203.0.113.2 description ISP-A
R1(config-router)# address-family ipv4 unicast
R1(config-router-af)# neighbor 203.0.113.2 activate
R1(config-router-af)# end
Line by line:
router bgp 65001: start BGP in your AS. A router runs one BGP process.bgp router-id 10.0.0.1: a unique 32-bit ID. Set it by hand so it never changes when an interface goes down. Two neighbors with the same router ID will not peer.bgp log-neighbor-changes: writes a syslog line whenever a neighbor goes up or down. It is on by default on current releases and worth keeping.no bgp default ipv4-unicast: stops the router from automatically exchanging IPv4 routes with every neighbor you define. You then turn each neighbor on withactivate, which keeps IPv4, IPv6 and VPN sessions cleanly separated.neighbor 203.0.113.2 remote-as 64500: the neighbor's address and its AS. 64500 is different from 65001, so this is eBGP.neighbor ... activate: exchange IPv4 unicast routes with this neighbor.
ISP-A needs the mirror image: neighbor 203.0.113.1 remote-as 65001. If either side has the wrong AS number, the session will never come up.
Session States
A BGP session walks through a small state machine. You will see these names in the show commands:
| State | What is happening |
|---|---|
| Idle | Not trying, or waiting to retry. Also shown when the neighbor is shut down or there is no route to it. |
| Connect | Opening the TCP connection to port 179. |
| Active | The TCP connection failed and the router is trying again. Despite the name this is a bad sign: nothing is working yet. |
| OpenSent / OpenConfirm | TCP is up and the routers are exchanging OPEN messages (AS number, router ID, hold time, capabilities). |
| Established | The session is up and routes can be exchanged. |
A session stuck in Active or Idle usually means no IP reachability, a wrong neighbor address or AS number, an ACL or firewall blocking TCP 179, or a password mismatch.
Verify the Neighbor
The first command to run, every time:
R1# show bgp ipv4 unicast summary
BGP router identifier 10.0.0.1, local AS number 65001
BGP table version is 3, main routing table version 3
2 network entries using 496 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
203.0.113.2 4 64500 14 12 3 0 0 00:08:17 2
How to read it:
- AS is the neighbor's AS number.
- Up/Down is how long the session has been in its current state.
- State/PfxRcd is the column that matters. A number means the session is Established and that many prefixes were received (here 2). A word such as
ActiveorIdlemeans the session is down.Idle (Admin)means someone shut the neighbor down.
This lesson uses the address-family form of the commands (show bgp ipv4 unicast ...), which is how current IOS XE releases are documented. The older show ip bgp ... forms still work and print the same output.
For the full detail of one neighbor:
R1# show bgp ipv4 unicast neighbors 203.0.113.2
BGP neighbor is 203.0.113.2, remote AS 64500, external link
Description: ISP-A
BGP version 4, remote router ID 192.0.2.1
BGP state = Established, up for 00:08:17
Last read 00:00:21, last write 00:00:09, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(new)
Address family IPv4 Unicast: advertised and received
...
External BGP neighbor may be up to 1 hop away.
Look for external link (this is eBGP), BGP state = Established, the timers, and the last line, which is the TTL rule from earlier. If a session keeps resetting, the reason for the last reset is printed further down in this output.
Advertise a Prefix: It Must Be Reachable First
A common surprise for people new to BGP: the session is up, you add a network statement, and the ISP receives nothing.
R1(config)# router bgp 65001
R1(config-router)# address-family ipv4 unicast
R1(config-router-af)# network 198.51.100.0 mask 255.255.255.0
R1(config-router-af)# end
R1# show bgp ipv4 unicast 198.51.100.0/24
% Network not in table
The network command in BGP does not work like it does in OSPF or EIGRP. It does not enable BGP on an interface. It means: "if this exact prefix, with this exact mask, is in my routing table, put it into BGP." BGP will not announce a network the router itself has no route for, because it would be attracting traffic it cannot deliver.
Check the routing table:
R1# show ip route 198.51.100.0 255.255.255.0
% Network not in table
R1 has pieces of the /24 on internal VLANs (for example 198.51.100.0/26), but no route for the whole /24. The match must be exact, so a /26 does not satisfy a network ... mask 255.255.255.0 statement. The usual fix on an edge router is a static route to Null0 for the whole block:
R1(config)# ip route 198.51.100.0 255.255.255.0 Null0
R1# show bgp ipv4 unicast 198.51.100.0/24
BGP routing table entry for 198.51.100.0/24, version 4
Paths: (1 available, best #1, table default)
Advertised to update-groups:
1
Local
0.0.0.0 from 0.0.0.0 (10.0.0.1)
Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best
The Null0 route is always up, so the /24 stays in the routing table and stays advertised. Traffic for real hosts still follows the more specific internal routes (longest match wins), and traffic for unused addresses in the block is dropped instead of looping back to the ISP.
Other ways a prefix gets into BGP:
redistribute(connected, static, OSPF) with a route-map. Always filter it. Redistributed routes show origin?(incomplete).aggregate-address 198.51.100.0 255.255.255.0 summary-only, which creates the summary when at least one more specific route is already in the BGP table.
The same idea applies in the other direction. A route you receive is only usable if its next hop is reachable. With eBGP the next hop is the directly connected neighbor, so it just works. With iBGP it often does not, and that is a main topic of Part 2.
See What You Send and Receive
These are the commands you will use most when working with a BGP neighbor.
What am I advertising to this neighbor?
R1# show bgp ipv4 unicast neighbors 203.0.113.2 advertised-routes
BGP table version is 4, local router ID is 10.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 198.51.100.0/24 0.0.0.0 0 32768 i
Total number of prefixes 1
This is the list after your outbound policy. If a prefix is missing here, it is not valid and best in your BGP table, or your outbound filter is blocking it.
What did I accept from this neighbor?
R1# show bgp ipv4 unicast neighbors 203.0.113.2 routes
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 203.0.113.2 0 0 64500 i
*> 192.0.2.0/24 203.0.113.2 0 0 64500 i
Total number of prefixes 2
This is what the neighbor sent and your inbound policy allowed.
What did the neighbor send before my filters?
R1(config-router-af)# neighbor 203.0.113.2 soft-reconfiguration inbound
R1# show bgp ipv4 unicast neighbors 203.0.113.2 received-routes
received-routes only works once soft-reconfiguration inbound is configured, because the router has to keep an unfiltered copy of everything the neighbor sent. That costs memory with a full internet table, but it is the best way to prove whether a missing route was never sent or was dropped by your own filter.
The whole BGP table, and one prefix in detail
R1# show bgp ipv4 unicast
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 203.0.113.2 0 0 64500 i
*> 192.0.2.0/24 203.0.113.2 0 0 64500 i
*> 198.51.100.0/24 0.0.0.0 0 32768 i
R1# show bgp ipv4 unicast 192.0.2.0/24
BGP routing table entry for 192.0.2.0/24, version 3
Paths: (1 available, best #1, table default)
Not advertised to any peer
64500
203.0.113.2 from 203.0.113.2 (192.0.2.1)
Origin IGP, metric 0, localpref 100, valid, external, best
R1# show ip route bgp
B* 0.0.0.0/0 [20/0] via 203.0.113.2, 00:08:17
B 192.0.2.0/24 [20/0] via 203.0.113.2, 00:08:17
*means the path is valid (the next hop is reachable).>means it is the best path. Only best paths are installed in the routing table and advertised to neighbors.- Path is the AS path, read right to left: the origin AS is on the right, the AS you learned it from is on the left. The letter at the end is the origin code.
- Next Hop 0.0.0.0 and weight 32768 mark a route this router originated itself.
- In the routing table,
[20/0]shows the administrative distance of eBGP, which is 20.
Prefix-Lists
A prefix-list matches routes by network and prefix length. It is the standard tool for saying which prefixes are allowed in or out.
R1(config)# ip prefix-list OUR-NETS seq 5 permit 198.51.100.0/24
R1(config)# ip prefix-list ISP-A-IN seq 5 permit 0.0.0.0/0
R1(config)# ip prefix-list ISP-A-IN seq 10 permit 192.0.2.0/24
Rules are checked in sequence order, the first match wins, and there is an implicit deny at the end. Leave gaps between sequence numbers so you can insert lines later.
Matching a range of lengths with ge and le:
| Entry | Matches |
|---|---|
permit 198.51.100.0/24 | Exactly 198.51.100.0/24 and nothing else |
permit 198.51.100.0/24 le 28 | Anything inside 198.51.100.0/24 with a length from /24 to /28 |
permit 10.0.0.0/8 ge 9 | Anything inside 10.0.0.0/8 that is longer than /8 (the /8 itself does not match) |
permit 0.0.0.0/0 | Only the default route |
permit 0.0.0.0/0 le 32 | Every IPv4 prefix ("permit any") |
permit 0.0.0.0/0 ge 25 | Any prefix longer than /24 (often used with deny to drop small prefixes) |
You can apply a prefix-list straight to a neighbor when all you need is a filter:
R1(config-router-af)# neighbor 203.0.113.2 prefix-list OUR-NETS out
R1(config-router-af)# neighbor 203.0.113.2 prefix-list ISP-A-IN in
R1# show ip prefix-list detail OUR-NETS
ip prefix-list OUR-NETS:
count: 1, range entries: 0, sequences: 5 - 5, refcount: 3
seq 5 permit 198.51.100.0/24 (hit count: 1, refcount: 1)
Always filter outbound to an ISP
With two ISPs and no outbound filter, your router will advertise ISP-A's routes to ISP-B and ISP-B's routes to ISP-A. You become a transit AS: other networks may start sending their traffic through your links. This is called a route leak and it has caused real internet outages. The outbound rule for a customer network is simple: advertise only your own prefixes.
Route-Maps
A prefix-list can only permit or deny. A route-map can match routes and then change their attributes, which is how you set weight, local preference and prepends. In practice the prefix-list does the matching and the route-map does the work.
R1(config)# route-map ISP-A-OUT permit 10
R1(config-route-map)# match ip address prefix-list OUR-NETS
R1(config-route-map)# exit
R1(config)# route-map ISP-A-IN permit 10
R1(config-route-map)# match ip address prefix-list ISP-A-IN
R1(config-route-map)# exit
R1(config)# router bgp 65001
R1(config-router)# address-family ipv4 unicast
R1(config-router-af)# neighbor 203.0.113.2 route-map ISP-A-OUT out
R1(config-router-af)# neighbor 203.0.113.2 route-map ISP-A-IN in
How a route-map is processed:
- Entries run in sequence order (10, 20, 30). The first entry whose
matchlines all match decides the result. permitlets the route through and applies thesetlines.denydrops the route.- An entry with no match line matches everything.
- There is an implicit deny at the end. If you only want to change some routes and keep the rest, finish with an empty
route-map NAME permit 100. - A neighbor can have one route-map per direction. If you configure both a prefix-list and a route-map in the same direction, a route must pass both.
You can also match on the AS path with ip as-path access-list. One line worth knowing is ip as-path access-list 1 permit ^$, which matches an empty AS path, meaning "routes that started in my own AS".
Make Policy Changes Take Effect
BGP does not re-send or re-evaluate routes just because you edited a filter. After changing a prefix-list or route-map, ask for a soft reset. It does not drop the session.
R1# clear bgp ipv4 unicast 203.0.113.2 soft in
R1# clear bgp ipv4 unicast 203.0.113.2 soft out
soft inasks the neighbor to send its routes again (using the route refresh capability) so your new inbound policy is applied.soft outre-sends your routes through your new outbound policy.clear bgp ipv4 unicast 203.0.113.2with nosoftis a hard reset. It tears the session down and drops traffic until it comes back. Avoid it in production.
How BGP Picks the Best Path
When a router has more than one path to the same prefix, it compares them in a fixed order and stops at the first difference. The top of the list on Cisco routers is what the next three sections use:
| # | Attribute | Preferred | Scope |
|---|---|---|---|
| 1 | Weight | Highest | This router only (Cisco-specific) |
| 2 | Local preference | Highest | Your whole AS |
| 3 | Locally originated | Routes this router originated | This router |
| 4 | AS path | Shortest | Seen by every AS |
| 5 | Origin | IGP (i) over EGP (e) over incomplete (?) | Seen by every AS |
| 6 | MED | Lowest | Sent to the neighboring AS |
| 7 | eBGP over iBGP | External path | This router |
| 8 | IGP metric to the next hop | Lowest | This router |
| 9 | Tie-breakers | Oldest eBGP path, then lowest router ID, then lowest neighbor address | This router |
Before any of this, a path must be valid: its next hop has to be reachable. An invalid path is never considered.
A useful way to remember what each knob is for: weight and local preference control traffic leaving your network. AS-path prepending (and MED) try to influence traffic coming in.
Weight
Weight is a Cisco-specific value that exists only on the router where it is set. It is never sent to any neighbor, eBGP or iBGP. Routes learned from neighbors get weight 0, routes the router originates get 32768, and the highest weight wins before anything else is compared.
R1(config)# route-map ISP-A-IN permit 10
R1(config-route-map)# match ip address prefix-list ISP-A-IN
R1(config-route-map)# set weight 200
R1(config-route-map)# end
R1# clear bgp ipv4 unicast 203.0.113.2 soft in
R1# show bgp ipv4 unicast
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 203.0.113.2 0 200 64500 i
*> 192.0.2.0/24 203.0.113.2 0 200 64500 i
To give every route from a neighbor the same weight without a route-map, use neighbor 203.0.113.2 weight 200.
When to use it: one router with two uplinks, where you want that router to prefer one of them. Because nobody else sees it, weight cannot make the rest of your network agree. That is what local preference is for.
Local Preference
Local preference answers "which exit should my AS use for this destination?". The default is 100 and the highest value wins. You normally set it inbound on an eBGP session, as routes arrive from the ISP:
R1(config)# route-map ISP-A-IN permit 10
R1(config-route-map)# no set weight 200
R1(config-route-map)# set local-preference 200
R1(config-route-map)# end
R1# clear bgp ipv4 unicast 203.0.113.2 soft in
R1# show bgp ipv4 unicast
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 203.0.113.2 0 200 0 64500 i
*> 192.0.2.0/24 203.0.113.2 0 200 0 64500 i
Two facts make local preference the main tool for outbound traffic:
- It is carried to iBGP neighbors, so R2 learns that R1's path has local preference 200 and the whole AS exits through ISP-A.
- It is never sent to eBGP neighbors. ISP-A does not see it and it has no effect outside your AS.
The blank LocPrf column on received eBGP routes in the earlier outputs is normal: the attribute was not in the update, and the router treats those routes as 100. To change the default, use bgp default local-preference.
AS-Path Prepending
You cannot set another network's local preference, so to influence traffic coming in you change something they can see: the AS path. Prepending adds extra copies of your own AS number to the routes you advertise, so the path through that link looks longer and other networks prefer a different way in.
Say ISP-A should be a backup for inbound traffic. Prepend on the advertisement to ISP-A:
R1(config)# route-map ISP-A-OUT permit 10
R1(config-route-map)# match ip address prefix-list OUR-NETS
R1(config-route-map)# set as-path prepend 65001 65001 65001
R1(config-route-map)# end
R1# clear bgp ipv4 unicast 203.0.113.2 soft out
Your own table does not change, because the prepend is applied as the update leaves. Check it on the other side. ISP-A now sees:
ISP-A# show bgp ipv4 unicast 198.51.100.0/24
BGP routing table entry for 198.51.100.0/24, version 9
Paths: (1 available, best #1, table default)
65001 65001 65001 65001
203.0.113.1 from 203.0.113.1 (10.0.0.1)
Origin IGP, metric 0, localpref 100, valid, external, best
That is four copies of 65001: your three prepends plus the one eBGP always adds. Through ISP-B the path is just 65001, so most of the internet prefers ISP-B.
Rules for prepending:
- Prepend only your own AS number. Adding someone else's AS makes their routers drop your route (loop prevention) and misrepresents where the route came from.
- Two or three prepends is plenty. If that does not move the traffic, more will not either.
- It is a suggestion, not a guarantee. AS-path length is step 4. An ISP that sets a higher local preference on customer routes (most do) will still send traffic your way, as will anyone matching a more specific prefix.
- You can also prepend inbound on routes you receive to make them less attractive, but for outbound traffic local preference is the cleaner tool.
What eBGP Does to a Route
When a router sends a route to an eBGP neighbor, and when it receives one, these rules apply. Each of them is different for iBGP, which is the heart of Part 2.
- The sender prepends its own AS to the AS path.
- The sender sets the next hop to itself (the address it peers from).
- Loop prevention uses the AS path. A router drops any eBGP update that already contains its own AS number.
- Local preference is not sent. Weight is never sent to anyone.
- MED is sent to the neighboring AS but not passed on beyond it.
- Administrative distance is 20, so an eBGP route beats OSPF (110) for the same prefix.
- TTL is 1, so the neighbor must be directly connected unless you change that.
- Routes learned from an eBGP neighbor are advertised to every other neighbor, both eBGP and iBGP (subject to your filters).
Protect the Session
A few lines that belong on every ISP-facing session:
R1(config)# router bgp 65001
R1(config-router)# neighbor 203.0.113.2 password S3cretKey
R1(config-router)# neighbor 203.0.113.2 ttl-security hops 1
R1(config-router)# address-family ipv4 unicast
R1(config-router-af)# neighbor 203.0.113.2 maximum-prefix 100 80
password: TCP MD5 authentication. Both sides must use the same key, and the ISP has to agree to it.ttl-security hops 1: only accept BGP packets that arrive with a TTL showing they came from one hop away, which blocks spoofed packets from far-off attackers. Both sides should enable it.maximum-prefix 100 80: log a warning at 80 percent and shut the session down at 100 prefixes. This protects you from a neighbor that suddenly sends far more routes than agreed. Size it to what you expect (a full internet table is over a million IPv4 routes).
If you must peer between loopbacks or across another hop, eBGP needs neighbor ... ebgp-multihop 2 and neighbor ... update-source Loopback0, plus a route to the neighbor's loopback. Note that ebgp-multihop and ttl-security cannot both be set on the same neighbor.
The Finished R1 Configuration
ip route 198.51.100.0 255.255.255.0 Null0
!
ip prefix-list OUR-NETS seq 5 permit 198.51.100.0/24
ip prefix-list ISP-A-IN seq 5 permit 0.0.0.0/0
ip prefix-list ISP-A-IN seq 10 permit 192.0.2.0/24
!
route-map ISP-A-IN permit 10
match ip address prefix-list ISP-A-IN
set local-preference 200
!
route-map ISP-A-OUT permit 10
match ip address prefix-list OUR-NETS
!
router bgp 65001
bgp router-id 10.0.0.1
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 203.0.113.2 remote-as 64500
neighbor 203.0.113.2 description ISP-A
neighbor 203.0.113.2 password S3cretKey
neighbor 203.0.113.2 ttl-security hops 1
!
address-family ipv4
network 198.51.100.0 mask 255.255.255.0
neighbor 203.0.113.2 activate
neighbor 203.0.113.2 soft-reconfiguration inbound
neighbor 203.0.113.2 route-map ISP-A-IN in
neighbor 203.0.113.2 route-map ISP-A-OUT out
neighbor 203.0.113.2 maximum-prefix 100 80
exit-address-family
This makes ISP-A the primary exit (local preference 200) with no prepend. Part 2 adds R2 and makes ISP-B the backup in both directions.
Common Mistakes
networkstatement with no matching route: the prefix and mask must be in the routing table exactly as typed. Check withshow ip route 198.51.100.0 255.255.255.0.- Leaving out
mask:network 198.51.100.0alone assumes the old classful mask, which is only right by luck. Always type the mask. - Reading "Active" as good news: Active means the router is still trying to connect.
- Wrong
remote-as: the session flaps between Idle and Active and the log shows a "peer in wrong AS" notification. - Forgetting
activateafterno bgp default ipv4-unicast: no IPv4 routes are exchanged and the neighbor is missing fromshow bgp ipv4 unicast summary. - Editing a filter and not running
clear bgp ipv4 unicast ... soft: the old result stays in place. - A route-map with a
setbut no final permit: every route that does not match is dropped by the implicit deny. - No outbound filter with two ISPs: you leak routes and become transit.
Summary
- eBGP is a BGP session to a different AS. It needs IP reachability to a directly connected neighbor, the correct
remote-ason both sides, andactivateunder the address family. show bgp ipv4 unicast summarytells you if the session is up: a number in the last column is good, a word is not.- BGP only advertises a prefix that is in the routing table with the exact mask. Anchor your block with a static route to Null0.
advertised-routes,routesandreceived-routesshow what you send, what you accepted, and what the neighbor sent before filtering.- Prefix-lists choose prefixes. Route-maps choose and then change attributes. Both end in an implicit deny, and changes need a soft clear.
- Weight (this router) and local preference (your AS) steer outbound traffic. AS-path prepending nudges inbound traffic.
- eBGP adds your AS to the path, sets the next hop to itself, uses distance 20, and never sends local preference.