Beruflich Dokumente
Kultur Dokumente
bitDegree.ca
Terms
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 2
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Use BGP when the effects of BGP are well understood and one of the
followingg conditions exist:
• Your AS allows packets to transit through it to reach another AS
(transit AS).
• Your AS has multiple connections to other AS’s.
• The flow of traffic entering or exiting your AS must be manipulated.
This is policy based routing and based on attributes.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 4
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Do not use BGP if you have one or more of the following conditions:
• A single connection to the Internet or another AS
• No concern for routing policy or routing selection
• A lack of memory or processing power on your routers to handle
constant BGP updates
• A limited understanding of route filtering and BGP path selection
process
• Low bandwidth between AS’s
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 5
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 6
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Static Route
2. Single-homed AS – IGP
bitDegree.ca
• Both the provider and the customer use a common IGP to share
information regarding the customer's networks.
– CE sends detailed routes to PE
– PE sends default route to CE
• This provides all the benefits associated with dynamic routing.
• BGP is not normally needed in this situation.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 10
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
• Use an EGP – The third method by which the ISP can learn and
advertise the customer's routes is to use an EGP such as BGP.
• In a single-homed
g autonomous system
y the customer's routing
gppolicies
are an extension of the policies of the provider.
– For this reason the Internet number registries are unlikely to assign
a public AS number.
– Instead, the provider can give the customer an AS number from the
private pool of AS numbers, 64,512 to 65,534.
– The provider will filter private AS numbers when advertising routes
into the Internet core.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 11
4. Dual Homed
bitDegree.ca
Option 3
Dual-homed
Dual homed AS
• Up to two links per ISP router, single ISP
• Same options as single-homed
• Additional advantages:
– Primary and backup link functionality
– Load Balancing
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 12
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
5. Single Multi-homed
bitDegree.ca
6. Dual Multi-homed
bitDegree.ca
Dual Multi-homed
• Two or more links per ISP, with two or more ISPs
• Similar options as Single Multi-homed
• Same benefits as single multi-homed but with enhanced resiliency.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 14
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
ISP
• Compared
p to a Single-homed
g AS,, this provides
p for redundancy.
y
• One option may be to use one link as the primary link and the other as
a backup link. (type 2 routes, with primary seeded at a lower cost)
• A better design would be to use both paths, with each one providing
backup for the other in the event of a failure (both are type 1 routes).
• In many cases this will be sufficient for good internetwork performance.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 15
Multihomed Non-transit AS
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Multihomed Non-transit AS
bitDegree.ca
http://bgp.potaroo.net
• Multihomed non-transit autonomous systems do not necessarily need
to run BGP with their providers.
• But, it is usually recommended and even required by some ISPs.
– because BGP allows increased control of route propagation and
filtering (BGP route selection is rooted in enterprise policies)
• accepting full BGP routes could mean upwards of 350,000 routes!!
– there were about 140,000 in Jan 2003
– consider "partial BGP routes" (i.e. only accept routes to provider's
other subscribers, and use default routing for all else)
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 17
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 18
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Multi-homed Transit AS
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 19
Multi-homed Transit AS
bitDegree.ca
Edge Router
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
• Your ISP will show little patience with you if you make mistakes in
your BGP configuration.
• Suppose, for example, that through some misconfiguration you
advertise 207.46.0.0/16 to your ISP.
• On the receiving side, suppose the ISP does not filter out this
incorrect route, allowing it to be advertised to the rest of the Internet.
• This particular CIDR block belongs to Microsoft, and you have just
claimed to have a route to that destination.
• A significant portion of the Internet community could decide that the
best path to Microsoft is through your domain.
• You will receive a flood of unwanted packets across your Internet
connection and, more importantly, you will have black-holed traffic
that should have gone to Microsoft.
• They will be neither amused nor understanding.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 22
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 23
BGP Basics
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 24
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
BGP Basics
bitDegree.ca
BGP Basics
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
100, 500
• Each BGP route carries a list of ASNs (called the "AS Path"),
constructed during route advertisement between external BGP
neighbours.
– The AS Path is considered an attribute of the BGP route.
• As network reachability is advertised from a BGP speaker to its EBGP
peer, its local AS number is added to the "AS Path“.
• Any BGP route represents reachability to the given destination via an
ordered traversal through each of the AS's listed in its AS Path
attribute.
• To guarantee a loop free path, any route received from an EBGP peer
will be discarded, if its AS Path contains the local ASN.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 27
172.16.0.0/16
Loop Free Path 172.16.0.0/16
(4, 2, 1)
AS4
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
172.16.0.0/16
Loop Free Path (7,4,2,1)
AS8
bitDegree.ca
172.16.0.0/16
(8,7,4,2,1)
AS9 172.16.0.0/16
(4, 2, 1)
X AS7
172.16.0.0/16
(9,8,7,4,2,1)
AS4
AS6
AS2
1 2 100, 500
bitDegree.ca
5 400, 300, 200, 100, 500 400, 300, 200, 100, 500
6
Sees its own ASN
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 30
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
BGP Operation
bitDegree.ca
Initial Exchange
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Withdrawn Routes
bitDegree.ca
BGP Keepalives
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 34
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
BGP Databases
bitDegree.ca
• Neighbor table
– List of BGP neighbors
– show ip bgp neighbors
– show ip bgp summary
• BGP table (forwarding database)
– List of all networks learned from each neighbour
– Can contain multiple paths to destination networks
– Contains BGP attributes for each path
– show ip bgp
• IP routing table
– List of best paths to destination networks
– show ip route
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 35
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 36
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 37
Type 1:
BGP Open Message
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
• This message type consists only of the BGP header and is sent
periodically between peers to maintain connections and verify the IP
paths between peers.
• If a router accepts the parameters specified in its neighbour’s Open
message, one of which is hold time, it responds with a Keepalive.
• If there is a mismatch in hold time values between peers, the lowest of
the two will be adopted.
• If the agreed-upon holdtime is zero, no other Keepalives are sent.
• Otherwise, Keepalives are sent thereafter at an interval of one-third
the agreed-upon holdtime (subject to a 1 sec minimum).
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 39
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 40
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 41
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 42
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
BGP FSM
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 43
BGP FSM
bitDegree.ca
BGP s Finite
BGP's
State Machine
includes 6 states:
1. Idle
2. Connect
3. Active
4. OpenSent
5. Open Confirm
6. Established
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 44
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 45
Idle State
bitDegree.ca
• BGP always begins in the Idle state, in which it refuses all incoming
connections.
• A BGP Start event ((IE=1),), normallyy initiated by
y an administrator or a
network event:
– Initializes all BGP resources
– Starts the ConnectRetry timer (initially, 60 secs)
– Initiates a TCP connection to the neighbour
– Changes its state to Connect
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 46
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Connect State
bitDegree.ca
• In this state, the BGP process has initiated a TCP connection and is
waiting for it to be completed.
• If the connection is successful (IE=3), the BGP process:
– Clears the ConnectRetry timer
– Completes initialization
– Sends an Open message to the neighbour
– Transitions to the OpenSent state
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 47
Connect State
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 48
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Connect State
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 49
Active State
bitDegree.ca
• In this state, the BGP process is aware of the neighbour, but has not
yet succeeded in establishing a TCP connection.
• The Hold Timer is set to 240 seconds.
• If the neighbour accepts our TCP connection (IE=3) and has the
expected IP address, the connection is successfully established:
– the ConnectRetry timer is cleared
– initialization completes
– an Open message is sent to the neighbour
– a transition is made to the OpenSent state
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 50
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Active State
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 51
Active State
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
• Active: The router has sent out an open packet and is waiting for a
response. The state may cycle between active and idle. The
neighbour may not know how to get back to this router because of
the following reasons:
– Neighbour does not have a route to the source IP address of the
BGP open packet generated by this router
– Neighbour peering with the wrong address
– Neighbour does not have a neighbor statement for this router
– AS number misconfiguration
OpenSent State
bitDegree.ca
errors
No errors
• In this state an Open message has been sent and BGP is waiting to
hear an Open message from its neighbour.
• When an Open message is received (IE=10), all its fields are checked.
– If errors exist,
exist a Notification message is sent and the state
transitions to Idle.
– If no errors exist, a Keepalive message is sent, Hold time is
determined (& Hold and Keepalive timers set as needed), the peer is
determined to be internal or external, and state is changed to
OpenConfirm.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 54
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
OpenSent State
bitDegree.ca
OpenConfirm State
bitDegree.ca
error
N errors
No
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Established State
bitDegree.ca
• In this state, the BGP connection is fully established and the peers
can exchange Update, Keepalive and Notification messages.
• If the Keepalive timer expires (IE=9), it is reset and a Keepalive
message is sent.
• If an Update or Keepalive message is received (IE=11 (IE 11 or 12), the
Hold timer is restarted (as needed) and Established state is
maintained.
• If a Notification is received (IE=13), the state transitions to Idle.
• If an Update with an error or any other event occurs (other than IE=1):
– a Notification message is sent
– the TCP connection is closed and a transition made to Idle state
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 57
Path Attributes
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Path Attributes
bitDegree.ca
• Since you will use path attributes extensively when configuring routing
policy, you should note that not all vendor implementations of BGP
recognize the same attributes.
• In fact,, path
p attributes come in four different types:
yp
– Well-known mandatory
– Well-known discretionary
– Optional transitive
– Optional non-transitive
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 59
Path Attributes
bitDegree.ca
Well-known mandatory
• An attribute that has to exist in the BGP UPDATE packet.
• It must be recognized by all BGP implementations.
• If a well-known
well known mandatory attribute is missing from an Update
Update, a
notification error will be generated; this ensures that all BGP
implementations agree on a standard set of attributes.
Example: AS_PATH attribute.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 60
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Path Attributes
bitDegree.ca
Well-known discretionary
• An attribute that must be recognized
g by
y all BGP implementations
p
• But may or may not be sent in the BGP UPDATE message.
Example: LOCAL_PREF
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 61
Path Attributes
bitDegree.ca
Optional transitive
• An attribute that may or may not be, recognized by all BGP
implementations (thus, optional).
• Because the attribute is transitive, the receiving BGP process
should always accept and propagate it, even if the attribute isn’t
recognized.
Example: COMMUNITY
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 62
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Path Attributes
bitDegree.ca
Optional non-transitive
• An attribute that may or may not be, recognized by all BGP
implementations.
p
• But because it is non-transitive, if the receiving BGP router does
NOT recognize the attribute, ignore it and do NOT propagate it to
other BGP peers.
Example: ORIGINATOR_ID
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 63
External BGP
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Internal BGP
bitDegree.ca
• BGP between neighbours within the same AS (and who need not
be directly connected), is called IBGP.
– IBGP exists to provide a pathway through the AS for BGP
route exchange; this permits the sharing of routes learned
from one EBGP peer with another EBGP peer.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
BGP
Configuration
bitDegree.ca
• BGP configuration
fi ti commands
d appear on th
the surface
f tto mirror
i th
the
syntax of familiar IGP commands.
• Although the syntax is similar, the function of these commands is
significantly different.
• Note: Cisco IOS permits only one BGP process to run at a time, thus, a
router cannot belong to more than one AS.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 66
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
BGP network
Configuration
bitDegree.ca
BGP network
Configuration
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Route Advertisement
bitDegree.ca
Route Advertisement
bitDegree.ca
• The first two network commands include the mask keyword, so that only a
particular subnet is advertised in each case.
• The third network command results in the OSPF route being advertised by BGP
without redistribution.
• Remember that the BGP network command works differently than the IGP
network command!
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 70
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
BGP neighbour
Configuration
bitDegree.ca
Router(config-router)#
neighbor {ip-address | peer-group-name} remote-as AS-number
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 71
connection to
EBGP neighbour
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 72
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Router(config-router)#
neighbor {ip-address | peer-group-name} update-source
interface-type interface-number
• This configures BGP to use the IP address of the specified
interface as the source IP for all BGP updates to that neighbour.
• This allows for EBGP peering when neighbours are not directly
connected. hops is the hop count to the peer’s IP address; if
omitted, value is set to 255.
• Below, is an alternative (IOS 12.0+, based on RFC 3682) … note
that hops is the maximum allowable hops to a valid peer. Packet
is originated with TTL=255, and an incoming packet’s TTL must
be >= (256 – hops). How does this enhance security?
neighbor {ip-address | peer-group-name} ttl-security hops
hops
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 73
IBGP Scenario
bitDegree.ca
C
EBGP EBGP
S0 S0
S2
IBGP S2
A B S1 E F
S1
D
AS 100 AS 200 AS 300
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
C
EBGP EBGP
S0 S0
S2
IBGP S2
A B S1 E F
S1
D
AS 100 AS 200 AS 300
• Introduce loopback interfaces on both B & E.
• Peer to each other's loopback interface IP addresses.
– These loopback addresses must be dynamically routed by the IGP
so that reachability is maintained over both serial paths.
• Force router B's BGP session to use its loopback as the source IP for
any BGP messages to E (and likewise for router E).
– By default, the source IP for any BGP message will be that of the
outbound interface, not the loopback. Since we are only peering on
the loopback IP, the message would otherwise be rejected.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 75
C
EBGP EBGP
S0 S0
S2
IBGP S2
A B S1 E F
S1
D
AS 100 AS 200 AS 300
Router B
router bgp 200
neighbor 192.168.255.2 remote-as 200
neighbor 192.168.255.2 update-source loop1
Router E
Reminder: Must advertise
both loopback IPs in the IGP. router bgp 200
neighbor 192.168.255.1 remote-as 200
neighbor 192.168.255.1 update-source loop2
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 76
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
EBGP Multihop
bitDegree.ca
EBGP Multihop
EBGP Multihop
EBGP Multihop
bitDegree.ca
EBGP Multihop
EBGP Multihop
I do not speak BGP. But RTW and
RTU can use EBGP multihop to
speak BGP.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 78
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
EBGP Multihop
bitDegree.ca
AS200 2.2.2.2
3.3.3.3
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 79
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 80
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Router(config-router)#
neighbor ip-address peer-group peer-group-name
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
Router(config-router)#
neighbor {ip-address | peer-group-name} password string
• Configure a “key”
key (password string)
• The router generates an MD5 digest (or hash), of the
key + the message.
– When introducing or changing a password, the
common string must be set on all peers before the
hold time expires (default 180 secs), to avoid
resettingg the BGP session.
• Only the message digest is sent; the key is not.
• Router generates and checks the MD5 digest of every
segment sent on the TCP connection. Router
authenticates the source of each routing update packet
that it receives.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 86
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
65000
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 87
BGP
Configuration
bitDegree.ca
• Finally, whenever you are configuring BGP, you might notice that
changes you make to an existing configuration may not appear
immediately.
• To force BGP to clear its table and reset BGP sessions, use the clear
ip bgp command.
command The easiest way a to enter this command is as follo
follows:
s
RTB#clear ip bgp *
Use this command with CAUTION, better yet, not at all, in a production
network. Why?
Better to clear a session with a specific neighbour, if it will suffice:
RTB#clear ip bgp 10.1.1.2
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 88
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Router(config-router)#
neighbor {ip-address | peer-group-name} shutdown
Router(config-router)#
no neighbor {ip-address | peer-group-name} shutdown
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 89
Example
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 90
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Example
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 91
Example
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 92
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Example
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 93
Example
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 94
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
• If the router has not installed the BGP routes you expect, you can use the
show ip bgp command to verify that BGP has learned these routes.
• More later…
RTA#show ip bgp
BGP table version is 3, local router ID is 10.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 95
• If an expected BGP route does not appear in the BGP table, you can use
the show ip bgp neighbors command to verify that your router has
established a BGP connection with its neighbours.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 96
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 97
BGP Peering
bitDegree.ca
AS500
• Routes learned via IBGP peers are not propagated to other IBGP peers.
– BGP Split Horizon Rule
• If they did, BGP routing inside the AS would present a dangerous
potential
t ti l for
f routing
ti loops.
l (because
(b no change
h to
t AS_PATH
AS PATH occurs
from one IBGP peer to the next)
• For IBGP routers to learn about all BGP routes inside the AS, they must
connect to every other IBGP router in a logical full mesh.
– You can create a logical full mesh even if the routers aren’t directly
connected, as long as the IBGP peers can connect to each other
using TCP/IP.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 98
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
BGP Peering
bitDegree.ca
AS500
AS Synchronization
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
AS Synchronization
bitDegree.ca
• If the route is not reachable through the IGP running within the AS,
non-BGP routers (such as RTD and RTB) will not be able to route
traffic passing through the AS towards this destination.
• Rationale: It is pointless to advertise destinations to external peers if
traffic sent through this AS is going to be dropped by some non-BGP
internal router along the way.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 101
AS Synchronization
bitDegree.ca
• If the IBGP router (RTC) does have an IGP route to this destination, the
route is considered synchronized, and the router will announce it to
other EBGP peers (ISP2).
• Otherwise, the router will treat the route as not being synchronized with
the IGP and will not advertise it.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 102
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
AS Synchronization
bitDegree.ca
AS Synchronization
bitDegree.ca
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
AS Synchronization
bitDegree.ca
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 105
AS Synchronization
bitDegree.ca
• In practice,
practice two situations exist where synchronization can be safely
turned off on border routers (default on IOS 12.2(8)T and later):
1. When all transit routers inside the AS are running fully
meshed IBGP. Internal reachability is guaranteed because a
route that is learned via EBGP on any of the border routers will
automatically be passed on via IBGP to all other transit routers.
2. When the AS is not a transit AS.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 106
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
show ip bgp
bitDegree.ca
To display entries in the BGP routing table, use the show ip bgp
command.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 107
show ip bgp
bitDegree.ca
RouterC#show ip bgp
BGP table version is 8, local router ID is 200.200.200.66
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 108
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
show ip bgp
bitDegree.ca
RouterC#show ip bgp
BGP table version is 8, local router ID is 200.200.200.66
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
• BGP table version - Internal version number of the table. This number
is incremented whenever the table changes.
• local router ID – uniquely identifies this router
router.
• Status codes - Status of the table entry. The status is displayed at the
beginning of each line in the table. It can be one of the following values:
s —The table entry is suppressed in favour of a summary route.
* —The table entry is valid (next hop is reachable).
> —The table entry is the best entry to use for that network.
i —The table entry was learned via an internal BGP (iBGP) session
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 109
show ip bgp
RouterC#show ip bgp bitDegree.ca
BGP table version is 8, local router ID is 200.200.200.66
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
• Origin codes - Origin of the entry. The origin code is placed at the end of each
line in the table. It can be one of the following values:
– i — Entry originated from Interior Gateway Protocol (IGP) and was
advertised with a network router configuration command.
– e — Entry originated from Exterior Gateway Protocol (EGP).
– ? — Origin of the path is not clear. Usually, this is a route that was
explicitly redistributed into BGP from an IGP.
• Network - IP address of a network entity.
• Next Hop - IP address of the next system that is used when forwarding a
packet to the destination network. An entry of 0.0.0.0 indicates that the router
has some non-BGP routes to this network.
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 110
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
show ip bgp
RouterC#show ip bgp
bitDegree.ca
BGP table version is 8, local router ID is 200.200.200.66
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 111
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 113
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 114
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Router#
clear ip bgp *
Router#
clear ip bgp {* | neighbor-address} [soft out]
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 116
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
Router(config-router)#
neighbor [ip-address] soft-reconfiguration inbound
Router#
clear ip bgp {* | neighbor-address} soft in
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 117
Route Refresh:
Dynamic Inbound Soft Reset
bitDegree.ca
Router#
clear ip bgp {* | neighbor-address} [soft in | in]
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 118
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray
BGP
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 119
10F NET3008 © 2010, David Bray, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved. 120
Copyright © 2010, Algonquin College, Rick Graziani, Cisco Systems, Inc. All rights reserved.
10F NET3008 – David Bray