Course contents

Module 6: Troubleshooting and PracticeLesson 6.5 (5 of 6 in this module)42 of 43 in the BGP course

BGP cheat sheet

Which default, step or command do you need right now? Use this beside a lab, then go back to the linked lessons when a result needs more explanation.

Advanced · 6 min read

You'll learn to look up any BGP default, best-path step, neighbour state or command while you practise or revise.

Values are Cisco IOS XE defaults. Check your platform and release when a lab behaves differently.

Defaults and numbers

Defaults and numbers
Defaults and numbersItem; Value. Transport: TCP port 179 Administrative distance: eBGP 20 · iBGP 200 · locally originated 200 Keepalive / hold time: 60 s / 180 s; the lower hold time of the two peers is used LOCAL_PREF: 100 (iBGP only) Weight: 32768 for locally originated, 0 for learned MED: Missing MED counts as 0; compared only within the same neighbouring AS eBGP TTL: 1 (use ebgp-multihop or a directly connected address) iBGP next hop: Unchanged unless next-hop-self BGP scanner / next-hop trigger: Scanner every 60 s; next-hop tracking delay 5 s Dampening: Penalty 1000 per flap, half-life 15 min, suppress 2000, reuse 750, max suppress 60 min (eBGP only) maximum-prefix: Warning at 75 percent; session closed with Cease at the limit unless warning-only allowas-in: Default count 3 when no number is given Documentation AS: 64496 to 64511 · private 64512 to 65534 · AS_TRANS 23456ItemValueTransportTCP port 179Administrative distanceeBGP 20 · iBGP 200 · locally originated 200Keepalive / hold time60 s / 180 s; the lower hold time of the two peers is usedLOCAL_PREF100 (iBGP only)Weight32768 for locally originated, 0 for learnedMEDMissing MED counts as 0; compared only within the same neighbouring ASeBGP TTL1 (use ebgp-multihop or a directly connected address)iBGP next hopUnchanged unless next-hop-selfBGP scanner / next-hoptriggerScanner every 60 s; next-hop tracking delay 5 sDampeningPenalty 1000 per flap, half-life 15 min, suppress 2000, reuse 750, maxsuppress 60 min (eBGP only)maximum-prefixWarning at 75 percent; session closed with Cease at the limit unlesswarning-onlyallowas-inDefault count 3 when no number is givenDocumentation AS64496 to 64511 · private 64512 to 65534 · AS_TRANS 23456

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Each item on the left, with what it means on the right.

Best-path order

  1. Highest weight
  2. Highest LOCAL_PREF
  3. Locally originated
  4. Shortest AS_PATH
  5. Lowest ORIGIN (i, e, ?)
  6. Lowest MED
  7. eBGP over iBGP
  8. Lowest IGP metric to the next hop
  9. Oldest eBGP path, lowest router ID, shortest cluster list, lowest neighbour address

Steering traffic: which attribute for which goal

Steering traffic: which attribute for which goal
Steering traffic: which attribute for which goalGoal; Direction; Tool; Where. One router uses another exit: Out Weight That router, inbound Whole AS uses one exit: Out LOCAL_PREF Edge router, inbound route map Others prefer one ISP: In AS_PATH prepend Outbound route map to the other ISP One ISP prefers one link: In MED Outbound, same neighbouring AS only Use the provider's own policy: In Community Outbound plus send-community Split by destination block: In More-specific prefixes network or aggregate per ISPGoalDirectionToolWhereOne router usesanother exitOutWeightThat router, inboundWhole AS uses oneexitOutLOCAL_PREFEdge router, inboundroute mapOthers prefer oneISPInAS_PATH prependOutbound route map to theother ISPOne ISP prefersone linkInMEDOutbound, sameneighbouring AS onlyUse the provider'sown policyInCommunityOutbound plussend-communitySplit bydestination blockInMore-specific prefixesnetwork or aggregate perISP

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: the left box names the item, the others describe it.

AS-path regular expressions

AS-path regular expressions
AS-path regular expressionsPattern; Matches. ^$: Routes originated in your own AS (empty path) ^64501_: Learned from neighbour AS 64501 _64501$: Originated in AS 64501 _64501_: Passed through AS 64501 .*: Everything (use as the last permit)PatternMatches^$Routes originated in your own AS (empty path)^64501_Learned from neighbour AS 64501_64501$Originated in AS 64501_64501_Passed through AS 64501.*Everything (use as the last permit)

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Each item on the left, with what it means on the right.

Well-known communities and error codes

