0% found this document useful (0 votes)
4 views150 pages

BGP Understanding Part-9

The document outlines advanced BGP configuration techniques, including local preference, MED, and route damping, aimed at optimizing route selection in multi-homed BGP networks. It provides objectives for configuration, monitoring, and troubleshooting of these features on Cisco IOS, along with case studies demonstrating their application. Additionally, it includes troubleshooting tips and review questions to reinforce understanding of BGP concepts.

Uploaded by

Rajesh Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views150 pages

BGP Understanding Part-9

The document outlines advanced BGP configuration techniques, including local preference, MED, and route damping, aimed at optimizing route selection in multi-homed BGP networks. It provides objectives for configuration, monitoring, and troubleshooting of these features on Cisco IOS, along with case studies demonstrating their application. Additionally, it includes troubleshooting tips and review questions to reinforce understanding of BGP concepts.

Uploaded by

Rajesh Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 150

Advanced BGP

Configuration

© 2001, Cisco Systems, Inc.


Objectives
Upon completion of this lesson, you will be able to
perform the following tasks:
• Describe the design issues in multi-homed BGP
networks
• Describe BGP local preference and identify its
applications
• Configure, monitor and troubleshoot BGP local
preference on Cisco IOS
• Describe BGP Multi-Exit-Discriminator (MED) and
identify its applications
• Configure, monitor and troubleshoot MED on Cisco IOS
• Configure, monitor and troubleshoot AS-path
prepending on Cisco IOS

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-2


Objectives
You will also be able to perform the following tasks:
• Describe the benefits and applications of BGP
communities
• Configure, monitor and troubleshoot BGP communities
on Cisco IOS
• Describe the need for BGP peer groups
• Configure, monitor and troubleshoot BGP peer groups
on Cisco IOS
• Describe the need for route damping and the goals of
route damping
• Configure and monitor BGP route flap dampening

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-3


BGP Local
Preference

© 2001, Cisco Systems, Inc. www.cisco.com Advanced BGP Configuration-4


Objectives
Upon completion of this section, you will be able
to perform the following tasks:
• Describe scenarios where BGP weights are not
appropriate for BGP route selection
• Describe the operation of BGP local preference
• Describe the influence of BGP local preference on
BGP route selection
• Configure default BGP local preference on a router
• Change BGP local preference with a route-map
• Monitor BGP local preference

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-5


Case Study #1 - Consistent Route
Selection Between Several Routers
Desired traffic flow
2 Mbps

EBGP AS 462
IBGP
EBGP

64 kbps

Default traffic flow


AS 213 AS 387

Q1: Which routing protocol must be run in AS 213 ?


A1: You must run IBGP in AS 213.
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-6
Case Study #1 - Consistent Route
Selection Within the AS
Desired traffic flow
2 Mbps

100
EBGP AS 462
IBGP

100 EBGP

64 kbps

Default traffic flow


AS 213 AS 387
Q2: How will you influence the route selection on routers
in AS 213 so that they select the fastest route?
A2: By using weights on EBGP and IBGP sessions.
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-7
Case Study #1
Solution with Weights
Desired traffic flow
2 Mbps

100
EBGP AS 462
IBGP
router
EBGP
bgp 213
100 neighbor 1.2.3.4 remote-as 462
64 kbps
neighbor 1.2.3.4 weight 100
neighbor 5.6.7.8 remote-as 213
Default traffic flow
AS 213 AS 387
router bgp 213
neighbor 5.6.7.9 remote-as 213
neighbor 5.6.7.9 weight 100
neighbor 7.8.9.10 remote-as 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-8


Case Study #2 - Consistent
Route Selection Within the AS
Desired traffic flow
2 Mbps

64
kb
ps
AS 462
s Internet
k bp
6
25
512 kbps

Default traffic flow AS 387


AS 213

Have the traffic run over the fastest line available

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-9


Local Preference

• Local preference can be used to ensure AS-wide


route-selection policy
• Any BGP router can set local-preference when
processing incoming route updates, when doing
redistribution, or in outgoing route updates
• Local-preference is used to select routes with
equal weight
• Local-preference is stripped in outgoing EBGP
updates except in EBGP updates with
confederation peers

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-10


Influence of BGP Local
Preference on Route Selection
• Local preference is the second strongest BGP route
selection parameter
Remember the BGP route selection rules:
1. Prefer highest weight (local to router)
2. Prefer highest local-preference (global within AS)
3. Other BGP route-selection rules
• Weights configured on a router override local
preference settings
• To ensure consistent AS-wide route selection:
• Do not change local preference within the AS
• Do not use BGP weights

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-11


Local-Preference Propagation

Per-router Local preference can


Local-preference
default local be modified with a
is removed
preference set route-map

External External
BGP table
BGP peer BGP peer

Intra-confed. Intra-confed.
EBGP peer Local preference can EBGP peer
be modified with a
route-map

Internal My router Internal


BGP peer BGP peer

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-12


Changing Default Local
Preference
router(config-router)#
bgp default local-preference preference
• Changes the default local preference value
• The specified value is applied to all routes that don’t
have local preference set (EBGP routes)
• The default value of this parameter is 100, allowing
you to specify more desirable or less desirable
routers

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-13


Changing Local Preference of
Specific Routes
router(config)#
route-map name permit sequence
match condition
set local-preference value

• Changes BGP local preference only for routes


matched by the route-map entry
router(config-router)#
neighbor address route-map name in | out

• Applies route-map to incoming updates from


specified neighbor or outgoing updates to specified
neighbor
• Per-neighbor local preference is configured by using
a route-map with no match condition
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-14
Case Study #1
Solution with Local Preference
Desired traffic flow
2 Mbps

EBGP AS 462
IBGP RTR-A#
router
EBGP
bgp 213
bgp default local-preference 120
64 kbps

Default traffic flow


AS 213 RTR-B# AS 387
router bgp 213
bgp default local-preference 50

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-15


Case Study #2
Solution with Local Preference
Desired traffic flow
2 Mbps

64
kb
ps
router bgp 213 AS 462
neighbor 1.2.3.4 remote-as s 462
k bp
6
25
neighbor 1.2.3.4 route-map L2M in
512 kbps
neighbor 3.4.5.6 remote-as 387
neighbor 3.4.5.6 route-map L64 in
! Default traffic flow
AS 213 AS 387
route-map L2M permit 10
set local-preference 2000
!
route-map L64 in
set local-preference 64

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-16


Troubleshooting Local Preference

• Non-default local preference is


displayed in show ip bgp printout
• Local preference is displayed in show ip
bgp prefix printout
• Local preference is displayed in BGP
update debugging (only for inbound
updates, starting with IOS 12.0)

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-17


Troubleshooting Local Preference
Test Network

1.0.0.1 1.1.0.1 1.1.0.4 1.1.0.4

Wilma 1.2.0.2 Fred

10.0.0.0 12.0.0.0
AS 462

1.2.0.1
1.0.0.2 1.1.0.3
1.3.0.2 1.3.0.3
Barney Betty

10.0.0.0 14.0.0.0
AS 213 AS 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-18


