BGP understanding-Part 1
BGP understanding-Part 1
AS65000 AS65001
OSPF BGP
EIGRP
s
bp
M Company X (AS 20)
Service Provider 2
(AS 10)
ps
2
kb
M
bp
64
s
2 Mbps
Multi-homed P
Customer BG
Service Provider #2
BGP
BG
BGP
P
Service Provider
(Transit AS)
AS 21
Network=10.0.0.0/8
AS-Path=21 123
Network=10.0.0.0/8
AS 123 AS-Path=123
21.0.0.1
10.0.0.1Network=10.0.0.0/8
AS-Path=37 21 123
Network=21.0.0.0/8 AS 21
AS-Path=21
Next-hop = 10.0.0.1
AS 123 10.0.0.2 10.0.0.1 Rtr-B
Rtr-A 10.1.0.5
Network=21.0.0.0/8
10.1.0.6
AS-Path=123 21
Next-hop = 10.1.0.5
Rtr-C
AS 37
10.0.0.3
Rtr-C
AS 37
• If the receiving BGP router is in the same subnet as the current next-hop,
the next-hop address is not changed to optimize packet forwarding
© 2001, Cisco Systems, Inc. BGP Overview-35
Next-Hop Processing on
NBMA Network
Network=21.0.0.0/8 AS 21
AS-Path=21
Next-hop = 10.0.0.1
AS 123
10.0.0.2 10.0.0.1 Rtr-B
Frame
Relay
Rtr-A 10.0.0.3
Network=21.0.0.0/8
AS-Path=123 21
Next-hop = 10.0.0.1
Rtr-C
Connectivity is broken, Rtr-C AS 37
cannot reach next-hop 10.0.0.1
• BGP next-hop processing can break connectivity with improper network
designs over partially-meshed WAN networks
© 2001, Cisco Systems, Inc. BGP Overview-36
BGP Path Attribute Summary
Well-known mandatory attributes
• Recognized by everone, always present
• AS-Path, Next-Hop, Origin
Well-known discretionary
• Recognized by everone, optional
• Local Preference, Atomic Aggregate
Optional transitive
• Might not be recognized, propagated if not
• BGP Community, Aggregator
Optional non-transitive
• Might not be recognized, dropped if not
• Multi-exit-discriminator
AS 21
21.0.0.0/8
2.3.4.5
AS 123 2.3.4.6
1.0.0.0/8 Rtr-B
Rtr-A 3.4.5.7
3.4.5.6
Rtr-C AS 37
37.0.0.0/8
Rtr-A#show
Rtr-A#show ip
ip bgp
bgp sum
sum
BGP
BGP table
table version
version is
is 10,
10, main
main routing
routing table
table version
version 1010
33 network entries (3/6 paths) using 516 bytes of
network entries (3/6 paths) using 516 bytes of memory memory
33 BGP
BGP path
path attribute
attribute entries
entries using
using 284
284 bytes
bytes of
of memory
memory
00 BGP
BGP route-map
route-map cache
cache entries
entries using
using 00 bytes
bytes of
of memory
memory
00 BGP
BGP filter-list
filter-list cache
cache entries
entries using
using 00 bytes
bytes of
of memory
memory
Neighbor
Neighbor VV AS
AS MsgRcvd
MsgRcvd MsgSent
MsgSent TblVer
TblVer InQ
InQ OutQ
OutQ Up/Down
Up/Down State/PfxRcvd
State/PfxRcvd
2.3.4.5
2.3.4.5 44 21
21 17
17 22
22 10
10 00 00 0:01:47
0:01:47 27
27
3.4.5.6
3.4.5.6 44 37
37 11
11 17
17 10
10 00 00 0:07:07
0:07:07 35
35
Rtr-A#show ip bgp
BGP table version is 16, local router ID is 1.2.3.4
Status codes: s suppressed, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
as123#show ip bgp
BGP table version is 4, local router ID is 1.2.3.4
Status codes: s suppressed, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
as123#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate
default
1:36:42: RT: add 1.0.0.0 255.0.0.0 via 0.0.0.0, connected metric [0/0]
1:36:42: RT: interface Loopback0 added to routing table
1:36:42: BGP: route up 1.0.0.0 255.0.0.0
1:36:42: BGP: nettable_walker 1.0.0.0/255.0.0.0 route sourced locally
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state
to up
1:36:43: BGP: 2.3.4.5 computing updates, neighbor version 5, table
version 6, starting at 0.0.0.0
1:36:43: BGP: 2.3.4.5 send UPDATE 1.0.0.0 255.0.0.0, next 2.3.4.6,
metric 0, path 123
1:36:44: BGP: 2.3.4.5 1 updates enqueued (average=50, maximum=50)
1:36:44: BGP: 2.3.4.5 update run completed, ran for 4ms, neighbor
version 5, start version 6, throttled to 6, check point net 0.0.0.0
network major-network-number
router(config)#
router bgp <AS>
redistribute <IGP>
distribute-list <ACL> out <IGP>
!
access-list <ACL> permit <network>
router(config)#
192.1.1.0/24 192.1.1.0/24
Multihomed
Customer
Rest of the Internet
192.1.1.0/24 192.1.0.0/16
Primary Provider
(aggregating)
192.1.1.0/24 192.1.1.0/24
Multihomed
Customer
Rest of the Internet
192.1.1.0/24 192.1.0.0/16
192.1.0.0/16
192.1.1.0/24
Primary Provider
(aggregating)
router(config)#
router bgp 123
network 192.168.0.0 mask 255.255.240.0
aggregate-address 192.168.16.0 255.255.240.0
aggregate-address 192.168.32.0 255.255.240.0 summary-only
!
ip route 192.168.0.0 255.255.240.0 null 0
Network
Network Next
Next Hop
Hop Metric
Metric LocPrf
LocPrf Weight
Weight Path
Path
*> 1.0.0.0
*> 1.0.0.0 0.0.0.0
0.0.0.0 00 32768
32768 ii
** 21.0.0.0
21.0.0.0 3.4.5.6
3.4.5.6 00 37
37 21
21 ii
*>
*> 2.3.4.5
2.3.4.5 00 00 21
21 ii
*>
*> 37.0.0.0
37.0.0.0 3.4.5.6
3.4.5.6 00 00 37
37 ii
** 2.3.4.5
2.3.4.5 00 21
21 37
37 ii
*>
*> 192.168.0.0/20
192.168.0.0/20 0.0.0.0
0.0.0.0 00 32768
32768 ii
*>
*> 192.168.16.0/20
192.168.16.0/20 0.0.0.0
0.0.0.0 00 32768
32768 ii
*>
*> 192.168.16.0
192.168.16.0 0.0.0.0
0.0.0.0 00 32768
32768 ??
*>
*> 192.168.17.0
192.168.17.0 0.0.0.0
0.0.0.0 00 32768
32768 ??
*> 192.168.32.0/20
*> 192.168.32.0/20 0.0.0.0
0.0.0.0 00 32768
32768 ii
s>
s> 192.168.32.0
192.168.32.0 0.0.0.0
0.0.0.0 00 32768
32768 ??
s>
s> 192.168.33.0
192.168.33.0 0.0.0.0
0.0.0.0 00 32768
32768 ??
Router#debug
Router#debug ip
ip bgp
bgp updates
updates
1:36:43:
1:36:43: BGP:
BGP: 2.3.4.5
2.3.4.5 send
send UPDATE
UPDATE 192.168.0.0
192.168.0.0 255.255.240.0,
255.255.240.0, next
next
2.3.4.6,
2.3.4.6, metric
metric 0,
0, path
path 123
123
1:36:43:
1:36:43: BGP: 2.3.4.5 send UPDATE
BGP: 2.3.4.5 send UPDATE 192.168.16.0
192.168.16.0 255.255.255.0,
255.255.255.0, next
next
2.3.4.6, metric 0, path
2.3.4.6, metric 0, path 123123
1:36:43:
1:36:43: BGP:
BGP: 2.3.4.5
2.3.4.5 send
send UPDATE
UPDATE 192.168.17.0
192.168.17.0 255.255.255.0,
255.255.255.0, next
next
2.3.4.6,
2.3.4.6, metric
metric 0,
0, path
path 123
123
1:36:43:
1:36:43: BGP:
BGP: 2.3.4.5
2.3.4.5 send
send UPDATE
UPDATE 192.168.16.0
192.168.16.0 255.255.240.0,
255.255.240.0, next
next
2.3.4.6, metric 0, path
2.3.4.6, metric 0, path 123123
1:36:43:
1:36:43: BGP:
BGP: 2.3.4.5
2.3.4.5 send
send UPDATE
UPDATE 192.168.32.0
192.168.32.0 255.255.240.0,
255.255.240.0, next
next
2.3.4.6,
2.3.4.6, metric
metric 0,
0, path
path 123
123
Fred#show ip bgp
BGP table version is 11, 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
Next-hop
Other BGP attributes
AS-Path
© 2001, Cisco Systems, Inc. BGP Overview-94
Debugging BGP
router#
debug ip tcp transaction
router#
debug ip bgp event
router#
debug ip bgp updates
router#
debug ip bgp neighbor-ip updates [acl]
Diagnose
• Neighbor is not directly connected
Verification
• Verify with show ip route
Diagnose
• Neighbor is not reachable
Verification
• Verify connectivity with ping
• Check for access list presence
16:35:12: TCP0: state was SYNSENT -> CLOSED [11007 -> 192.168.4.14(179)]
16:35:12: TCB 0x82119C40 destroyed
Diagnose
• This router is not configured as BGP neighbor on
the neighboring router
Verification
• Check IP addresses of BGP neighbors with show
ip bgp summary on the neighbor router
© 2001, Cisco Systems, Inc. BGP Overview-102
BGP Session Startup
Neighbor not Configured
Router#debug ip tcp transaction
Diagnose
• AS-number mismatch between BGP neighbors
Verification
• Verify the AS-numbers configured for
neighboring routers show ip bgp summary on
both routes