router A would increase, and the load inbound on
router B would decrease. The problem is that if the inbound
load for router A spikes to more than 100 percent and causes
the link to flap, all the sessions crossing that link could be
lost. If these sessions were purchases being made on AS 65001
web servers, revenue would be lost, which is a result that
administrators want to avoid. If the load averages below 50
percent for the outbound or inbound case, path manipulation
might not be needed; however, when a link starts to reach the
capacity of the link for an extended period of time, more
bandwidth is needed or path manipulation should be considered.
Content 6.6 Manipulating BGP Path
Selection with Route Maps 6.6.3 Changing the
BGP Local Preference for All Routes Local preference is
used only within an autonomous system between IBGP speakers to
determine the best path to leave the autonomous system to reach
an outside network. The local preference is set to 100 by
default; higher values are preferred. The bgp default
local-preference command changes the default local
preference value. Figure displays the command parameter. With
this command, all IBGP routes that are advertised have the
local preference set to the value specified. If an EBGP
neighbor receives a local preference value, the EBGP neighbor
ignores it.
Content 6.6 Manipulating
BGP Path Selection with Route Maps 6.6.4 BGP
Local Preference Example Figure illustrates an example
network running BGP to demonstrate the manipulation of local
preference using route maps in AS 65001. The best path to
network 172.16.0.0 in AS 65003 from router C in AS 65001 is
determined in the following way: - Steps 1 and 2 look
at weight and local preference and use the default settings of
weight equaling 0 and local preference equaling 100 for all
routes that are learned from the IBGP neighbors of A and
B.
- Step 3 does not help decide the best path because
the three AS routes are not owned or originated by AS
65001.
- Step 4 prefers the shortest autonomous system
path. The options are two autonomous systems (65002, 65003)
through router A or three autonomous systems through IBGP
neighbor router B (65005, 65004, 65003). Thus, the shortest
autonomous system path from router C to AS 65003 is through
router A.
The best path from router C to networks in
AS 65005 is also selected by Step 4. The shortest path from
router C to AS 65005 is through router B, because it consists
of one AS (65005) compared to four autonomous systems (65002,
65003, 65004, 65005) through router A. The best path from
router C to networks in AS 65004 is also selected by Step 4.
The shortest path from router C to AS 65004 is through router
B, because it consists of two autonomous systems (65005, 65004)
compared to three autonomous systems (65002, 65003, 65004)
through router A.
Content 6.6
Manipulating BGP Path Selection with Route Maps
6.6.5 BGP Local Preference Example (continued)
Figure demonstrates the BGP forwarding table on router C in AS
65001 with only default settings for BGP path selection. The
diagram shows only the networks of interest to this
example: - 172.16.0.0 in AS 65003
- 172.24.0.0
in AS 65005
- 172.30.0.0 in AS 65004
The
best path is indicated with “>” in the second column of the
output. Each network has two paths that are loop-free,
synchronization-disabled, and that have a valid next-hop
address. All routes have a weight of 0 and a default local
preference of 100; thus Steps 1 and 2 in the BGP path selection
process are equal. This router did not originate any of the
routes (Step 3), so the process moves to Step 4, and BGP
chooses the shortest autonomous system path as follows:
- For network 172.16.0.0, the shortest autonomous system
path of two autonomous systems (65002, 65003) is through the
next hop of 192.168.28.1.
- For network 172.24.0.0, the
shortest autonomous system path of (65005) is through the next
hop of 172.20.50.1.
- For network 172.30.0.0, the
shortest autonomous system path of (65005, 65004) is through
the next hop of 172.20.50.1.
Neither router A nor
router B is using the next-hop-self option in this
example. A traffic analysis reveals the following: -
The link through router B to 172.20.50.1 is heavily used, and
the link through router A to 192.168.28.1 is hardly used at
all.
- The three largest volume destination networks
on the Internet from AS 65001 are 172.30.0.0, 172.24.0.0, and
172.16.0.0.
- Thirty percent of all Internet traffic is
going to network 172.24.0.0 (via router B); 20 percent is going
to network 172.30.0.0 (via router B); and 10 percent is going
to network 172.16.0.0 (via router A). The other 40 percent is
going to other destinations. Only 10 percent of all traffic is
using the link out of router A to 192.168.28.1, and 50 percent
of all traffic is using the link out of router B to
172.20.50.1.
The network administrator has decided
to divert traffic to network 172.30.0.0 and send it out router
A to the next hop of 192.168.28.1, so that the loading between
routers A and B is more balanced.
Content
6.6 Manipulating BGP Path Selection with
Route Maps 6.6.6 BGP Local Preference Example
(continued) Figure demonstrates using a route map on router
A to alter the network 172.30.0.0 BGP update from router X
(192.168.28.1) to have a high local preference value of 400 so
that it is more preferred. The first line of the route map is a
permit statement with a sequence number of 10 for a route map
called “local_pref”; this defines the first route-map
statement. The match condition for that statement is checking
all networks that are permitted by access list 65. Access list
65 permits all networks that start with the first two octets of
172.30.0.0. The route map sets those networks to a local
preference of 400. The second statement of the route map is a
permit statement with a sequence number of 20 for the route map
local_pref, but it does not have any match or set statements.
This statement is a permit–all statement for all route maps.
Because there are no match conditions for the remaining
networks, they are all permitted with their current settings.
In this case, the local preference for network 172.16.0.0 and
172.24.0.0 stays set at the default of 100. The sequence number
of 20 is chosen for the second statement in case other policies
at a later date have to be implemented before this permit-all
statement. This route map is linked to neighbor 192.168.28.1 as
an inbound route map; therefore, as router A receives updates
from 192.168.28.1, it processes them through the local_pref
route map and sets the local preference accordingly as the
networks are placed into the router A BGP forwarding table.
Figure shows the BGP forwarding table on router C in AS 65001
after the BGP session has been reset. It illustrates that
router C has learned about the new local preference value (400)
coming from router A for network 172.30.0.0. The only
difference in this table compared to the previous example,
which did not have local preference manipulation, is that the
best route to network 172.30.0.0 is now through 192.168.28.1
because its local preference of 400 is higher than the local
preference of 100 for the next hop of 172.20.50.1. The
autonomous system path through 172.20.50.1 is still shorter
than the path through 192.168.28.1, but path length is not
evaluated until Step 4, while local preference is examined in
Step 2. The higher local preference path was chosen as the best
path.
Content 6.6 Manipulating BGP Path
Selection with Route Maps 6.6.7 Setting the MED
with Route Maps Recall that the MED is used to decide how
to enter an autonomous system. It is used when multiple paths
exist between two autonomous systems and one autonomous system
is trying to influence the incoming path from the other.
Because the MED is evaluated late in the BGP path selection