Troubleshooting Local Preference
Configuration of Router Barney
router bgp 213
1.0.0.1 no synchronization
1.1.0.1 1.1.0.4 1.1.0.4
bgp default local-preference 60
Wilma network 10.0.0.0
1.2.0.2 Fred
neighbor 1.0.0.1 remote-as 213
11.0.0.0 12.0.0.0 462
neighbor 1.2.0.2 remote-as
AS 462
neighbor 1.3.0.3 remote-as 387
neighbor 1.3.0.3 route-map LocPref in
!
1.2.0.1
Route-map LocPref
1.0.0.2 set local-preference 90 1.1.0.3
1.3.0.2 1.3.0.3
Barney Betty

10.0.0.0 14.0.0.0
AS 213 AS 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-19


Monitoring Local Preference

• Non-default local preference is displayed in


show ip bgp printout
Barney#show ip bgp
BGP table version is 5, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path


*> 10.0.0.0 0.0.0.0 0 32768 i
*>i11.0.0.0 1.0.0.1 0 100 0 i
* 12.0.0.0 1.2.0.2 0 0 462 i
* 1.3.0.3 90 0 387 462 i
*>i 1.1.0.4 0 100 0 462 i
LocPref
* 14.0.0.0
coming with
1.2.0.2 0 462 387 i
* internal route 1.3.0.3 0 90 0 387 i
*>i 1.1.0.3 100 0 462 387 i
LocPref set with a route map

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-20


