BGP Cheat Sheet
Border Gateway Protocol configuration and concepts
Basic BGP Configuration
router bgp [as-number]Enable BGP routing process
Example:
router bgp 65001neighbor [ip-address] remote-as [as-number]Configure BGP neighbor
Example:
neighbor 192.168.1.2 remote-as 65002network [network] mask [subnet-mask]Advertise network in BGP
Example:
network 10.0.0.0 mask 255.255.255.0redistribute [protocol]Redistribute routes into BGP
Example:
redistribute ospf 1BGP Verification Commands
show ip bgp summaryDisplay BGP neighbor summary
Example:
show ip bgp summaryshow ip bgp neighborsDisplay detailed BGP neighbor information
Example:
show ip bgp neighbors 192.168.1.2show ip bgpDisplay BGP routing table
Example:
show ip bgp 10.0.0.0/24show ip bgp pathsDisplay BGP path information
Example:
show ip bgp pathsBGP 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