Well-known communities and error codes
Well-known communities and error codesItem; Meaning. no-export: Do not advertise outside the AS (or confederation) no-advertise: Do not advertise to any peer local-AS: Do not advertise outside the local sub-AS of a confederation NOTIFICATION 2/2: Bad peer AS NOTIFICATION 2/3: Bad BGP identifier (duplicate router ID) NOTIFICATION 4/0: Hold timer expired NOTIFICATION 6/1: Cease: maximum number of prefixes reachedItemMeaningno-exportDo not advertise outside the AS (or confederation)no-advertiseDo not advertise to any peerlocal-ASDo not advertise outside the local sub-AS of a confederationNOTIFICATION 2/2Bad peer ASNOTIFICATION 2/3Bad BGP identifier (duplicate router ID)NOTIFICATION 4/0Hold timer expiredNOTIFICATION 6/1Cease: maximum number of prefixes reached

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Each item on the left, with what it means on the right.

Neighbour states

Neighbour states
Neighbour statesState; Meaning; Stuck here usually means. Idle: Not trying to connect No route to the neighbour, shut neighbour, backoff after a failure Connect: Waiting for the TCP connection One-way TCP, ACL on port 179 Active: Trying to open TCP again Wrong address, no reachability, peer not configured OpenSent: OPEN sent, waiting for the peer's Capabilities or AS number mismatch OpenConfirm: OPEN received, waiting for KEEPALIVE Peer rejected something Established: UPDATEs flow Check policy, next hop and best pathStateMeaningStuck here usually meansIdleNot trying to connectNo route to the neighbour, shutneighbour, backoff after a failureConnectWaiting for the TCP connectionOne-way TCP, ACL on port 179ActiveTrying to open TCP againWrong address, no reachability, peernot configuredOpenSentOPEN sent, waiting for the peer'sCapabilities or AS number mismatchOpenConfirmOPEN received, waiting for KEEPALIVEPeer rejected somethingEstablishedUPDATEs flowCheck policy, next hop and best path

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: the left box names the item, the others describe it.

Policy and configuration

GoalCommand
Start BGP, set router IDrouter bgp 64500 · bgp router-id 1.1.1.1
eBGP neighbourneighbor 192.0.2.1 remote-as 64501 · activate
iBGP on loopbacksupdate-source Loopback0 · next-hop-self
Advertise a prefixnetwork 198.51.100.0 mask 255.255.255.0 (must exist in the table)
Prefer an exitroute-map set local-preference 200
Influence inboundset as-path prepend 64500 64500 · set metric
Filterprefix-list · filter-list · route-map with in or out
Apply policy without resetclear ip bgp X soft in · soft out
Route reflectorroute-reflector-client on the reflector
Group neighbourspeer-group · template peer-session · template peer-policy
Authentication, timersneighbor X password · neighbor X timers 20 60
Private ASremove-private-as all replace-as
Summariseaggregate-address 198.51.100.0 255.255.252.0 summary-only
Default to one neighbourneighbor X default-originate [route-map]
Limit what a neighbour sendsneighbor X maximum-prefix 1000 80
Only direct neighboursneighbor X ttl-security hops 1 (not with ebgp-multihop)
Own AS appears twiceallowas-in (receiver) · as-override (sender)
Dampeningbgp dampening 15 750 2000 60
Different neighbouring ASes, one MED rulebgp always-compare-med · bgp deterministic-med
VRF neighbouraddress-family ipv4 vrf NAME

Show commands

Show commands
Show commandsQuestion; Command. Are sessions up?: show ip bgp summary Why is a session down?: show ip bgp neighbors X · show logging Which attributes does this prefix have?: show ip bgp 203.0.113.0 What am I advertising?: show ip bgp neighbors X advertised-routes What did I accept?: show ip bgp neighbors X routes Which routes match this AS path?: show ip bgp regexp _64501$ Which routes are damped?: show ip bgp dampening dampened-paths Next-hop tracking defaults?: show running-config all | include nexthop trigger Why is it not installed?: show ip bgp rib-failure What does my policy do?: show route-map NAME · show ip prefix-listQuestionCommandAre sessions up?show ip bgp summaryWhy is a session down?show ip bgp neighbors X · show loggingWhich attributes does thisprefix have?show ip bgp 203.0.113.0What am I advertising?show ip bgp neighbors X advertised-routesWhat did I accept?show ip bgp neighbors X routesWhich routes match this ASpath?show ip bgp regexp _64501$Which routes are damped?show ip bgp dampening dampened-pathsNext-hop tracking defaults?show running-config all | include nexthop triggerWhy is it not installed?show ip bgp rib-failureWhat does my policy do?show route-map NAME · show ip prefix-list

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Each item on the left, with what it means on the right.

FAQ

Is this the whole syllabus?
No. It is a revision aid for the commands and defaults used in this course on Cisco IOS XE. The lessons give the reasons behind each line.