Monitoring Local Preference
(cont.)
• All values for local preference are displayed in
show ip bgp prefix printout
Barney#show ip bgp 12.0.0.0
BGP routing table entry for 12.0.0.0/8, version 4
Paths: (3 available, best #3)
462
1.2.0.2 from 1.2.0.2 (12.1.2.3)
Origin IGP, metric 0, localpref 60, valid, external, ref 2
387 462
1.3.0.3 from 1.3.0.3 (14.1.2.3)
Origin IGP, localpref 90, valid, external, ref 2
462
1.1.0.4 (metric 41024000) from 1.0.0.1 (11.0.0.1)
Origin IGP, metric 0, localpref 100, valid, internal, best, ref 2

Default local preference


is displayed

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-21


Monitoring Local Preference
(IOS 12.0 and later)
• Local preference received in a BGP update is
displayed in debugging outputs
Barney#debug ip bgp 1.0.0.1 updates 12
BGP updates debugging is on for access list 12 for neighbor 1.0.0.1
Barney#clear ip bgp 1.0.0.1
Barney#
03:48:17: BGP: 1.0.0.1 NEXT_HOP part 1 net 12.0.0.0/8, next 1.3.0.3
03:48:17: BGP: 1.0.0.1 send UPDATE 12.0.0.0/8, next 1.3.0.3, metric 0,
path 387 462
03:48:17: BGP: 1.0.0.1 rcv UPDATE w/ attr: nexthop 1.1.0.4, origin i,
localpref 100, metric 0, path 462
03:48:17: BGP: 1.0.0.1 rcv UPDATE about 12.0.0.0/8
03:48:44: BGP: 1.0.0.1 send UPDATE 12.0.0.0/8 -- unreachable

Received local preference


is displayed

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-22


Summary

After completing this section, you should be able to


perform the following tasks:
• Describe scenarios where BGP weights are not
appropriate for BGP route selection
• Describe the operation of BGP local preference
• Describe the influence of BGP local preference on
BGP route selection
• Configure default BGP local preference on a
router
• Change BGP local preference with a route-map
• Monitor BGP local preference
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-23
Review Questions

• What are the differences between Local


Preference and Weight?
• Which of these two parameters has higher
priority?
• When would you use Local Preference instead
of Weight?
• What is the default value of Local Preference
and when is it applied?
• Which commands can you use to change
Local Preference?

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-24


BGP Multi-Exit-
Discriminator (MED)

© 2001, Cisco Systems, Inc. www.cisco.com Advanced BGP Configuration-25


Objectives

Upon completion of this section, you will be able


to perform the following tasks:
• Describe design issues when parallel links are
used between autonomous systems
• Describe how MED can be used to facilitate
proper return path selection
• Describe MED propagation inside AS and
between autonomous systems
• Configure default BGP MED on a router
• Change BGP MED with a route-map
• Monitor BGP MED
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-26
Case Study #3 - Selecting the
Proper Return Path
Desired traffic flow
2 Mbps

EBGP
IBGP IBGP

EBGP

64 kbps

Default traffic flow


AS 213 AS 462

Q: How can you make sure that the return traffic


takes the right path?
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-27
Multi-Exit Discriminator (MED)

• MED can be used to influence path


selection in neighbor autonomous systems
• An autonomous system can specify its
preferred entry point using MED in
outgoing EBGP updates
• MED is not propagated outside of receiving
autonomous system
• MED is a weak metric
• MED is called metric in IOS

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-28


MED Position in BGP
Route Selection Criteria List
• Prefer largest weight
• Prefer largest local-preference
• Prefer routes that the router originated
• Prefer shorter AS paths
• Prefer lowest origin code
• Prefer lowest MED

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-29


Changing Default MED
router(config)#
default-metric med-value
• MED is copied from the IGP cost in the router that
sources the route (through network command or
through route redistribution)
• The MED value can be changed for redistributed
routes with the default-metric command

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-30


Changing MED of Specific
Routes
router(config)#
route-map name permit sequence
match condition
set metric value

• Changes MED for routes matched by the route-map


entry
router(config-router)#
neighbor address route-map name in | out

• Applies a route-map to incoming updates from a


specified neighbor or to outgoing updates to a
specified neighbor
• Per-neighbor MED is configured by using a route-
map with no match condition
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-31
MED Changes in BGP Network
MULTI_EXIT_DISC MULTI_EXIT_DISC
can be modified with removed for routes not
a route-map originated in local AS

External External
BGP peer
BGP table BGP peer

Intra-confed. Intra-confed.
EBGP peer EBGP peer
Main routing
table
Internal Internal
BGP peer MULTI_EXIT_DISC copied BGP peer
from main routing table for MULTI_EXIT_DISC
locally originated
My router networks can be modified with
a route-map

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-32


Advanced MED Configuration
router(config-router)#
bgp always-compare-med

• By default, MED is only considered when selecting routes


from the same autonomous system
• With always-compare-med, MED is also considered for
routes coming from different ASes
router(config-router)#
bgp bestpath missing-med-worst

• If the MED is not attached to a BGP route, it is interpreted


as value 0, and thus as the best metric
• With this command, missing MED is interpreted as infinity
(worst)

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-33


Advanced MED Configuration
(cont.)
router(config-router)#
bgp bestpath med-confed

• By default, MED is only considered when selecting routes


from the same autonomous system which does not
include intraconfederation autonomous systems
• Use this command to allow routers to compare paths
learned from confederation peers
router(config-router)#
bgp deterministic med

• This command changes the BGP route selection


procedure to a deterministic but slower one.

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-34


Case Study #3
Solution with MED
Desired traffic flow
router bgp 213
2 Mbps
neighbor 1.2.3.4 remote-as 462
neighbor 1.2.3.4 route-map MED out
!
route-map
EBGP
MED
IBGP set metric 100 IBGP

EBGP
router bgp 213
neighbor
64 kbps 3.4.5.6 remote-as 462
neighbor 3.4.5.6 route-map MED out
!
route-map MED
setDefault
metrictraffic flow
5000
AS 213 AS 462

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-35


Case Study #4
Global Service Providers
AS 213

London Pa ris Zurich Fra nkfurt

*IX *IX *IX *IX

AS 462

• AS 213 would like to receive traffic for UK customers


over the London exchange point, traffic for German
customers over the Frankfurt exchange point, etc.
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-36
Case Study #4
Solution
AS 213

London Pa ris Zurich Fra nkfurt

router*IX bgp 213 *IX *IX *IX

neighbor 1.2.3.4 remote-as 462


neighbor 1.2.3.4 route-map setMED out
route-map setMED permit 10
AS 462
match ip address 1
set metric 50
route-map setMED permit 20
set metric 100
access-list 1 permit <near-networks>
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-37
Troubleshooting MED

• MED is displayed in show ip bgp [prefix]


printout as the metric field
• MED after route-map processing is
displayed in BGP update debugging
• MED received from a neighbor is
displayed in show ip bgp neighbor
received-routes printouts

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-38


Troubleshooting MED
Test Network

1.0.0.1 1.1.0.1 1.1.0.4 1.1.0.4

Wilma 1.2.0.2 Fred

11.0.0.0 12.0.0.0
AS 462

1.2.0.1
1.0.0.2 1.1.0.3
1.3.0.2 1.3.0.3
Barney Betty

10.0.0.0 14.0.0.0
AS 213 AS 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-39


Troubleshooting MED
Configuration of Router Barney
router bgp 213
1.0.0.1 1.1.0.1 1.1.0.4
no synchronization 1.1.0.4
network 10.0.0.0
Wilma 1.2.0.2 Fred 213
neighbor 1.0.0.1 remote-as
10.0.0.0 neighbor 1.2.0.2 remote-as
12.0.0.0 462
neighbor 1.2.0.2 route-map SetMED out
AS 462
neighbor 1.3.0.3 remote-as 387
!
Route-map
1.2.0.1
SetMED
set metric 500
1.0.0.2 1.1.0.3
1.3.0.2 1.3.0.3
Barney Betty

10.0.0.0 14.0.0.0
AS 213 AS 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-40


Monitoring MED

• MED is displayed in show ip bgp printout

Fred#show ip bgp
BGP table version is 4, local router ID is 12.1.2.3
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path


* 10.0.0.0 1.2.0.1 500 0 213 i
*> 1.1.0.1 0 213 i
* 11.0.0.0 1.2.0.1 500 0 213 i
*> 1.1.0.1 0 0 213 i

MED coming from a


neighbor

No MED in this external route

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-41


Monitoring MED (cont.)

• MED values are also displayed in show ip bgp


prefix printout
Fred#show ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 2
Paths: (2 available, best #2, advertised over EBGP)
213
1.2.0.1 from 1.2.0.1 (10.1.1.1)
Origin IGP, metric 500, localpref 100, valid, external
213
1.1.0.1 from 1.1.0.1 (11.0.0.1)
Origin IGP, localpref 100, valid, external, best

MED is displayed only for those


routes that contain MED attribute

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-42


Debugging MED

• MED sent to a neighbor (after the outgoing


route map) is displayed in debugging outputs
Barney#debug ip bgp upd 10
BGP updates debugging is on for access list 10
Barney#debug ip bgp event
BGP events debugging is on
Barney#clear ip bgp 1.2.0.2 soft out
Barney#
00:46:04: BGP: start outbound soft reconfiguration for 1.2.0.2
00:46:04: BGP: 1.2.0.2 computing updates, neighbor version 0,
table version 5, starting at 0.0.0.0
00:46:04: BGP: 1.2.0.2 send UPDATE 10.0.0.0/8, next 1.2.0.1,
metric 500, path 213
00:46:04: BGP: 1.2.0.2 update run completed, ran for 8ms, neighbor
version 0, start version 5, throttled to 5, check point net 0.0.0.0

MED sent to the neighbor


is displayed
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-43
Debugging MED (cont.)

• MED stored in the BGP table (after the


incoming route map processing) is displayed in
debugging outputs
Fred#debug ip bgp update 10
BGP updates debugging is on for access list 10
Fred#clear ip bgp 1.2.0.1
Fred#
01:03:45: BGP: 1.2.0.1 send UPDATE 10.0.0.0/8, next 1.2.0.2,
metric 0, path 462 213
01:03:45: BGP: 1.2.0.1 rcv UPDATE about 10.0.0.0/8, next hop
1.2.0.1, path 213 metric 500

MED stored in the BGP


table is displayed

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-44


Debugging MED (cont.)

• Original MED received from a neighbor (before


the incoming route map processing) is
displayed in show ip bgp neighbor received
Fred#show ip bgp neighbors 1.1.0.1 received-routes
BGP table version is 19, local router ID is 12.1.2.3
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path


* 10.0.0.0 1.1.0.1 0 213 i
* 11.0.0.0 1.1.0.1 0 0 213 i

Total number of prefixes 2

MED originally received


from the neighbor
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-45
Debugging MED (cont.)

• Both original route and route modified are


displayed with a route map when inbound soft
reconfiguration is configured
Fred#show ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 17
Paths: (4 available, best #4, advertised over EBGP)
213
Modified route (MED set to 1000)
1.1.0.1 from 1.1.0.1 (11.0.0.1)
Origin IGP, metric 1000, localpref 100, valid, external
213, (received-only)
1.1.0.1 from 1.1.0.1 (11.0.0.1)
Origin IGP, localpref 100, valid, external
387 213
1.1.0.3 from 1.1.0.3 (14.1.2.3) Original route (no MED)
Origin IGP, localpref 100, valid, external
213
1.2.0.1 from 1.2.0.1 (10.1.1.1)
Origin IGP, metric 500, localpref 100, valid, external, best
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-46
Summary

After completing this section, you should be able to


perform the following tasks:
• Describe design issues when parallel links are
used between autonomous systems
• Describe how MED can be used to facilitate proper
return path selection
• Describe MED propagation inside AS and between
autonomous systems
• Configure default BGP MED on a router
• Change BGP MED with a route-map
• Monitor BGP MED
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-47
Review Questions

• When is MED usually used?


• What other parameters and attributes are
compared before MED?
• What conditions have to be met for MED to be
used for best-path selection?
• What is the default value of MED?
• What is the default value of MED when
redistributing from another routing protocol?
• Which commands can be used to set the MED
attribute?
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-48
AS-Path Prepending

© 2001, Cisco Systems, Inc. www.cisco.com Advanced BGP Configuration-49


Objectives
Upon completion of this section, you will be able to
perform the following tasks:
• Describe the issues of return path selection for multi-homed
customers
• Describe how AS-path prepending can be used to facilitate
proper return path selection
• Configure AS-path prepending in a multi-homed BGP-based
network
• Monitor AS-path prepending
• Deploy AS-path filters that allow neighboring autonomous
systems to use AS-path prepending

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-50


Case Study #5—Return Path in
Multihomed AS
Desired traffic flow
2 Mbps

AS 462

64 kbps
AS 213
10.0.0.0/8

AS 387

Requirement: the customer’s return traffic must


arrive over the highest-speed access link

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-51


Default Return Path

Desired traffic flow


2 Mbps

AS-Path=462 123
Network=10.0.0.0/8
Network=10.0.0.0/8
AS-Path=123

AS 462

64 kbps
Network=10.0.0.0/8
AS 213
10.0.0.0/8 AS-Path=123

Default traffic flow AS 387


Path with shorter AS-path
length is preferred

Result: the return traffic flows over the path with


the shortest AS-path length
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-52
Proper Return Path Selection
Desired traffic flow
2 Mbps

AS 462

64 kbps
AS 213
10.0.0.0/8
Default traffic flow
AS 387

Q: How do you select the proper return path from AS 387?


A: Use local preference in AS 387.
Q: Will the administrator of AS 387 do it?
A: Unlikely.

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-53


BGP Route Selection Rules
BGP route selection uses the following criteria
• Prefer largest weight
• Prefer largest local-preference
• Prefer routes that the router originated
• Prefer shorter AS paths
• Other route-selection rules
Manipulating the outgoing AS-path length
could result in proper return path selection

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-54


AS-Path Prepending
• Manual manipulation of AS-path length is
called AS-path prepending
• AS-Path should be extended with multiple
copies of the sender’s AS-number
• AS-Path prepending is used to
• Ensure proper return path selection
• Distribute the return traffic load for multi-homed
customers

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-55


AS-Path Prepending

Resulting traffic flow


2 Mbps

AS-Path=462 123
Network=10.0.0.0/8
Network=10.0.0.0/8
AS-Path=123

AS 462

64 kbps
Network=10.0.0.0/8
AS 213
10.0.0.0/8 AS-Path=123 123 123

AS 387
AS-path is extended with The path with the shortest
the sender’s AS number AS-path length is selected

Result: the return traffic flows over the desired


return path
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-56
Illegal AS-Path Prepending

2 Mbps
Network=10.0.0.0/8
AS-Path=123

AS 462

64 kbps
AS 213 Network=10.0.0.0/8
10.0.0.0/8 AS-Path=123 387

AS 387

AS-path is extended with The update is rejected


the receiver’s AS number due to loop prevention

The AS-path should be prepended with the sender’s


AS-number, not the receiver’s AS-number
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-57
Configuring AS-Path
Prepending
router(config)#
route-map name permit sequence
match condition
set as-path prepend as-number [ as-number … ]

• Prepends the specified AS-number sequence to the


routes matched by the route-map entry
• AS-numbers are prepended to the AS-path from the
BGP table, the sender’s AS-number is always
prepended to the end result
router(config-router)#
neighbor address route-map name out

• Applies the route-map to outgoing updates sent to


the specified BGP neighbor
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-58
AS-Path Prepending
Primary/Backup Link
Resulting traffic flow
2 Mbps

AS-Path=462 123
Network=10.0.0.0/8
Network=10.0.0.0/8
AS-Path=123

How many AS-numbers AS 462


should be prepended?

64 kbps
Network=10.0.0.0/8
AS 213
10.0.0.0/8 AS-Path=123 123 123

AS 387
• The backup AS-path should be very long to ensure that the
primary AS-path will always be shorter
Caveat: Long backup AS-path consumes memory on every
Internet router
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-59
Primary/Backup Link
Prepending Rules
• Use a long prepended AS-path over the
backup link
• Experiment with various AS-path
lengths until the backup link is idle
• Add a few more AS-numbers for
additional security (unexpected
changes in the Internet)

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-60


Case Study Solution with
AS-Path Prepending
route-map prepend permit 10
set as-path prepend 213 213 213 213 213
!
router bgp 213
neighbor 1.0.0.2 remote-as 387
neighbor 1.0.0.2 route-map prepend out
2 Mbps

AS 462

64 kbps
AS 213
10.0.0.0/8 1.0.0.2
AS 387
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-61
Case Study #6—Return Traffic
Load Distribution
Network=10.0.0.0/8 Network=10.0.0.0/8

AS-Path=521 462 123


Network=10.0.0.0/8
AS-Path=123 AS-Path=462 123

AS 462 AS 521

Network=10.0.0.0/8 Network=10.0.0.0/8
AS-Path=123 AS-Path=387 123
AS 213
AS 387 Default traffic flow AS 672

• Return traffic from most autonomous systems will take the


return path with the shortest AS-path length
• Return traffic load distribution depends primarily on the
connectivity between autonomous systems in the Internet
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-62
Return Traffic Distribution
with AS-Path Prepending
Resulting traffic flow
2 Mbps
Network=10.0.0.0/8 Network=10.0.0.0/8

AS-Path=521 462 123


Network=10.0.0.0/8
AS-Path=123 AS-Path=462 123

AS 462 AS 521

64 kbps
Network=10.0.0.0/8 Network=10.0.0.0/8
AS-Path=123 123 123 AS-Path=387 123 123 123

AS 387 AS 672

• AS-path prepending can be used to influence return


traffic load distribution
• The control of the return traffic path is never exact

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-63


Return Traffic Distribution
with AS-Path Prepending
• There is no exact mechanism to calculate
the required prepended AS-path length
• Start with short prepended AS-path,
monitor link utilization and extend the
prepended path length as needed
• Continuously monitor the link utilization
and change the prepended AS-path length
if required

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-64


Monitoring and Troubleshooting
AS-Path Prepending
AS-path prepending cannot be monitored
or debugged on the sending router
• debug ip bgp updates displays the BGP entry
prior to route-map processing
• show route-map does not display how many
routes have matched a route-map entry
Results of AS-path prepending can be
observed on the receiving router

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-65


Monitoring AS-Path
Prepending on the Receiver
router#
show ip bgp regexp regular-expression
• Displays all BGP routes with AS-paths matching a
regular expression
AS387#show ip bgp regexp ^213_213_
BGP table version is 2, local router ID is 1.0.0.2
Status codes: s suppressed, d damped, h history, *
valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path


*> 10.0.0.0 1.0.0.1 0 0 213 213 213 i

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-66


Incoming AS-Path Filters
Considerations
ip as-path access-list 10 permit ^[0-9]+$
!
2 Mbps
router bgp 387
neighbor 1.0.0.1 remote-as 213
neighbor 1.0.0.1 filter-list 10 in AS 462

AS 213 Network=10.0.0.0/8
64 kbps
10.0.0.0/8 AS-Path=123 123
1.0.0.1
AS 387
These AS-path filters do not work if the
customers are using AS-path prepending
Service Providers usually use AS-path filters to control
incoming BGP updates from their customers
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-67
AS-Path Filters With AS-Path
Prepending
• Service Provider’s incoming AS-path
filters need to be modified to support
AS-path prepending
• Service Provider can no longer use
unified AS-path filter for all customers,
a dedicated filter is required for each
customer

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-68


AS-Path Filter Supporting
AS-Path Prepending
ip as-path access-list 10 permit ^213(_213)*$
!
2 Mbps
router bgp 387
neighbor 1.0.0.1 remote-as 213
neighbor 1.0.0.1 filter-list 10 in AS 462

AS 213 Network=10.0.0.0/8
64 kbps
10.0.0.0/8 AS-Path=123 123
1.0.0.1
AS 387
The modified AS-path filter
accepts all paths that contain
only the customer’s AS number

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-69


Summary
After completing this section, you should be able to
perform the following tasks:
• Describe the issues of return path selection for multi-homed
customers
• Describe how AS-path prepending can be used to facilitate
proper return path selection
• Configure AS-path prepending in a multi-homed BGP-based
network
• Monitor AS-path prepending
• Deploy AS-path filters that allow neighboring autonomous
systems to use AS-path prepending

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-70


Review Questions
• Why would a multi-homed customer like to modify the
traffic load distribution between its connections?
• Why does not BGP always use the highest bandwidth link
available?
• Why is it not enough to direct the outgoing traffic over the
appropriate connection?
• How can AS-path manipulation influence the route-
selection?
• Which tool is used when configuring AS-path prepending?
• In what way may a Service Provider’s AS have to change
its configurations when customers start manipulating their
outgoing AS-paths?

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-71


BGP Communities

© 2001, Cisco Systems, Inc. www.cisco.com Advanced BGP Configuration-72


Objectives
Upon completion of this section, you will be able to
perform the following tasks:
• Describe the issues of return path selection for multi-homed
customers
• Describe how BGP communities can be used to facilitate
proper return path selection
• Design and deploy BGP communities in a BGP-based
network
• Configure BGP community propagation
• Configure display format for BGP communities
• Set BGP communities with a route-map
• Match routes based on BGP communities attached to them
• Monitor BGP communities
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-73
Case Study #5 - Revisited
Desired traffic flow
2 Mbps

AS 462

64 kbps
AS 213
10.0.0.0/8
Default traffic flow
AS 387

Q: How do you select the proper return path from AS 387 without using AS-path prepending in AS 213?
A: Use local preference in AS 387.
Q: Will the administrator of AS 387 do it?
A: Unlikely.

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-74


BGP Communities
• BGP communities is a means of tagging
routes to ensure consistent filtering or route-
selection policy
• Any BGP router can tag routes in incoming
and outgoing routing updates or when doing
redistribution
• Any BGP router can filter routes in incoming
or outgoing updates or select preferred routes
based on communities
• By default, communities are stripped in
outgoing BGP updates

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-75


What is a Community ?
• The community attribute is a transitive, optional
attribute. It’s value is a 32-bit number (range 0 to
4,294,967,200)
• Each network in a BGP routing table can be
tagged with a set of communities
• The standards define several filtering-oriented
communities
no-export do not advertise routes to real EBGP peers
no-advertise do not advertise routes to any peer
local-as do not advertise routes to any EBGP peers
• Routers that don’t support communities pass
them along unchanged
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-76
Defining your own
Communities
• A 32-bit community value is split into two
parts:
• High-order 16 bits contain the AS-number of the
AS that defines community meaning
• Low-order 16 bits have local significance
• Values of all-zeroes and all-ones in high-order
16 bits are reserved
• IOS parser allows you to specify a 32-bit
community value as
AS-number:low-order-16-bits
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-77
Using Communities

• Define your goals


• Design your filters and path-selection policy to
achieve your goals
• Define communities that signal individual goals
• Configure route tagging on entry points or let
your neighbors tag the routes
• Configure community distribution
• Configure route filters and path-selection
parameters based on communities

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-78


Using BGP Communities
Case Study
• Define your goals
• Solve asymmetrical customer routing problems
• Design your filters and path-selection policy to
achieve your goals
• Set local-preference of customer routes to 50 for
customers using us as a backup ISP
• Define communities that signal individual goals
• Community 387:17 is used to indicate that the
local-preference of the route should be lowered to
50
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-79
Configuring BGP
Communities on Cisco IOS
BGP communities are configured in the following
steps:
• Configure route tagging with BGP communities
• Configure BGP community propagation
• Define BGP community access-lists (community-
lists) to match BGP communities
• Configure route-maps that match on community-
lists and filter routes or set other BGP attributes
• Apply route-maps to incoming or outgoing
updates

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-80


Community Setting Through
Route-Map
router(config)#
route-map name
match condition
set community value [ value … ] [additive]

• Route tagging with communities is always done with


a route-map
• Any number of communities can be specified
• Communities specified in the set keyword overwrites
existing communities unless you specify the additive
option

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-81


Attaching Communities to a
Route
router(config-router)#
neighbor ip-address route-map map in | out

• Applies a route-map to inbound or outbound BGP


updates
• The route-map can set BGP communities or other
BGP attributes
router(config-router)#
redistribute protocol route-map map

• Applies a route-map to redistributed routes

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-82


Case Study #5: Client Router
Configuration Example #1
router bgp 213
redistribute
Desired traffic flow ospf 1 route-map setcomm
!
2 Mbps
route-map setcomm permit 10
match ip address 21
set community 387:17 AS 462
!
route-map setcomm permit 9999
!
access-list
64 kbps 21 permit some-networks

AS 213 Default traffic flow AS 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-83


Case Study #5: Client Router
Configuration Example #2

Desired traffic flow


router bgp 213
2 Mbps
neighbor 1.2.3.4 remote-as 387
neighbor 1.2.3.4 route-map setcomm out
! AS 462
route-map setcomm permit 10
set community 387:17

64 kbps

AS 213 Default traffic flow AS 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-84


Configure Community
Propagation
router(config-router)#
neighbor ip-address send-community
• By default, communities are stripped in outgoing
BGP updates
• Community propagation to BGP neighbors has to be
manually configured
• BGP peer groups are ideal for configuring BGP
community propagation toward a large number of
neighbors

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-85


Case Study #5: Client Router
Configuration Example

Desired traffic flow


router bgp 213
2 Mbps 1.2.3.4 remote-as 387
neighbor
neighbor 1.2.3.4 route-map setcomm out
neighbor 1.2.3.4 send-community
AS 462
!
route-map setcomm permit 10
set community 387:17
64 kbps

AS 213 Default traffic flow AS 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-86


Defining Community Lists
Simple Community Lists
router(config)#
ip community-list 1-99 permit|deny value [ value … ]
• Defines a simple community list
• Community lists are similar to access lists - they are
evaluated sequentially, line by line
• All values listed in one line have to match for the line
to match and permit or deny a route
• Keyword internet can be used to match any
community

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-87


Defining Community Lists
Extended Community Lists
router(config)#
ip community-list 100-199 permit|deny regexp
• Defines an extended community list
• Extended community lists are like simple community
lists, but they match based on regular expressions
• Communities attached to a route are ordered,
converted to string and matched with regexp
• Use .* to match any community value

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-88


Case Study #5: Backup ISP
Router Configuration Example

Desired traffic flow


2 Mbps

! Match the community that signals


! reduced local preference AS 462
!
ip community-list 7 permit 387:17

64 kbps

AS 213 Default traffic flow AS 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-89


Matching Communities in
Route-Maps
router(config)#

route-map name permit | deny


match community clist-number [exact]
set attributes
• Community lists are used in match conditions in route-
maps to match on communities attached to BGP routes
• A route-map with community list matches a route if at
least some communities attached to the route match the
community list
• With the exact option, all communities attached to the
route have to match the community-list
• Route-maps can be used to filter routes or set other BGP
attributes based on communities attached to routes

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-90


Using Communities in Route
Selection
• Route-maps can be used to set weights,
local-preference or metric based on
BGP communities attached to the BGP
route
• Normal route-selection rules apply
afterwards
• Route-maps contain implicit filters
(routes not accepted by route-map are
dropped)
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-91
Case Study #5: Service Provider
Router Configuration Example
router bgp 387
neighbor Customers peer-group
neighbor Customers route-map setlocpref in
Desired
! traffic flow
route-map
2 Mbpssetlocpref permit 10
match community 7
set local-preference 50
! AS 462
route-map setlocpref permit 9999
!
ip community-list 7 permit 387:17
64 kbps

AS 213 Default traffic flow AS 387

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-92


Community-Based Route
Filters Example
• Do not pass routes with community 123:5 to
EBGP peers

router bgp 123


neighbor EBGP_peers peer-group
neighbor EBGP_peers route-map outfilter out
!
route-map outfilter
match community 1
!
ip community-list 1 deny 123:5
ip community-list 1 permit internet

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-93


Default Filters

• Routes tagged with community no-


export are sent to IBGP peers and intra-
confederation EBGP peers
• Routes tagged with local-as are sent to
IBGP peers
• Routes tagged with no-advertise are not
sent in any outgoing BGP updates

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-94


Changing the Community Printout
Format
router(config)#

ip bgp-community new-format
• Default format for communities in configuration
files is decimal value of the community
• IOS can also display communities in as:nn format
• Configuration files with communities in as:nn
format are not compatible with older versions of
IOS

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-95


Monitoring and
Troubleshooting Communities
• Communities are displayed in show ip
bgp prefix printout
• Communities are not displayed in
debugging outputs
• Routes in BGP table tagged with a set of
communities or routes matching a
community list can be displayed

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-96


Monitoring Communities

• Communities are displayed only in show ip


bgp prefix printout
Betty#show ip bgp 10.0.0.0
Communities attached
to the17route in BGP table
BGP routing table entry for 10.0.0.0/8, version
Paths: (3 available, best #3, advertised over EBGP)
213
1.3.0.2 from 1.3.0.2 (10.1.1.1)
Origin IGP, metric 0, localpref 50, valid, external
Community: 387:17
Communities received
213, (received-only)
1.3.0.2 from 1.3.0.2 (10.1.1.1) from the neighbor
Origin IGP, metric 0, localpref 100, valid, external
Community: 387:17
462 213
1.1.0.4 from 1.1.0.4 (12.1.2.3)
Origin IGP, localpref 100, valid, external, best

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-97


Monitoring Communities
(cont.)
router>

show ip bgp community


• Displays all routes in a BGP table that have at least
one community attached

router>

show ip bgp community as:nn [as:nn ...]


• Displays all routes in a BGP table that have all the
specified communities attached

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-98


Monitoring Communities
(cont.)
router>

show ip bgp community as:nn [as:nn …] exact


• Displays all routes in BGP table that have exactly
the specified communities attached

router>

show ip bgp community-list clist


• Displays all routes in BGP table that match
community list clist

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-99


Monitoring Community Lists
router>

show ip community-list [clist]


• Displays all or a specified part of the community list

Barney#show ip community-list
Community standard list 1
deny 213:12
permit internet
Community extended access list 101
deny 213:(11|12)
permit .*
Barney#

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-100


Summary
After completing this section, you should be able to
perform the following tasks:
• Describe the issues of return path selection for multi-homed
customers
• Describe how BGP communities can be used to facilitate
proper return path selection
• Design and deploy BGP communities in a BGP-based network
• Configure BGP community propagation
• Configure display format for BGP communities
• Set BGP communities with a route-map
• Match routes based on BGP communities attached to them
• Monitor BGP communities

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-101


Review Questions

• What is the purpose of the Community attribute?


• Does the Community attribute have any influence
on path selection?
• Name the most used predefined community value
and explain how it affects route propagation.
• What commands can you use to set the
Community attribute?
• What else do you have to do to start propagating
Communities?
• What two types of Community filters are
supported?
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-102
BGP Peer Groups

© 2001, Cisco Systems, Inc. www.cisco.com Advanced BGP Configuration-103


Objectives
Upon completion of this section, you will be able
to perform the following tasks:
• Describe the need for BGP peer groups
• Describe the implementation of BGP peer groups
on Cisco IOS
• Describe the performance benefits of using BGP
peer groups
• Describe the limitations of BGP peer groups
• Configure, monitor and troubleshoot BGP peer
groups

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-104


Peer Group Requirements
BGP routers could have a large number of
neighbors with similar requirements
• Provider Edge router with many customer
connections
• BGP route reflector with many IBGP peers
• Provider Edge router at an exchange point
Most of the parameters specified for the
BGP neighbors are identical, with a few
exceptions

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-105


Scenario #1
Customer Connections
Customer AS

Provider Edge Router


Customer AS

Service Provider
Autonomous System
Customer AS
Common Parameters:
• Incoming and outgoing route-maps
• Incoming and outgoing filter lists
• Maximum number of accepted prefixes
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-106
Scenario #2
BGP Route Reflector

Route Reflector

Service Provider
Autonomous System
Common Parameters:
• Autonomous System
• Propagation of communities
• Source interface
• MD5 password
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-107
Scenario #3
Edge Router at a Peering Point
Peering AS

Edge router at
Peering AS a peering point

Service Provider
Autonomous System
Peering AS Common Parameters:
• Incoming and outgoing route maps
• Incoming and outgoing filter lists
• Maximum number of accepted prefixes
• Removal of private AS numbers
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-108
BGP Peer Groups in Cisco IOS
• BGP peer group creates a neighbor parameter
template
• Configurable parameters include:
• community propagation
• source interface for TCP session
• EBGP multihop sessions
• MD5 password
• neighbor weight
• filter-lists and distribute-lists
• route maps
• Individual parameters specified in a peer-group can
be overridden on a neighbor-by-neighbor basis

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-109


Configuring Peer Groups

Configure BGP peer groups with the


following steps:
• Create a BGP peer group
• Specify parameters for the BGP peer
group
• Create a BGP neighbor
• Assign a neighbor into a peer group

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-110


Create a BGP Peer Gorup
router(config-router)#
neighbor group-name peer-group

• Creates a BGP peer group


• Peer group names are case sensitive

router(config-router)#
neighbor group-name any-BGP-parameter

• Specifies any BGP parameter for the peer group

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-111


Assign a BGP Neighbor into a
Peer Group
router(config-router)#
neighbor ip-address peer-group group-name

• Assigns a BGP neighbor into a peer group


• The neighbor inherits all the BGP parameters
specified for the peer group
router(config-router)#
neighbor ip-address any-BGP-parameter

• Overrides a BGP parameter specified for the peer


group with a neighbor-specific parameter

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-112


BGP Peer Group Example
Customer Connections
AS 213 AS 123

routerProvider
bgp 123 Edge Router
AS 314 neighbor Customers peer_group
neighbor Customers route-map Cust_In in
neighbor Customers route-map Cust_Out out
neighbor Customers filter-list 10 in
neighbor Customers maximum-prefix 50
AS 337 !
neighbor 1.2.3.4 remote-as 213
neighbor 1.2.3.4 peer-group Customers
neighbor 2.3.4.5 remote-as 314
Override a peer neighbor 2.3.4.5 peer-group Customers
group parameter for neighbor 2.3.4.5 filter-list 21 in
a single neighbor
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-113
BGP Peer Group Example
BGP Route Reflector
Neighbor AS-number
defined in the peer-group

Route Reflector
router bgp 123
neighbor IBGP_peers peer_group
neighbor IBGP_peers remote-as 123
AS 123
neighbor IBGP_peers update-source loopback 0
neighbor IBGP_peers password c73Dx8K
neighbor IBGP_peers send-community
!
neighbor 10.0.1.3 peer-group IBGP_peers
neighbor 10.0.1.4 peer-group IBGP_peers
neighbor 10.0.1.6 peer-group IBGP_peers
neighbor 10.0.1.8 peer-group IBGP_peers

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-114


BGP Peer Group Example
Edge Router at a Peering Point
AS 745 AS 123

router bgpEdge
123router at
AS 837 neighbor Peering peer_group
a peering point
neighbor Peering filter-list 10 in
neighbor Peering route-map PeerMap out
neighbor Peering maximum-prefix 50
neighbor Peering remove-private-AS
AS 921 !
neighbor 1.2.3.4 remote-as 745
neighbor 1.2.3.4 peer-group Peering
neighbor 2.3.4.5 remote-as 837
Remove a peer neighbor 2.3.4.5 peer-group Peering
group parameter for no neighbor 2.3.4.5 maximum-prefix 50
a single neighbor no neighbor 2.3.4.5 filter-list 10 in
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-115
Peer Groups as BGP
Performance Tool
IOS builds individual BGP updates for each
BGP neighbor
• The CPU load imposed by the BGP process is
proportional to the number of BGP neighbors
A single BGP update is built for all members of
a BGP peer group
• The CPU load does not increase linearly with the
increased number of neighbors
• Hint: Use peer groups wherever possible to reduce
the CPU load of the BGP process

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-116


BGP Peer Groups Restrictions
Peer groups have a number of limitations due to the
way they are used to build BGP updates:
• Per-neighbor BGP parameters that affect outbound updates
cannot be changed for peer-group members
• IBGP and EBGP neighbors cannot be mixed in a peer group
Restrictions removed in IOS releases 11.1(18)CC and
12.0
• All EBGP peer-group members must be reachable over the
same interface
• Route reflector clients cannot be members of a peer group

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-117


Monitoring BGP Peer Groups
Router#
show ip bgp peer-group [group-name]

• Displays the definition of the specified peer group


or all peer groups
Router#
show ip bgp peer-group group-name summary

• Displays summary status of all neighbors in the


peer group
Router#
clear ip bgp peer-group group-name [[soft] in|out]

• Clears BGP session with all peer-group members

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-118


Monitoring Peer Group
Definition
Neighbor that is used to compute
BGP updates for the whole group
wg6r1>show ip bgp peer-group
BGP neighbor is wg_peers, peer-group leader
192.168.20.1, external
Description: Workgroup neighbors reachable over
provider LAN
Peer-group contains EBGP peers
Index 2, Offset 0, Mask 0x4
BGP version 4
Minimum time between advertisement runs is 5 seconds
Incoming update network filter list is 6
Outgoing update network filter list is 6
Incoming update AS path weight filter list 25,
weight 200
Incoming update AS path filter list is 27

Peer-group parameters

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-119


Monitoring Peer Group
Neighbors
wg6r1#show ip bgp peer wg_peers summary
BGP table version is 56, main routing table version 56
51 network entries (51/153 paths) using 10568 bytes of memory
18 BGP path attribute entries using 2296 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State


192.168.20.1 4 1 0 0 0 0 0 never Active
192.168.20.2 4 2 0 0 0 0 0 never Active
192.168.20.3 4 3 0 0 0 0 0 never Active
192.168.20.5 4 5 53 81 56 0 0 00:00:52
192.168.20.20 4 20 62 59 56 0 0 00:00:44
192.168.20.22 4 22 54 54 56 0 0 00:00:44

The printout is identical to a “show ip bgp summary” printout, but


displays only neighbors that are members of the specified peer-group.

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-120


Monitoring Individual BGP
Neighbor
wg6r1#show ip bgp neighbor 192.168.20.5
BGP neighbor is 192.168.20.5, remote AS 5, external link
Index 2, Offset 0, Mask 0x4
wg_peers peer-group member
BGP version 4, remote router ID 197.5.8.1
BGP state = Established, table version = 54, up for
00:00:14
Last read 00:00:00, hold time is 180, keepalive interval is
60 seconds
Minimum time between advertisement runs is 5 seconds
Received 50 messages, 0 notifications, 0 in queue
Sent 80 messages, 0 notifications, 0 in queue
Inbound path policy configured
Incoming update network filter list is 6
Outgoing update network filter list is 6
Incoming update AS path filter list is 27
Connections established 3; dropped 2

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-121


Summary
After completing this section, you should be able
to perform the following tasks:
• Describe the need for BGP peer groups
• Describe the implementation of BGP peer groups on
Cisco IOS
• Describe the performance benefits of using BGP
peer groups
• Describe the limitations of BGP peer groups
• Configure, monitor and troubleshoot BGP peer
groups

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-122


Review Questions
• What is the purpose of using BGP peer-groups?
• Why are the BGP peer groups also a scalability
tool?
• List the limitations on the peer-group members.
• What are the rules for changing per-neighbor
parameters for members of a BGP peer group?
• Which BGP peer-group limitations were
removed in IOS 12.0?

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-123


BGP Route Flap
Dampening

© 2001, Cisco Systems, Inc. www.cisco.com Advanced BGP Configuration-124


Objectives

Upon completion of this section, you will be able


to perform the following tasks:
• Describe the need for BGP Route Flap Dampening
• Describe the BGP Route Flap Dampening goals
• Describe the implementation of BGP Route Flap
Dampening on Cisco IOS
• Configure, monitor, and troubleshoot BGP Route
Flap Dampening
• Release dampened routes

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-125


BGP Route Flap Dampening
(RFC 2439)
• Goal: minimize the number of BGP updates
• Tools:
• Batching of BGP updates
• Per-neighbor update timers
• Suppressing of unstable routes (route flap
dampening)

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-126


Route Flap Dampening Goals

• Minimize the amount of BGP update


processing in the Internet
• Do not suppress routes that occasionally
flap
• Suppress routes that are likely to flap in the
future based on the history of their
behavior
Flap = removal of route
Suppress = do not use a route after it
reappears
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-127
Route Flap Dampening
Implementation
• Every time an EBGP route flaps it gets 1000
penalty points (IBGP routes are not
dampened)
• The penalty placed on a route is decayed
using the exponential decay algorithm
• When the penalty exceeds “suppress limit”,
the route is dampened (no longer used or
propagated to other neighbors)
• A dampened route is propagated when the
penalty drops below “reuse limit”

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-128


Route Flap Dampening
Implementation (cont.)
• Flap history is forgotten when the penalty
drops below half of “reuse limit”
• The route is never dampened for more than
“max-suppress” time
• An unreachable route with flap history is put
in “history state” - it stays in the BGP table
but only to maintain the flap history
• A penalty is applied on the individual path in
the BGP table, not on the IP prefix

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-129


Configuring BGP Route Flap
Dampening
router(config-router)#
bgp dampening [half-time [reuse-limit suppress-limit max-
suppress]] [route-map route-map]

• Configures BGP route flap dampening


• Parameter meaning:
• Half-time Exponential decay half-time (time in
which the penalty is halved)
• Suppress-limit Penalty value where the route is starting to
be dampened
• Reuse-limit Penalty value where the dampened route is
reused
• Max-suppress Maximum suppression time
• Route-map Dampening parameters are specified with a
route-map
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-130
Default BGP Dampening
Parameter Values
The following default dampening parameter
values are used if you don’t specify them:
• half-time 15 minutes
• per-flap penalty 1,000 (non-
configurable)
• suppress limit 2,000
• reuse limit 750
• max-suppress-time 60 minutes

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-131


Default BGP Dampening
Parameter Behavior
Most Internet Service Providers use default
values. With the default values:
• The flapping route is dampened after three
successive flaps
• Route stays suppressed for approximately 30
minutes
• Net result: your connectivity to the Internet is
gone for 30 minutes if you clear a BGP
session with your neighbor three times in
succession

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-132


Configuring Dampening
Parameters for Individual Routes
router(config-route-map)#
set dampening [half-time [reuse-limit suppress-limit max-
suppress]]

• Sets the BGP dampening parameters for individual


routes matched by a route-map entry
• Apply this route-map to the bgp dampening
command instead of specifying individual
parameters
• Applications:
• Less aggressive dampening of routes toward root DNS
servers (or other servers)
• Dampen smaller prefixes more aggressively

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-133


Monitoring Route Flap
Dampening
router#
show ip bgp dampened-paths

• Displays the damped routes


router#
show ip bgp flap-statistics

• Displays the flap statistics for all routes with


dampening history
router#
show ip bgp flap-statistics regexp regexp

• Display the flap statistics for routes matching a


regular expression
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-134
Monitoring Route Flap
Dampening (cont.)
router#
show ip bgp flap-statistics filter-list list

• Displays the flap statistics for routes matching the


specified AS PATH access list
router#
show ip bgp flap-statistics network mask

• Displays the flap statistics for the specified entry

router#
show ip bgp flap-statistics network mask longer-prefix

• Displays the flap statistics for all more specific


routes
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-135
Debugging Route Flap
Dampening
router#
debug ip bgp dampening

• Displays the BGP dampening events

Barney#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Barney(config)#router bgp 213
Barney(config-router)#bgp dampening
Barney(config-router)#
BGP: Created dampening structures with halflife time 15,
reuse/suppress 750/2000
BGP: dampening enabled

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-136


Route Flap Dampening
Example
Penalty (in thousands)

Suppress limit
2,5

2
The route is lost and enters
1,5 history state Penalty

Reuse limit
1

0,5

0 Flap history forgotten


Time
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-137
Route Flap Dampening
Example (2)
Barney#
BGP: charge penalty for 12.0.0.0/8 path 387 462 with
halflife-time 15 reuse/suppress 750/2000
BGP: flapped 1 times since 00:00:00. New penalty is 1000

Barney#show ip bgp 12.0.0.0


BGP routing table entry for 12.0.0.0/8, version 7
Paths: (2 available, best #2, advertised over EBGP)
387 462 (history entry) dampening information
1.3.0.3 from 1.3.0.3 (14.1.2.3)
Origin IGP, localpref 90, external
Dampinfo: penalty 992, flapped 1 times in 00:00:10
462
1.1.0.4 (metric 41024000) from 1.0.0.1 (11.0.0.1)
Origin IGP, metric 0, localpref 100, valid, internal, best
Barney#
The route is gone, but the history
entry is retained in the BGP table
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-138
Route Flap Dampening
Example (3)
Penalty (in thousands) Penalty goes over suppress
3 limit after several flaps

Suppress limit
2,5

1,5 Penalty

0,5

0
Time
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-139
Route Flap Dampening
Example (3) (cont.)
Route flaps, penalty goes
over suppress limit
Barney#
BGP: charge penalty for 12.0.0.0/8 path 387 462 with
halflife-time 15 reuse/suppress 750/2000
BGP: flapped 2 times since 00:05:37. New penalty is 1776

Barney#
BGP: charge penalty for 12.0.0.0/8 path 387 462 with
halflife-time 15 reuse/suppress 750/2000
BGP: flapped 3 times since 00:06:54. New penalty is 2681

Barney#
BGP: suppress 12.0.0.0/8 path 387 462 for 00:27:00 (penalty 2629)
halflife-time 15, reuse/suppress 750/2000

Route is damped after it


reappears in the BGP table
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-140
Dampened Path Printout
Barney#show ip bgp dampened-paths
BGP table version is 20, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best
Origin codes: i - IGP, e - EGP, ? - incomplete

Network From Reuse Path


*d 12.0.0.0 1.3.0.3 00:23:5 387 462 i

Barney#show ip bgp 12.0.0.0


BGP routing table entry for 12.0.0.0/8, version 7
Paths: (2 available, best #2, advertised over EBGP)
387 462, (suppressed due to dampening)
1.3.0.3 from 1.3.0.3 (14.1.2.3)
Origin IGP, localpref 90, valid, external
Dampinfo: penalty 2278, flapped 3 times in 00:10:32,
reuse in 00:24:00
462
1.1.0.4 (metric 41024000) from 1.0.0.1 (11.0.0.1)
Origin IGP, metric 0,The
localpref 100,
route is valid, internal,
available, best
but not used
or propagated to other neighbors
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-141
Route Flap Dampening
Example (4)
Penalty (in thousands) Penalty goes below suppress-limit
3 but not below reuse-limit

Suppress limit
2,5

2
Another flap increases penalty
1,5 Penalty

Reuse limit
1

0,5

0
Time
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-142
Route Flap Dampening
Example (5)
Penalty (in thousands)

2,5
Route is released after its
penalty drops below reuse limit
2

1,5 Penalty

Reuse limit
1

0,5

0 Flap history forgotten


Time
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-143
Route Flap Dampening
Example (6)
Penalty (in thousands)

2,5
Flap history is forgotten after
the penalty drops below half
2
of the reuse limit

1,5 Penalty

Reuse limit
1

0,5

0 Flap history forgotten


Time
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-144
Releasing Dampened Routes
router#
clear ip bgp flap-statistics [… parameters …]

• Clears the flap statistics, but does not release


dampened routes
router#
clear ip bgp dampening [network mask]

• Releases all the dampened routes, or just the


specified network
• Flap statistics or dampened routes are also cleared
when the BGP session with the neighbor is lost

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-145


Summary

After completing this section, you should be


able to perform the following tasks:
• Describe the need for BGP Route Flap
Dampening
• Describe the BGP Route Flap Dampening goals
• Describe the implementation of BGP Route Flap
Dampening on Cisco IOS
• Configure, monitor, and troubleshoot BGP
Route Flap Dampening
• Release dampened routes
© 2001, Cisco Systems, Inc. Advanced BGP Configuration-146
Review Questions

• What mechanisms are built into BGP to make


it more stable?
• How does route-flap dampening work?
• What types of routes can be dampened?
• What happens to withdrawn (unreachable)
networks if RFD is enabled?
• Which commands can you use to enable
Route-flap Dampening?

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-147


Summary
After completing this lesson, you should be able to
perform the following tasks:
• Describe the design issues in multi-homed BGP
networks
• Describe BGP local preference and identify its
applications
• Configure, monitor and troubleshoot BGP local
preference on Cisco IOS
• Describe BGP Multi-Exit-Discriminator (MED) and
identify its applications
• Configure, monitor and troubleshoot MED on Cisco IOS
• Configure, monitor and troubleshoot AS-path
prepending on Cisco IOS

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-148


Summary

You should also be able to:


• Describe the benefits and applications of BGP
communities
• Configure, monitor and troubleshoot BGP communities
on Cisco IOS
• Describe the need for BGP peer groups
• Configure, monitor and troubleshoot BGP peer groups
on Cisco IOS
• Describe the need for route damping and the goals of
route damping
• Configure and monitor BGP route flap dampening

© 2001, Cisco Systems, Inc. Advanced BGP Configuration-149


© 2001, Cisco Systems, Inc. Advanced BGP Configuration-150

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy