BGP Report
BGP Report
BGP Report
• BGP is most appropriate when at least one of the following conditions exists:
– An AS allows packets to transit through it to reach other autonomous
systems (for example, it is a service provider).
– An AS has multiple connections to other autonomous systems.
– Routing policy and route selection for traffic entering and leaving the AS
must be manipulated.
• BGP is not always appropriate. You do not have to use BGP if you have one of
the following conditions:
– Limited understanding of route filtering and BGP path-
selection process
– A single connection to the Internet or another AS
– Lack of memory or processor power to handle constant
updates on BGP routers
BGP Characteristics (Cont.)
• Neighbor table
– List of BGP neighbors
• BGP table (forwarding database)
– List of all networks learned from each neighbor
– Can contain multiple paths to destination networks
– Contains BGP attributes for each path
• IP routing table
– List of best paths to destination networks
BGP Message Types
Router(config-router)#
neighbor {ip-address | peer-group-name} next-hop-self
• In BGP, the next hop does not mean the next router; it means the IP address
to reach the next AS.
• For EBGP, the default next hop is the IP address of the neighbor router that
sent the update.
• For IBGP, the BGP protocol states that the next hop advertised by EBGP
should be carried into IBGP.
Example: next-hop-self Configuration
Using a Peer Group
Router(config-router)#
neighbor peer-group-name peer-group
Router(config-router)#
neighbor ip-address peer-group peer-group-name
• The router looks for exactly 192.168.1.1/24 in the routing table, but
cannot find it, so it will not announce anything.
Router(config-router)#
network 192.168.0.0 mask 255.255.0.0
9. RouterB(config-router)# no synchronization
BGP States
• Idle: The router in this state cannot find the address of the
neighbor in the routing table. Check for an IGP problem. Is
the neighbor announcing the route?
• Established: The established state is the proper
state for BGP operations. In the output of the show ip bgp
summary command, if the state column has a number, then
the route is in the established state. The number is how
many routes have been learned from this neighbor.
BGP Active State
• Well-known attributes
– Must be recognized by all compliant BGP implementations
– Are propagated to other neighbors
• Well-known mandatory attributes
– Must be present in all update messages
• Well-known discretionary attributes
– May be present in update messages
Optional Attributes
• Optional attributes
– They are recognized by some implementations (could be private);
but expected not to be recognized by all BGP routers.
– Recognized optional attributes are propagated to other neighbors
based on their meaning.
• Optional transitive attributes
– If not recognized, marked as partial and propagated to other
neighbors
• Optional nontransitive attributes
– Discarded if not recognized
BGP Attributes
• A list of autonomous
systems that a route has
traversed:
– For example, on router
B, the path to 192.168.1.0
is the AS sequence
(65500, 64520).
• The AS path attribute is
well-known, mandatory.
Next-Hop Attribute
• IGP (i)
– network command
• EGP (e)
– Redistributed from EGP
• Incomplete (?)
– Redistributed from IGP or static
• The origin attribute informs all autonomous systems in
the internetwork how the prefixes were introduced into
BGP.
• The origin attribute is well-known, mandatory.
Local Preference Attribute
• The BGP forwarding table usually has multiple paths from which to
choose for each network.
• BGP is not designed to perform load balancing:
– Paths are chosen because of policy.
– Paths are not chosen based on bandwidth.
• The BGP selection process eliminates any multiple paths through
attrition until a single best path is left.
• That best path is submitted to the routing table manager process and
evaluated against the methods of other routing protocols for reaching
that network (using administrative distance).
• The route from the source with the lowest administrative distance is
installed in the routing table.
Route Selection Decision Process
What is the best path for router C to 65003, 65004, and 65005?
Router C BGP Table with Default Settings
RouterC# show ip bgp
BGP table version is 7, local router ID is 3.3.3.3
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
* i172.16.0.0 172.20.50.1 100 0 65005 65004 65003 i
*>i 192.168.28.1 100 0 65002 65003 i
*>i172.24.0.0 172.20.50.1 100 0 65005 i
* i 192.168.28.1 100 0 65002 65003 65004 65005 i
*>i172.30.0.0 172.20.50.1 100 0 65005 65004 i
* i 192.168.28.1 100 0 65002 65003 65004i
• By default, BGP selects the shortest AS path as the best (>) path.
• In AS 65001, the percentage of traffic going to 172.24.0.0 is 30%, 172.30.0.0 is 20%, and 172.16.0.0 is 10%.
• 50% of all traffic will go to the next hop of 172.20.50.1 (AS 65005), and 10% of all traffic will go to the next hop of
192.168.28.1 (AS 65002).
• Make traffic to 172.30.0.0 select the next hop of 192.168.28.1 to achieve load sharing where both external links
get approximately 30% of the load.
Route Map for Router A
Router A configuration
router bgp 65001
neighbor 2.2.2.2 remote-as 65001
neighbor 3.3.3.3 remote-as 65001
neighbor 2.2.2.2 remote-as 65001 update-source loopback0
neighbor 3.3.3.3 remote-as 65001 update-source loopback0
neighbor 192.168.28.1 remote-as 65002
neighbor 192.168.28.1 route-map local_pref in
!
access-list 65 permit 172.30.0.0 0.0.255.255
!
route-map local_pref permit 10
match ip address 65
set local-preference 400
!
route-map local_pref permit 20
Router C BGP Table with Local Preference
Learned
RouterC# show ip bgp
BGP table version is 7, local router ID is 3.3.3.3
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
* i172.16.0.0 172.20.50.1 100 0 65005 65004 65003 i
*>i 192.168.28.1 100 0 65002 65003 i
*>i172.24.0.0 172.20.50.1 100 0 65005 i
* i 192.168.28.1 100 0 65002 65003 65004 65005
i
* i172.30.0.0 172.20.50.1 100 0 65005 65004 i
*>i 192.168.28.1 400 0 65002 65003 65004i
• Best (>) paths for networks 172.16.0.0/16 and 172.24.0.0/16 have not changed.
• Best (>) path for network 172.30.0.0 has changed to a new next hop of 192.168.28.1 because the
next hop of 192.168.28.1 has a higher local preference, 400.
• In AS 65001, the percentage of traffic going to 172.24.0.0 is 30%, 172.30.0.0 is 20%, and 172.16.0.0
is 10%.
• 30% of all traffic will go to the next hop of 172.20.50.1 (AS 65005), and 30% of all traffic will go to
the next hop of 192.168.28.1 (AS 65002).
Changing BGP MED for All Routes
• MED is used when multiple paths exist between two autonomous
systems.
• A lower MED value is preferred.
• The default setting for Cisco is MED = 0.
• The metric is an optional, nontransitive attribute.
• Usually, MED is shared only between two autonomous
systems that have multiple EBGP connections with each other.
Router(config-router)#
default-metric number
• Missing routes
• No iBGP full mesh
• Filters: routes are not received/sent
• Determine which filters are appliedto the BGP
session
• show ip bgp neighbors x.x.x.x
Example: show ip bgp Command
• The BGP local preference attribute can be changed to manipulate the best-path decision
process, either for all routes or for selected routes using route maps.
– Higher local preference values are preferred.
– Local preference is used only between IBGP speakers within the same AS.
• The MED values can be changed to manipulate packets
returning to an AS, either for all routes or for selected routes, using route maps.
– Lower MED values are preferred.
– The MED is sent to EBGP neighbors; those routers propagate the MED within their AS.
The routers within the AS use the MED but do not pass it on to the next AS.
• Routers in a typical enterprise BGP implementation multihome to two ISPs and pass default
routes to other routers within the enterprise.
Module Summary
AS number misconfiguration:
– At the router with the wrong remote AS number:
%BGP-3-NOTIFICATION: sent to neighbor 172.31.1.3
2/2 (peer in wrong AS) 2 bytes FDE6
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 002D 0104
FDE6 00B4 AC1F 0203 1002 0601 0400 0100 0102 0280
0002 0202 00
– At the remote router:
%BGP-3-NOTIFICATION: received from neighbor
172.31.1.1 2/2 (peer in wrong AS) 2 bytes FDE6
Example: BGP Peering
• Displays networks that are not installed in the RIB and the reason that
they were not installed
debug ip bgp updates Command
RouterA#debug ip bgp updates
Mobile router debugging is on for address family: IPv4 Unicast
RouterA#clear ip bgp 10.1.0.2
<output omitted>
*Feb 24 11:06:41.309: %BGP-5-ADJCHANGE: neighbor 10.1.0.2 Up
*Feb 24 11:06:41.309: BGP(0): 10.1.0.2 send UPDATE (format)
10.1.1.0/24, next 10.1.0.1, metric 0, path Local
*Feb 24 11:06:41.309: BGP(0): 10.1.0.2 send UPDATE (prepend, chgflags:
0x0) 10.1.0.0/24, next 10.1.0.1, metric 0, path Local
*Feb 24 11:06:41.309: BGP(0): 10.1.0.2 NEXT_HOP part 1 net
10.97.97.0/24, next 172.31.11.4
*Feb 24 11:06:41.309: BGP(0): 10.1.0.2 send UPDATE (format)
10.97.97.0/24, next 172.31.11.4, metric 0, path 64999 64997
*Feb 24 11:06:41.309: BGP(0): 10.1.0.2 NEXT_HOP part 1 net
172.31.22.0/24, next 172.31.11.4
*Feb 24 11:06:41.309: BGP(0): 10.1.0.2 send UPDATE (format)
172.31.22.0/24, next 172.31.11.4, metric 0, path 64999
<output omitted>
*Feb 24 11:06:41.349: BGP(0): 10.1.0.2 rcvd UPDATE w/ attr: nexthop
10.1.0.2, origin i, localpref 100, metric 0
*Feb 24 11:06:41.349: BGP(0): 10.1.0.2 rcvd 10.1.2.0/24
*Feb 24 11:06:41.349: BGP(0): 10.1.0.2 rcvd 10.1.0.0/24
Summary
• BGP is configured with the following basic BGP commands:
– router bgp autonomous-system
– neighbor ip-address remote-as autonomous-system
– network network-number [mask network-mask]
• The neighbor command activates a BGP session with a neighboring router.
• The neighbor shutdown command administratively shuts down a BGP neighbor.
• When creating a BGP packet, the neighbor statement defines the destination IP address and
the outbound interface defines the source IP address.
• When establishing a BGP session, BGP goes through the following states: idle, connect,
open sent, open confirm, and established.
• You can configure MD5 authentication between two BGP peers, meaning that each segment
sent on the TCP connection between the peers is verified.
• The show and debug commands are used to troubleshoot the BGP session.
Clearing the BGP Session
• BGP metrics are called path attributes and describe the paths to reach each
network. These attributes are categorized as well-known mandatory, well-known
discretionary, optional transitive, and optional nontransitive.
• The AS path attribute is a well-known mandatory attribute that lists the AS
numbers that a route has traversed to reach a destination.
• The BGP next-hop attribute is a well-known mandatory attribute that indicates the
next-hop IP address to use to reach a destination.
• The origin attribute is a well-known mandatory attribute that defines the origin of
the path information.
• The local preference attribute is a well-known discretionary attribute that provides
an indication to routers in the AS about which path is preferred to exit the AS.
Summary (Cont.)