BGP Understanding Part-9
BGP Understanding Part-9
Configuration
EBGP AS 462
IBGP
EBGP
64 kbps
100
EBGP AS 462
IBGP
100 EBGP
64 kbps
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
64
kb
ps
AS 462
s Internet
k bp
6
25
512 kbps
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
EBGP AS 462
IBGP RTR-A#
router
EBGP
bgp 213
bgp default local-preference 120
64 kbps
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
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
10.0.0.0 14.0.0.0
AS 213 AS 387
EBGP
IBGP IBGP
EBGP
64 kbps
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
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
AS 462
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
10.0.0.0 14.0.0.0
AS 213 AS 387
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
AS 462
64 kbps
AS 213
10.0.0.0/8
AS 387
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
AS 462
64 kbps
AS 213
10.0.0.0/8
Default traffic flow
AS 387
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
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=462 123
Network=10.0.0.0/8
Network=10.0.0.0/8
AS-Path=123
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)
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 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
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 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
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
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.
64 kbps
64 kbps
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
router>
router>
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#
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
router(config-router)#
neighbor group-name any-BGP-parameter
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
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
Peer-group parameters
router#
show ip bgp flap-statistics network mask longer-prefix
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
Suppress limit
2,5
2
The route is lost and enters
1,5 history state Penalty
Reuse limit
1
0,5
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
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
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