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
HighestCisco proprietary, local to router
2. Local Preference
HigherPrefer path within AS
3. Locally Originated
LocalPrefer locally originated routes
4. AS Path
ShorterPrefer shorter AS path
5. Origin
IGPIGP > EGP > Incomplete
6. MED
LowerMulti-Exit Discriminator
7. eBGP over iBGP
eBGPExternal over internal BGP
8. Lowest IGP Metric
LowerClosest next-hop
BGP Neighbor States
Idle
Connect
Active
OpenSent
OpenConfirm
Established