BGP Commands Flashcards
Including Route-Maps, Prefix-Lists, Dist-Lists, and Community-Lists
Command to initialize the BGP Process?
Router(config)# router bgp as-number
Identify a BGP peer to establish a neighbor session
Router(config-router)# neighbor ip-address remote-as AS-number
Disable the automatic ipv4 address-family configuration mode in BGP.
Router(config-router)# no bgp default ipv4-unicast
Initialize a specific address-family and sub-address family configuration mode
Router(config-router)# address-family afi safi
Example:
Router(config-router)# address-family ipv6 unicast
Router(config-router-af)#
Make a BGP neighbor active for a specific address-family
Router(config-router-af)# neighbor ip-address activate
Note: from address-family configuration mode.
Advertise a network to BGP
Router(config-router)# network network mask subnet-mask [route-map route-map-name]
Example: Router(config-router)# network 10.9.8.0 mask 255.255.255.0 route-map RM_BGP_ROUTES
Configure a BGP aggregate IPv4 prefix (summary)
Router(config-router-af)# aggregate-address network subnet-mask [summary-only] [as-set]
Example: Router(config-router)# aggregate-address 10.9.8.0 255.255.255.0 summary-only as-set
NOTE: If bgp default ipv4-unicast is disabled, this is done in address-family config mode
Configure a BGP aggregate IPv6 prefix (summary)
Router(config-router-af)# aggregate-address prefix/prefix-length [summary-only] [as-set]
Example: Router(config-router)# aggregate-address 2001:db8:23:a/64 summary-only as-set
Display the contents of the BGP database
Router# show bgp afi safi [network] [detailed]
Example: Router# show bgp ipv4 unicast 10.9.8.0 detailed
Display a summary of the BGP table and neighbor peering sessions
Router# show bgp afi safi summary
Example: Router# show bgp ipv4 unicast summary
Display the negotiated BGP settings for a specified peer and the number of prefixes exchanged with that peer.
Router# show bgp afi safi neighbors ip-address
Example: Router# show bgp ipv4 unicast neighbors 10.4.4.1
Display the Adj-RIB-Out BGP table for a specific BGP neighbor
Router# show bgp afi safi neighbors ip-address advertised-routes
Example: Router# show bgp ipv4 unicast neighbors 10.4.4.1 advertised routes
What command is used on a BGP router to see the BGP peering state?
show tcp brief
What command might you need to ensure that an iBGP neighbor a reachable next hop address so the route will get installed to the Global routing table?
Router(config-router)# neighbor ip-address next-hop-self
NOTE: This is configured in address-family mode when bgp default ipv4-unicast is disabled
What command shows the BGP routing table?
show bgp afi safi
Example: show bgp ipv4 unicast
What command would you use to ‘reset’ all bgp neighbors? Why do you need to be careful about using that command?
Router# clear ip bgp *
This command will break all connections to BGP peers until the neighbor states are reestablished.
What is the command you would use to see all the routes being sent out from the router you are on?
show bgp AFI SAFI neighbors ip-address advertised-routes
For iBGP, when configuring neighbors using loopback addresses, what additional command is needed?
Router(config-router)# neighbor ip-address update-source loopback-#
Example: Router(config-router)# neighbor 5.5.5.5 update-source loopback0
What is the command to create a route map? (Include the common options)
Router(config)# route-map NAME [permit | deny] [sequence-number]
NOTE: Best practice is to start sequence numbers at 10 and increase by increments of 10 similar to an access-list.
What is the command to create an AS-Path Access List?
Router(config)# ip as-path access-list number {permit | deny} regular-expression-string
What is the command to create a prefix-list?
Router(config)# {ip | ipv6} prefix-list NAME [seq sequence-num] {permit | deny} network-address/netmask [ge value] [le value]
Example: ip prefix-list deny FILTER_1 seq 10 deny 1.1.1.0/24 ge 32
What is the command to create a BGP community-list for the purpose of conditional route matching?
Router(config)# ip community-list {1-500 | standard list-name | expanded list-name} {permit | deny} community-pattern
From route-map config mode, what is the command to match on a BGP AS-Path?
Router(config-route-map)# match as-path acl-number
From route-map config mode, what is the command to match on IP addresses that was set in an ACL?
Router(config-route-map)# match ip address {acl-number | acl-name}