1.11 Troubleshoot internal and external BGP, globally and in a VRF

ENARSI 300-410 v1.1 · 1.0 Layer 3 Technologies

BGP connects autonomous systems and carries enterprise policy. ENARSI troubleshoots iBGP and eBGP sessions (next hop, multihop, private and 4-byte AS numbers, peer groups, timers), the best-path algorithm, a route reflector, and inbound and outbound policy, for IPv4 and IPv6 and inside VRFs.

What you must know

Address families and VRFs

router bgp 65001
 bgp router-id 1.1.1.1
 no bgp default ipv4-unicast
 neighbor 10.0.12.2 remote-as 65002
 neighbor 2001:DB8:12::2 remote-as 65002
 address-family ipv4 unicast
  neighbor 10.0.12.2 activate
  network 10.1.0.0 mask 255.255.0.0
 address-family ipv6 unicast
  neighbor 2001:DB8:12::2 activate
  network 2001:DB8:1::/48
 address-family ipv4 vrf RED
  neighbor 10.0.99.2 remote-as 65099
  neighbor 10.0.99.2 activate

A neighbour only exchanges the families it is activated in. With no bgp default ipv4-unicast, nothing is activated by default. IPv6 prefixes can also ride an IPv4 session, but then the next hop is an IPv4-mapped address and must be fixed with a route map; peering over IPv6 for IPv6 is simpler. A VRF address family needs an rd in the VRF definition.

Neighbours

! R1
router bgp 65001
 neighbor 192.0.2.1 remote-as 65002
 neighbor 2.2.2.2 remote-as 65001
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 2.2.2.2 next-hop-self

R2# show ip bgp summary
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4 65001      14      12        9    0    0 00:08:02        5
SymptomCause
Idle / Active foreverNo route to the peer address, wrong remote-as, ACL dropping TCP 179, or the peer sources from another address
eBGP to a loopback stays IdleTTL 1: add ebgp-multihop 2 (or disable-connected-check) and update-source
Routes received but not best (no >)Next hop unreachable: missing next-hop-self on the iBGP edge, or the IGP lacks the external link
Session up, then drops every 3 minutesHold timer mismatch is negotiated (the lower wins); look for MTU or ACL issues on updates
% BGP: Bad remote-asThe peer's AS differs, or it uses a 4-byte AS (asdot 1.10 = 65546) you typed in the other notation

R2 can use the ISP routes (1) only because R1 rewrites the next hop. Private AS numbers (64512–65534, 4200000000–4294967294) are removed toward the ISP with remove-private-as. Route refresh (clear ip bgp * soft) asks the peer to resend after a policy change without resetting. Peer groups and peer templates share configuration between neighbours; members of a peer group share outbound policy.

Best-path order

  1. Next hop reachable (otherwise the path is never considered).
  2. Highest weight (Cisco, local to the router).
  3. Highest local preference (default 100, shared in the AS).
  4. Locally originated (network, aggregate, redistribute).
  5. Shortest AS path.
  6. Lowest origin: IGP (i) < EGP (e) < incomplete (?).
  7. Lowest MED (only compared between paths from the same neighbouring AS by default).
  8. eBGP over iBGP.
  9. Lowest IGP metric to the next hop.
  10. Oldest eBGP path, then lowest router ID, then lowest neighbour address.
R1# show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 12
Paths: (2 available, best #2, table default)
  65003 65010
    10.0.13.3 from 10.0.13.3 (3.3.3.3)
      Origin IGP, localpref 100, valid, external
  65002 65010
    192.0.2.1 from 192.0.2.1 (192.0.2.1)
      Origin IGP, localpref 200, valid, external, best

A single route reflector

iBGP does not pass a route learned from one iBGP peer to another (iBGP split horizon), so normally every router needs a session with every other. A route reflector relaxes that: it reflects routes from a client to all other clients and non-clients. Only the RR needs configuration: neighbor 10.0.0.3 route-reflector-client. To prevent loops, the RR adds ORIGINATOR_ID (the RID that first sent it) and CLUSTER_LIST; a router drops a route carrying its own RID or cluster ID.

Filtering and path manipulation

GoalToolDirection
Prefer one exit for the whole ASset local-preference 200Inbound, on the preferred edge
Prefer one exit on one routerneighbor X weight 200 or set weightInbound
Make others send traffic to you over one linkset as-path prepend 65001 65001 on the other linkOutbound
Hint to a neighbouring ASset metric 50 (MED)Outbound
Accept only some prefixesneighbor X prefix-list P inInbound
Filter by ASip as-path access-list 1 permit ^65002$ + filter-list 1 inEither
Mark and act on groups of routesset community 65001:100 + send-community; match communityEither
ip as-path access-list 10 permit ^$          ! only routes we originate
router bgp 65001
 neighbor 192.0.2.1 filter-list 10 out        ! never become transit

After changing inbound policy, run clear ip bgp <peer> soft in; the new policy applies only to updates received after the change.

Commands

show ip bgp summary / show bgp ipv6 unicast summarySessions, state and prefixes received.
show ip bgp <prefix>Every path with its attributes and which is best.
show ip bgp neighbors <ip> [advertised-routes | received-routes]Session details and what is sent or received.
show ip bgp vpnv4 vrf <name> / show bgp vrf <name>A VRF's BGP table.
clear ip bgp <peer> soft [in|out]Re-apply policy without resetting the session.
show ip bgp regexp ^65002_Paths whose AS path matches a regex.

Exam traps

Check yourself

Two paths: weight 0/LP 200 and weight 100/LP 100. Which wins?
Weight 100: weight is checked before local preference.
R2 receives a route from iBGP but it has no >. First check?
Is the next hop reachable? Usually next-hop-self is missing on the edge router.
What does a route reflector add to stop loops?
ORIGINATOR_ID and CLUSTER_LIST.
How do you make the Internet prefer your link through ISP A?
Prepend your AS on the advertisements to ISP B (outbound), or send a lower MED to the same ISP.
What AS path regex matches only your own routes?
^$

Labs

Try it live: iBGP over loopbacks: a peer group, a route reflector, next-hop-self and eBGP multihop

More topics in 1.0 Layer 3 Technologies