Docsity

bgp notes for ccnp exams, Exercises of Networking

Toggle sidebar
bg1
bgp notes
bgp characteristics
-------------------
path vector protocol with reliable updates and rich metrics
reliable updates are via TCP used as transport protocol
bgp uses NO periodic updates but TCP does but bgp uses
triggred updates
for internal peer, update is every 5 seconds
for external peer, update is every 30 seconds
bgp is CPU intensive with slow convergence
single-homed customers
----------------------
use bgp if
*customer is multihomed to the same ISP
*customer want to use dynamic routing protocol with ISP
*smaller ISP needs to originate their routes to internet
other than above conditions use static routes
multihomed customers
--------------------
customer connects to more than one service provider
bgp is almost mandatory for such cases; customer in this
case should use public AS numbers with a provider-independent
address space.
transit autonomous system
-------------------------
bgp is mandatory for networks carrying customer traffic
RFC1771 BGP limitations
-----------------------
you cannot influence the routing policies of downstream AS.
bgp is bound by IP hop-by-hop, destination-only routing.
===2===
BGP Path Attributes
-------------------
attributes are metrics for the bgp
well-known attributes recognized by all compliant implementations
optional attributes are private not to be recognized by all
++++++++++++++++++++
well-known attributes are divided into as
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download bgp notes for ccnp exams and more Exercises Networking in PDF only on Docsity!

bgp notes bgp characteristics


path vector protocol with reliable updates and rich metrics reliable updates are via TCP used as transport protocol bgp uses NO periodic updates but TCP does but bgp uses triggred updates for internal peer, update is every 5 seconds for external peer, update is every 30 seconds bgp is CPU intensive with slow convergence single-homed customers


use bgp if *customer is multihomed to the same ISP *customer want to use dynamic routing protocol with ISP *smaller ISP needs to originate their routes to internet other than above conditions use static routes multihomed customers


customer connects to more than one service provider bgp is almost mandatory for such cases; customer in this case should use public AS numbers with a provider-independent address space. transit autonomous system


bgp is mandatory for networks carrying customer traffic RFC1771 BGP limitations


you cannot influence the routing policies of downstream AS. bgp is bound by IP hop-by-hop, destination-only routing. ===2=== BGP Path Attributes


attributes are metrics for the bgp well-known attributes recognized by all compliant implementations optional attributes are private not to be recognized by all ++++++++++++++++++++ well-known attributes are divided into as

mandatory (must be in all updates)(propagated to neighbors) and discretionary (optional) ++++++++++++++++++++ mandatory well-known attributes are *ORIGIN (of the bgp route)

. i --> originated in an IGP . e --> originated in EGP .? --> route is distributed into BGP

  • AS-Path --> sequence of AS numbers through which the network is accessible
  • Next-Hop --> IP address of the next hop router discretionary well-known attributes are
  • local preference for consistent routing policy in AS
  • atomic aggregate informs neighbor AS that originating router aggregated routes optional bgp attributes are divided into two *transitive -->propagated to other neighbors if not recognized (aggregator, community) *non-transitive -->discarded if not recognized (MED) AS-Path Attribute

empty as local route is inserted in the bgp table AS number is prepended by the sender reciever uses this attribute to determine route to follow an AS recieves a routing info with its own AS number in AS path, it silently discards packet Next-Hop Attribute


usually set to IP of the sending external BGP router can be set to other IPs for routing optimization +--------- As100 R1 10.0.0. AS123 R2 10.0.0.2-----+ 10.1.1.5---------+ +---------AS200 R3 10.1.1. from AS100 to AS123 next-hop 's 10.0.0. from 123 to AS200 next-hop is 10.1.1. for networks beyond R

receiving bgp routing updates R#debug ip bgp update all inbound updates are placed into BGP table R#sh ip bgp Network Next Hop Metric LocPrf Weight Path *> 1.0.0.0 0.0.0.0 0 32768 i BGP route selection criteria


a. exclude routes with inaccessible next hop b. prefer highest weight local to the router c. prefer highest local prefrence global within AS d. prefer the routes that the router originated e. prefer the shortest AS path only length is compared f. prefer the lowest origin code igp<eg<incomplete g. prefer lowest MED h. prefer external ebgp paths over internal igbp i. for ibgp paths, prefer path through closest igp neighbor j. for ebgp paths, prefer the oldest most stable path k. prefer paths from router with the lowest bgp router-id best routes to the destination netowrks are selected from the bgp table and also best routes are propagated to bgp neighbors best bgp routes are copied into the IP routing table based on administrative distance bgp router process keeps a list of local networks _ defined with the network command or through redistribution bgp periodically scans IP routing table and inserts or revokes routes from the bgp routing table based on their presence in the IP routing table after removing a route from the routing table R#debug ip routin R#debug ip bgp update 2:22:33: RT: interface Loopback0 removed from routing table 2:22:33: BGP: 2.3.4.5 send UPDATE 1.0.0.0 255.0.0.0 -- unreachable 2:25:34: RT: interface Loopback0 is addes to routing table 2:25:35: BGP: 2.3.4.5 send UPDATE 1.0.0.0 255.0.0.0, next 2.3.4.6 metric 0, path 123 automatic summarization


*automatic summarization is enabled by default *enable automatic summarization when

. summarization of IGP-to-BGP redistributed routes to major network boundaries . using classful network command to summarize subnets to a major network boundary *disable automatic summarization whrn

. summarization on IGP-to-BGP redistribution not desired . using classless variant of the network configuring basic BGP


R(config)# router bgp <as-number> *starts BGP routing *64512-65535 private AS numbers *only one BGP routing process per router is allowed R(config-router)#neighbor <ip-address> remote-as <as-number> *defines an extenal neighbor *external neighbor has to be reachable over directly connected subnet R(config-router)#neighbor <ip-address> shutdown *used in debugging and troubleshooting scenarios *used for temporarily disable a BGP neighbor R(config-router)# timers bgp keepalive holdtime holdtime is used in BGP open messages R(config-router)# neighbor [ip-add|peer group name] timers keepalive holdtime above command parameters overrides default settings of timers R(config-router)# neighbor <ip-add> password *enables MD5 authentication on a specific BGP session *password string on both routers must match announcing networks in BGP


only administratively defined networks are announced in BGP *manually configure networks to be announced *use redistribution from igp *use aggregation to announce summary prefixes auto-summary for locally inserted networks with network command and reistributed routes are on by default netowrk command has totally different meaning in bgp other than any other routing protocols/ at least one of the subnets must be in the routing table in order to advertise a major network into bgp route-map option can be used for router parameters to be modified before they are sent to routing table like . changing weight of a locally sourced route . tagging sourced routes with bgp communities . setting local prefrerence for a specific network . changin the value of MED for a specific network redistirbuted routes carry origin attribute of 'incomplete' filter redistriburted routes to prevent route leaking aviod using redistribute routes into bgp in service provider environments

configured conditions

. improves accurascy of common route aggregation by conditionalyy injecting or replacing less specific prefixes with more specific prefixes bgp support for TTL security check


. ebgp peering sessions from CPU utilization-based attacks TTL security check protects the bgp router . compares current ttl and incoming ip packets ttl . support both directly connected sessions and multihop ebgp peering sessions multihomed customer aggregation problem


primary advertises aggregate, backup advertises individula network remote AS prefers longest match so backup is preferred solution is NOT using AGGREGATION monitor and troubleshoot bgp


R#sh ip bgp summary --> general overview R#sh ip bgp neighbors <ip-address> --> detailed neighbor info R#sh ip bgp --> all routes in bgp table R#sh ip bgp 14.12.0. Paths: (2 available, best #1, advertised over EBGP) 213 ---->AS-Path 1.2.0.1 (next-hop) from 1.2.0.1 (advertising router address) (10.1.1.1--> advertising router-id) .................metric 530............... (other bgp attributes) R#debug ip tcp transactions -->start of session etx R#debug ip bgp events --> neighbor state transitions R#debug ip bgp keepalives R#debug ip bgp updates --> all incoming and outgoing updates R#debug ip bgp updates --> USE W/ CAUTION bgp session startup problems


  • neighbors do not become active . sh ip bgp neighbors --> neighbor state as idle for several minutes . neighbor is not directly connected is the symptom . sh ip route for verification
  • neighbor acvive but session not established . debug ip tcp transactions . check for ACL . router not configured as neighbor . sh ip bgp summary to check
  • neighbor oscilates between idle and active . debug ip tcp transactions

