Escolar Documentos
Profissional Documentos
Cultura Documentos
BGP
Tanner
5/23/2008
5/30/2008
Agenda
PART 2
PART 1
BGP
Fundamentals
Troubleshooting
2
PART 1
BGP Fundamentals
BGP and the Internet
BGP Fundamentals
Operations
MPLS WAN
AS
Autonomous Systems
Textbook
answer:
ASNs
Autonomous System Numbers
16-bit
ASNs
(RFC1930)
Range:
0-65535
Public: 1-64511
Private: 64512-65534
32-bit
ASNs
(RFC4893)
4-octets
0.0 to 65535.65535
Only 46 32-bit ASNs currently allocated
7
EIGRP
BGP
RP Type
Peering Mechanism
IP Protocol/IP/Port
Hello Interval
Hybrid
Multicast/Unicast
88/224.0.0.10
5 sec
BW + Delay (KValues)
Path Vector
Unicast Only
TCP/179
60 sec
Adds interfaces to
RP
Feasible Distance
Feasible
Successor
EC/UC using
Variance
Announces
network
AS Path
Path Selection
Route Admin
Distance
Network Statement
Loop Prevention
Alternate Path
Selection
Load Balancing
Mechanism
BGP Attributes
BGP table
Load sharing/TE
8
Path Selection
Attributes
Highest Weight
Highest Local Preference
Internally Originated
Shortest AS-Path
Manipulating
these attributes
changes BGP path selection
9
Terminology
attribute [noun]
Pronunciation: \a-tr-byt\
3:a word ascribing a quality; especially
10
BGP Attributes
RFC1771 attributes its success to its attributes
Attribute Direction Comment
Locally significant to router. Proprietary.
Dont use.
Weight
Outbound
Weight of 32768 auto-assigned to
originated nets
Local
Shared between iBGP peers. Higher is
Outbound
Pref
better.
MED/Metr
Allows injection of IGP metric info into
Inbound
ic
BGP
i = Prefix learned via BGP network
statement
Origin
n/a
E = Not Used
? = Learned via redistribution
Ordered list of ASs route has traversed.
AS-Path Inbound
Shorter is better.
Next hop n/a
IP address of the advertising router
Communi
Inbound
11
BGP Attributes
Most Used
Influence
INBOUND Traffic
Influence
OUTBOUND traffic
preferred)
12
Description
BGP I/O
BGP
Scanner
BGP
Router
Interval
At initialization, when
establishing a TCP
connection with a BGP
peer.
As BGP control packets are
received.
Once a minute.
Section Review
Fundamentals
What
is an autonomous system?
What are BGP attributes that affect
inbound traffic?
What are BGP attributes that affect
outbound traffic?
Name 4 common BGP path selection
criteria
What maintenance task happens
every 60 seconds in BGP?
14
15
Global IP Assignments
IANA
Regional
Registrars
ISPs
End Users
16
17
Prefixe
s
Mar 20,
135,465
2004
Mar 18,
157,975
2005
Apr 14,
186,530
2006
Apr 21,
218,298
2007
May 2,
259,04
2008
7
.:: Limit Prefixes on Cisco routers
May 13,
266,035
2008
router bgp 12345
neighbor 1.1.1.1 maximum-prefix 300000 90
18
RIR whois
ARIN
AfriNIC
IP Lookup
Country
Lookup
19
Single
ISP
Private AS or Static (No
BGP)
Multi-homed,
Single ISP
Private AS
Multi-homed,
Dual ISP
Public AS
20
Prefix Origination
Inbound Traffic
Common
Elements
Provider
Provider
(PI)
Applied for from RIR (e.g., ARIN)
More Paperwork (and solid justification)!
21
Prefix
es
Require
d
Advantage
Memory
Best load
265,0
sharing
Full Routes1
155MB
00
Bogon
filtering
Low mem
75,00
usage
Customer Only2
44MB
0
Some load
share
Customer2+Upst 150,0
88MB Balanced
ream3
00
Low mem
1
Based on 2Only
upstream eBGP peers 1 32KB
Default
usageprefixes
2
Varies depending on quantity of ISP customers announcing
Disadvantage
High mem
usage
Higher CPU
usage
No bogon
filtering4
No bogon
filtering4
Minimal TE
Inbound bogon filtering is still possible, however outbound will not function due to
22
Memory Requirements
Full BGP Routes
Adding
Getbufs
16
Retbufs Process
16 BGP Router
5164371 BGP I/O
234
239016
6984
5164371
235
82472
9972
0 BGP Scanner23
to filter prefixes
Filter-lists
to filter ASNs
Route-maps
to apply policy
Distribute-lists
(dont use)
Configuration Example
ISP eBGP Peer with Partial Routes
router bgp 1234
no auto-summary
no synchronization
no bgp fast-external-fallover
bgp log-neighbor-changes
neighbor 192.0.2.233 remote-as 209
neighbor 192.0.2.233 description eBGP with Qwest AS209. Password:
neighbor 192.0.2.233 password 1234abcd
neighbor 192.0.2.233 version 4
neighbor 192.0.2.233 soft-reconfiguration inbound
neighbor 192.0.2.233 maximum-prefix 300000 90 warning-only
neighbor 192.0.2.233 prefix-list PL-BOGONS in
neighbor 192.0.2.233 prefix-list PL-ANNOUNCE out
neighbor 192.0.2.233 route-map RM-QWEST-OUT out
neighbor 192.0.2.233 route-map RM-QWEST-IN in
neighbor 192.0.2.233 filter-list 1 out
neighbor 192.0.2.233 filter-list 10 in
network 205.93.251.0 mask 255.255.254.0
network 205.93.251.0
ip
ip
ip
ip
route
route
route
route
ip
ip
as-path
as-path
1234abcd
1 permit ^$
10 permit _(209|7018)$
25
Regular Expressions
BGP AS Filtering
Defining
our AS
Originating
in AS 3549
Originating
in AS 3549 or Upstream AS
Deny
27
Bogon Filtering
Manual Method
Outbound
filter)
ip
ip
ip
ip
ip
ip
ip
ip
prefix-list
prefix-list
prefix-list
prefix-list
prefix-list
prefix-list
prefix-list
prefix-list
Inbound
BOGONS
BOGONS
BOGONS
BOGONS
BOGONS
BOGONS
BOGONS
BOGONS
traffic
Bogon Filtering
Automatic Method
Do
Configure a community list to accept the bogon prefixes into the route-map.
ip bgp-community new-format
ip community-list 10 permit 65333:888
Configure the route-map. Remember to apply it to the proper peering sessions.
route-map RM-CYMRUBOGONS-IN permit 10
description Filter bogons learned from cymru.com bogon route-servers
match community 10
set ip next-hop 192.0.2.1
Set a bogon next-hop on all routers that receive the bogons.
ip route 192.0.2.1 255.255.255.255 null0
ip prefix-list PL-CYMRU-OUT seq 5 deny 0.0.0.0/0 le 32
29
BGP Communities
WELL KNOWN
TE CUSTOM COMMUNITIES
no-advertise
no-export
30
BGP Communities
Configuration Example
6453
209
7018
64512
6453
3549
7018
64512
ip bgp-community new-format
ip prefix-list PL-ANNOUNCE seq 10 permit 205.93.251.0/24
ip prefix-list PL-ANNOUNCE seq 10 deny 0.0.0.0/0 le 32
route-map RM-ISP-OUT permit 10
match ip address prefix-list PL-ANNOUNCE
set community 65011:209
route-map RM-ISP-OUT permit 20
router bgp 64512
neighbor 1.1.1.1 send-community
neighbor 1.1.1.1 route-map RM-ISP-OUT out
6453
209
7018
6453
3549
7018
7018 64512
64512
31
Section Review
BGP & the Internet
What
PART 2
BGP and the MPLS WAN
Troubleshooting BGP
33
34
MPLS Basics
Topology
Full Mesh
Single peer to WAN cloud
L1
Transport
T1
DS3
L2
Transport
PPP / MLP
ATM / IMA
Frame Relay
Ethernet
Routing
Protocols
BGP
EIGRP
RIP
Public/Private
ASs
35
MPLS Terminology
CE
Router
Customer Edge
PE
Router
Provider Edge
P/LSR
Router
Provider Backbone/Label
Switching Router
VRF
Virtual Routing and Forwarding
Everything
BGP!
else is standard
36
Single
ISP
Easiest routing policies
Multi-homed,
Single
ISP
Most common
37
BGP Table
How do you read this thing???
> is the
path
installed in
the
routing
table
means
there is
already a
route with a
better AD
Next Hop
is the
neighbor IP
of eBGP
peer(s)
32768
means
prefix was
originated
via
redistribution
means
prefix
originated
on this
router
WAN-Router# sh ip bgp
BGP table version is 7345, local router ID is 172.16.254.3
Status codes: s suppressed, d damped, h history, * valid, > best,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop
Metric LocPrf Weight Path
* i12.86.42.44/30
172.16.254.4
0
100
0 7018
*>
12.122.14.185
0 7018
r>i172.16.254.4/32 172.16.254.4
0
100
0 ?
*> 172.16.254.16/29 0.0.0.0
0
32768 ?
*> 172.16.254.24/29 0.0.0.0
0
32768 ?
* i172.30.32.0/20
172.16.254.4
0
100
0 7018
*>
12.122.14.185
0 7018
*> 172.30.64.0/20
12.122.14.185
0 7018
means route
is OK to inject
in routing table
means prefix
learned from
iBGP peer
CIDR Mask
try to
summarize
where possible
AS set
is the
list of ASs
prefix has
passed
i - internal,
?
?
7018 i
7018 i
7018 ?
means prefix
was originated
via network
statement
38
Default Route
Origination
Origination Type
Default
Originate
Static
Redistribution
w/Route Map
Filter
Network
Statement
Allow
Syntax
Policies*?
Partial
No
Yes
39
Weight
Local Pref
Local
Originate
AS Path
Origin Type
Lowest MED
eBGP over
iBGP
IGP Metric to
NH
Received
First
Lowest RID
Originator ID
Neighbor IP
BGP
Multipath
WAN-router> sh ip bgp
Network
Next Hop
*> 0.0.0.0
172.14.16.250
* 0.0.0.0
10.217.13.102
Multi-VRF
w/Sub-interfaces
WAN-router> sh ip bgp
Network
Next Hop
*> 0.0.0.0
172.11.132.193
Only
send
the
very
best!
Route Redistribution
Seek first to
summarize
Do
Yes = Redistribution
No = Summarization
Maybe = Both?
BGP
to EIGRP
EIGRP
to BGP
41
Miscellaneous Features
Peer
Groups
Route
Reflectors
42
Best Practices
Avoid
etc.
Look
Summarize
Advertise only what is necessary
Use
Case Study
Requirements
WAN to Internet
Use DC as primary
Use Campus as secondary
Use Internet VPN as tertiary
WAN to Hubs
Use each hub MPLS DS3
Use other hub DS3 as
secondary
Use Internet VPN as tertiary
Hub to Hub
Use LAN link as primary
Dont use MPLS DS3s as
secondary
44
Case Study
Possible Solution
Default
Networks:
1 via eBGP to
MPLS
1 via iBGP to
VPN
Advertised
Networks:
Shortest AS path
(DC)
Advertised
Networks:
network 0.0.0.0
network
10.112.0.0
to Internet
Use DC as primary
Use Campus as secondary
Use Internet VPN as tertiary
WAN to Hubs
Use each hub MPLS DS3
Use other hub DS3 as secondary
Use Internet VPN as tertiary
Hub
to Hub
Advertised
Networks:
network 0.0.0.0
Received
Networks:
Summarized
0.0.0.0/0 ge 29
Networks:
le 32
summary-addr
10.x.0.0/20
summary-addr <WAN
Summarized
nets>
Networks:
summary-addr
10.112.0.0/16
Campus to
WAN:
EIGRP Metric
better via
Router 1
WAN
Received
Networks:
0.0.0.0/0
ge 29
Advertised
le
32
Networks:
network 0.0.0.0
DC to Campus:
Only 1 route via
Interlink
Received
Networks:
0.0.0.0/0 ge 29
le 32
Default Route
Static route
redistributed into
EIGRP
45
1234abcd
46
router eigrp 1
redistribute bgp 100 metric 1500 1000 255 1 1500 route-map PL-WAN-SERIALS
network 10.112.2.0 0.0.0.255
no auto-summary
ip prefix-list PL-WAN-SERIALS seq 10 permit 0.0.0.0/0 ge 29
route-map RM-WAN-SERIALS permit 10
description Only redistribute WAN serials (/29 to /32 prefixes) into EIGRP process
match ip address prefix-list PL-WAN-SERIALS
Advertise
Section Review
BGP & MPLS
What
What
What
BGP Troubleshooting
Interpreting and Troubleshooting BGP Operations
49
Peer Establishment
Peer Reachability
MD5 Password Mismatch
Wrong neighbor IP
Wrong update-source
Wrong peer AS
TTL / ebgp-multihop
Stuck in OpenSent/OpenConfirm
Asymmetric routing & TTL problem
ACLs
between peers
Blocking TCP/179
50
Flapping Peer
*May
*May
*May
*May
*May
*May
*May
*May
*May
*May
*May
*May
*May
20
20
20
20
20
20
20
20
20
20
20
20
20
04:02:39.240
04:02:54.468
04:20:44.999
04:20:44.999
04:21:04.243
04:52:18.132
04:52:18.132
04:55:16.469
04:56:17.169
04:56:36.533
05:09:28.555
05:09:35.087
05:47:57.350
MST:
MST:
MST:
MST:
MST:
MST:
MST:
MST:
MST:
MST:
MST:
MST:
MST:
Remote
Received Routes
Pre/Post Filter
Show
Show
Show
Path
7018
4323
4323
4323
52
Missing Routes
Next
Route
with better AD
already exists in RIB
Filters
Prefix
AS-Path
Route-maps
53
Announcements
Verify advertised routes
Show
Next Hop
205.93.251.4
0.0.0.0
What
BGP Table
Analyzing and Interpreting
Router# sh ip bgp
BGP table version is 24849, local router ID is 205.215.216.193
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop
Metric LocPrf Weight Path
*>i0.0.0.0
205.93.251.125
0
100
0 7018 i
*> 3.0.0.0
192.0.2.233
0 4323 1239 701 703 80 i
*> 4.0.0.0/9
192.0.2.233
0 4323 3549 3356 i
* i
205.93.251.125
0
100
0 7018 209 3356 i
*> 4.0.0.0
192.0.2.233
0 4323 3549 3356 i
* i
205.93.251.125
0
100
0 7018 209 3356 i
*> 4.23.112.0/24
192.0.2.233
0 4323 174 21889 i
*>i12.2.60.0/22
205.93.251.125
0
100
0 7018 209 7018 32719 i
*
192.0.2.233
0 4323 6539 19092 26794 26794 26794
26794 26794 26794 26794 26794 26794 26794 26794 32719 i
Note
to self: 10 prepends is
excessive
Average AS path length is 3.6
55
Looking Glass
Public BGP Route Servers - CLI
Verify how the global internet routing table views your prefix
announcement
1st
2nd
3rd
3333
3356
1239
3356
1239
4323
701
209
6453
6453
293
4th
5th
Len
ISP Path
64512
7018
64512
209
7018
64512
3549
7018
64512
4323 64512
4323 64512
56
Looking Glass
Public BGP Route Servers Web/CLI
57
High CPU
Process Name
BGP Open
BGP I/O
BGP Scanner
BGP Router
Description
Performs BGP peer establishment.
Processing of BGP packets, such as UPDATES and
KEEPALIVES.
Walks the BGP table and confirms reachability of the
next hops.
Calculates the best BGP path . Sends and
receives routes and interacts with the routing
information base (RIB).
568684
2305861
321
246815548
1497615
246
0.00%
0.01%
0.00%
0 BGP I/O
164807 76.47%
9.23%
6.50%
0 BGP Scanner
58
High Memory
L3-Switch# sh proc mem | i PID|BGP
PID TTY Allocated
Freed
Holding
319
0 541682808 353471992 177441136
320
0
1377432
2361312
7048
321
0
136
323920
10216
L3-Switch# sh ip bgp sum
Neighbor
V
AS MsgRcvd
32.124.75.251
4
209 1741759
52.111.238.129 4 5555 2798645
192.0.1.148
4 22222
68448
192.0.2.228
4 33333
67386
192.0.3.254
4 11111 2140027
MsgSent
68344
68231
2134480
2381477
2272911
Getbufs
0
0
0
TblVer
9564122
9564122
9564122
9564122
9564130
Retbufs
0
0
0
Process
BGP Router
BGP I/O
BGP Scanner
State/PfxRcd
251577
254104
35
118
254360
750K
59
Latency
Perception v. Reality
What
from
from
from
from
from
from
from
from
from
209.85.171.100:
209.85.171.100:
209.85.171.100:
209.85.171.100:
209.85.171.100:
209.85.171.100:
209.85.171.100:
209.85.171.100:
209.85.171.100:
bytes=32
bytes=32
bytes=32
bytes=32
bytes=32
bytes=32
bytes=32
bytes=32
bytes=32
time=5ms TTL=247
time=6ms TTL=247
time=99ms TTL=247
time=225ms TTL=247
time=248ms TTL=247
time=66ms TTL=247
time=8ms TTL=247
time=5ms TTL=247
time=5ms TTL=247
Section Review
Troubleshooting
What
What
What
What
BGP Resources
North
www.traceroute.org
62