BGP Cheat Sheet

Border Gateway Protocol configuration and concepts

Basic BGP Configuration

router bgp [as-number]

Enable BGP routing process

Example:router bgp 65001
neighbor [ip-address] remote-as [as-number]

Configure BGP neighbor

Example:neighbor 192.168.1.2 remote-as 65002
network [network] mask [subnet-mask]

Advertise network in BGP

Example:network 10.0.0.0 mask 255.255.255.0
redistribute [protocol]

Redistribute routes into BGP

Example:redistribute ospf 1

BGP Verification Commands

show ip bgp summary

Display BGP neighbor summary

Example:show ip bgp summary
show ip bgp neighbors

Display detailed BGP neighbor information

Example:show ip bgp neighbors 192.168.1.2
show ip bgp

Display BGP routing table

Example:show ip bgp 10.0.0.0/24
show ip bgp paths

Display BGP path information

Example:show ip bgp paths

BGP Path Selection Criteria

BGP uses the following criteria in order to select the best path:

1. Weight

Cisco proprietary, local to router

Highest
2. Local Preference

Prefer path within AS

Higher
3. Locally Originated

Prefer locally originated routes

Local
4. AS Path

Prefer shorter AS path

Shorter
5. Origin

IGP > EGP > Incomplete

IGP
6. MED

Multi-Exit Discriminator

Lower
7. eBGP over iBGP

External over internal BGP

eBGP
8. Lowest IGP Metric

Closest next-hop

Lower

BGP Neighbor States

Idle
Connect
Active
OpenSent
OpenConfirm
Established