. AS mismatch between bgp peers . sh ip bgp summary to verify working wtih a transit AS


R21(AS21)---___ R1(AS11)---___R2(AS11) | | | | | | R3(AS11)---R4(AS11)---R33(AS4) Transit AS propagates routes between remote ASs and routes packets between remote networks routes between ASs are always exchanged via eBGP only rpotocol that can be transport all BGP attributes across the backbone is internal BGP. An iBGP session must be established between transit AS border routers to propagate eBGP routes. That is between R1 and R R3 needs external routes for proper packet forwarding so R3 must receive BGP routes all core routers must have all external routes, core routers must recieve bgp routes. redistributing it into IGP is not scalable and DEFAULT routing is not applicable in transit AS core iBGP abd eBGP interaction in a transit AS


AS path as received from external neighbor is not changed on ibgp sessions local AS is prepended to AS path on ebgp sessions multipath load sharing in bgp


to prevent loops, incoming iBGP update is not propagated to other iBGP peers no BGP attributes are exchanged in iBGP updates, making loop detection impossible-split horizon is needed to prevent BGP routing loops iBGP full mesh


for proper iBGP route propagation, full mesh of iBGP sessions has to be established between all bgp speaking routers. this iBGP full mesh is logical of TCP sessions only, physical full mesh is not required

lookup result is stored in switching cache ARP cache lookup is performed to build layer2 header CEF precomputes the routing table; all recursive lookups are performed while the routing table is built an IGP is needed to resolve BGP next hops and perform fast convergence after a failure in the core of transit AS in transit AS, core routers need to run BGP and an IGP BGP carries all external routes IGP propagates BGP next hops and other core subnets only All customer routes are also carried in BGP reducing IGP topology database and removing customer-based route flaps from IGP; IGP becomes more stable IGP is not affected by external route flaps BGP is not affected by failures internal to the network as long as BGP next hop remains reachable only link (relation) between BGP anf IGP should be the recursive lookup due to bad network design, same route is propagated via both BGP and IGP, in that case, route will be determined ebgp/igp/ibgp prder duye to administrative distance 20/90-170/ if an igp route is learned through ebgp, ebgp route will take precedence to overcome this, protect igp routes with inbound prefix-list filters at AS edges ROUTERS should NEVER accept INFO about local subnets from an EXTERNAL source transit AS configuration


configuring the iBGP neighbors first R(config-router)#neighbor <ip-address> remote-as <as-num> R(config-router)#neighbor <ip-address> update-source above command configures the source interface for the TCP session that carries BGP traffic

for iBGP sessions, the source interface is a loopback address source address on one peering router must match the destination address configured on the other router - otherwise a BGP session will not start otherwise MAKE SURE that LOOPBACK interface are ANNOUNCED in the backbone IGP configuring BGP synchronization


R(config-router)#no sychronization disables synch between BGP and IGP in modern transit AS designs BGP synch HAS TO BE DISABLED on all BGP routers R(config-router)#distance bgp external internal local for AD setting, do not change default values transit backbone requires iBGP full mesh between all core routers 2 solutions for scalability: route reflectors and BGP confederations troubleshooting iBGP in Transit AS


to monitor: sh ip bgp neighbors sh ip bgp sh ip bgp sh ip bgp neighbor 10.2.3. .............................. , internal link sh ip bgp 12.2.3. .............................. ............................ , valid, internal, best common iBGP problems


iBGP sessions will not start iBGP route is in the BGP table but not selected iBGP route selected but not entered in the routing table *iBGP session does not start--> update-source keyword missing use debug ip tcp transactions to find and verify *iBGP session does not start--> loopback interfaces are not reachable