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}
What is the command to redistribute routes from an iGP into BGP without any route filtering?
Router(config-router)# redistribute protocol-name [process-id]
NOTE: To redistribute from an IGP into BGP, this will be done in BGP configuration mode. When using address-families, it is done in the address-family config mode under the BGP process.
What is the command to redistribute routes from an iGP into BGP using a route-map to filter the routes?
Router(config-router)# redistribute protocol-name [process-id] subnets route-map RM-NAME
NOTE: To redistribute from an IGP into BGP, this will be done in BGP configuration mode. When using address-families, it is done in the address-family config mode under the BGP process.
What is the command to see a BGP rib-failure reason when seen in a routing table?
show bgp afi safi rib-failure
OR
show ip bgp rib-failure
When trying to configure an eBGP peer using loopback addresses, what two commands may be needed to ensure the default TTL for eBGP does not prevent peering?
Router(config-router)# neighbor ip-address disable-connect-check
Router(config-router)# neighbor ip-address ebgp-multihop 1-255
What is the command to create a Route Reflector?
Router(config-router-af)# neighbor ip-address route-reflector-client
NOTE: The command is done on the Route Reflector and in address-family config mode if applicable
What are the commands to put a router into a BGP confederation?
Router(config)# router bgp Member-AS-number
Router(config-router)# bgp confederation identifier Main-AS-Number
What command specifies the router will peer with another Member-AS other than its own?
Router(config-router)# bgp confederation peers Other-Member-AS
Hard reset a BGP session with a peer
Router# clear bgp ipv4 unicast neighbor-ip
Soft reset a BGP session with a peer
Router# clear bgp ipv4 unicast neighbor-ip [in | out | soft]
Show bgp routes that only include a specific AS in the AS Path
Router# show bgp ipv4 unicast regexp regex-expression
What is the command to create a Route Map?
Router(config)# route-map NAME {permit | deny} [sequence-num]
Inside a Route Map, match ip on a prefix-list
Router(config-route-map)# match ip address prefix-list NAME
Inside a Route Map, set the weight attribute
Router(config-route-map)# set weight value
Enable IPv6 on a router (before configuring BGP for IPv6)
Router(config)# ipv6 unicast-routing
Create an IPv6 neighbor (4 commands)
Router(config)# router bgp AS-number
Router(config-router)# neighbor ipv6-address remote-as AS-number
Router(config-router)# address-family ipv6 unicast
Router(config-router-af)# neighbor ipv6-address activate