BGP Interview Questions
BGP Interview Questions
Contents
• Introduction
• Protocol Specifications
• Usage applications
• Session establishment
Route Process
• BGP routes injection process
Route Summarization
• Automatic summarization
• Outbound route filtering
• Filter with route maps
• Implementing changes in policy
BGP path attributes
• Mandatory well-known attributes
• Discretionary well-known attributes
• Nontransitive attributes
• Transitive attributes
Influencing route selection using weights
• Using weight
• Using local preference
• Autonomous system path prepending
• BGP multi exit discriminator (MED)
• Route reflectors
• Confederations
• Peer groups
• Network backdoor command
• Configure the BGP maximum-prefix function
• Route dampening
• Troubleshooting and monitoring BGP
Introduction
Border Gateway Protocol is an Exterior Gateway Protocol (EGP) used for routing between autonomous systems. It enables
routing policies and improves security.
• Reliable updates.
• Triggered updates only.
• Rich metric (Path attributes).
• Scalable to massive networks.
Protocol Specifications
http://packetlife.net/wiki/bgp/ Page 1
Supported protocols IPv4, IPv6
Transport TCP/179
Update mode Only triggered
Timers Hello (60 sec)
Authentication None, MD5
Specifications RFC 4271
Usage applications
Session establishment
BGP neighbors are not discovered; rather they must be configured manually on both sides of the connection. TCP port 179 is
used. Only one session remains if both connection attempts succeed. The show ip bgp summary command gives an overview of
the session status.
• Idle.
• Active.
• OpenSent.
• OpenConfirm.
• Established.
Keepalive are sent every 60 seconds. Peers can use MD5 shared secret.
Route Process
11 steps the route must pass for it to get a place in the routing table, first one match, all below are skipped, so the order is very
important.
The best routes (valid and reachable) are propagated to BGP neighbors.
The best BGP routes are copied into the IP routing table after the router checks administrative distance value.
http://packetlife.net/wiki/bgp/ Page 2
The BGP process injects local routes in two different ways:
• Using the Network configuration commands. This command lists networks that are candidates if they appear in the routing
table.
• Using redistribution from another routing protocol
Route Summarization
Automatic classful summarization is enabled by default (which is not preferable). When you disable automatic summarization, the
routes introduced locally into the BGP table are not summarized.
Automatic summarization
To disable automatic summarization, use the following router configuration command in the process level:
no auto-summary
To manually define a network for advertisement by BGP, use the following router configuration command in the process level:
Take into consideration that the network command reveals the actual subnet to advertise, not the interface participating in the
routing process like in all other routing protocols.
If you would like to modify attributes before inserting prefixes into the BGP table, you can use a route map in the network
command in router configuration mode in the process level:
Outbound route filtering (ORF) is a prefix-based BGP feature that is enabled through the advertisement of ORF capabilities to
peer routers. The advertisement of the ORF capability indicates that a BGP-speaking router can accept a prefix list from a neighbor
and apply the prefix list to locally configured ORFs (if any exist). When this capability is enabled, the BGP speaker can install an
inbound prefix list filter to the remote peer as an outbound filter, which reduces unwanted routing updates.
• Address family information (AFI) and subsequent address family information (SAFI) for which the filter should be used
• ORF type
• When to refresh (immediate of deferred refresh)
• List of ORF entries where the actual filter is defined
http://packetlife.net/wiki/bgp/ Page 3
An ORF type of NLRI-based filtering (type 1) uses the following actions:
To advertise ORF capability to a peer router, use the neighbor orf prefix-list command in addreess family or router configuration
mode:
Route maps are very powerful filtering tools, they can be used to accomplish the following tasks:
Match clauses in the BGP route map can be based on the following:
• Origin
• Next hop
• Weight
• Community
• Local preference
• MED
You can apply a route map on incoming or outgoing routing information for a neighbor. The routing information must be permitted
by the route map to be accepted. If the route map has no statement explicitly permitting a route, the route is implicitly denied and
dropped. The syntax required is as follows:
The show ip bgp route-map command displays selected routes from a BGP routing table based on the contents of a route map.
The traditional method of clear ip bgp * is disruptive. Soft reconfiguration was introduced in Cisco IOS 12.2 to facilitate
nondisruptive changes in BGP. When you configure soft-reconfiguration inbound for a neighbor, the router stores all routes
received from that neighbor as an extra copy in memory. This copy is taken before any filtering is applied by the router to routes it
receives. When you have completed the changes to filters and route maps that are applied on incoming information, use clear ip
bgp ip-address soft on the router in privileged EXEC mode.
http://packetlife.net/wiki/bgp/ Page 4
When you have completed the changes to filters and route maps that are applied on the outgoing information, execute
Route refresh is another new feature in the Cisco implementation of BGP. Routers use the route refresh feature to ask a neighbor
to resend all the routing information when needed. Use the clear ip bgp * command to send a route refresh message to all
neighbors or clear ip bgp ip-address to send a route refresh message to a specific neighbor.
• IGP
• EGP
• Unknown - Route was redistributed
AS-Path - Sequence of autonomous system numbers through which the route is accessible
Local Preference - Used for consistent routing policy with an autonomous system
Atomic Aggregate - Informs the neighbor autonomous system that the originating router aggregated routes
Nontransitive attributes
Multiexit Discriminator - Used to discriminate between multiple entry point into an autonomous system
Transitive attributes
Aggregator - IP address and autonomous system of the router that performed aggregation
Using weight
You can use weight to provide local routing policy, and you can use local preference to establish autonomous system-wide routing
policy.
To assign a weight to a neighbor connection, use the neighbor weight router configuration command:
This approach assigns a weight value to all route updates from the neighbor. Higher weights are preferred.
You can also configure the router so that all incoming routes that match an autonomous system filter receive the configured weight.
Use the following router configuration command to do so:
http://packetlife.net/wiki/bgp/ Page 5
You can also set weight with a route map in more complex scenarios.
The default weight value is 32,768 for locally originating networks (including those via redistributing) and is 0 for all other networks.
Local preference can be used to influence route selection within the local autonomous system; in fact, this attribute is stripped from
outgoing updates via eBGP. You should decide between the use of weight or local preference. The default local preference for
iBGP and local routes is 100; all other are 0 by default.
In networks where connections to multiple providers are required, it is difficult to specify a return path to be used for traffic returning
to the autonomous system. One BGP mechanism you can use is autonomous system path prepending. Autonomous system path
prepending potentially allows the customer to influence the route selection of its service providers.
You manipulate autonomous system paths by prepending autonomous system numbers to existing autonomous system paths.
Typically, you perform autonomous system path prepending on outgoing eBGP updates over the undesired return path. Because
the autonomous system paths sent over the undesired link become longer that the path sent over the preferred path. The
undesired link is now less likely to be used as a return path. To avoid conflicts number, except that of the sending autonomous
system, should be prepended to the autonomous system path attribute.
You can configure manual manipulation of the autonomous system path attribute (prepending) using a route map with the set
as-path prepend set clause.
You can apply the MED attribute on outgoing updates to a neighboring autonomous system to influence the route selection
process in that autonomous system. The MED attribute is useful only when you have multiple entry points into an autonomous
system.
The default value of the MED attribute is 0. A lower value of MED is more preferred. A router prefers a path with the smallest MED
value but only if weight, local preference, autonomous system path, and origin code are equal.
MED is not a mandatory attribute; no MED attribute is attached to a route by default. The only exception is if the router is
originating networks that have an exact match in the routing table (through the network command or through redistribution). In that
case, the router uses the metric in the routing table as the MED attribute value.
Using the default-metric command in BGP configuration mode causes all redistributed networks to have the specific MED value.
You can use a route map to set MED on incoming or outgoing updates. Use the set metric command within route map
configuration mode to set the MED attribute.
You must use the command bgp bestpath med confed when you use MED within a confederation to influence the route selection
process. A router compares MED values for those routes that originate in the confederation.
Route reflectors
BGP requires that all BGP peers in the same autonomous system form an iBGP session with all peers in the autonomous system.
This is too difficult in many environments. Route reflectors are fully functional iBGP speakers that form iBGP sessions with other
iBGP speakers, and they also perform a second function - they forward routes from other iBGP speakers to route reflector clients.
http://packetlife.net/wiki/bgp/ Page 6
The route reflector clients and clients form a cluster.
The command used to configure the cluster ID if the BGP cluster has redundant route reflectors is as follows:
The command used to configure the router as a BGP route reflector and configure the specified neighbor as its client is as follows:
Confederations
Confederations are another method of solving the iBGP full-mesh requirement. Confederations are smaller subautonomous
systems created within the primary autonomous system to decrease the number of BGP peer connections. Five steps are used in
the configuration of confederations:
Peer groups
To configure one router with multiple BGP peer relationships, configurations can be quite complex. Peer groups simplify the
configuration process. You make peer groups and assign neighbors with the same policies to the group. Peer group members
inherit the policies assigned to the group.
To configure the BGP peer group on Cisco IOS routers, you must complete the following steps:
• Create a BGP peer group; use the neighbor peer-group router configuration command
• Specify parameters for the BGP peer group
• Create a BGP neighbor
• Assign a neighbor to the peer group; use the neighbor peer-group router configuration command
The network backdoor router configuration command causes the administrative distance assigned to the network to be forced
200. The goal is to make IGP-learned routes preferred. A network that is marked as a backdoor is not sourced by the local router,
but should be learned from external neighbors. You should be sure to verify the route is inthe BGP table for the command to have
the desired effect.
http://packetlife.net/wiki/bgp/ Page 7
To control how many prefixes a BGP router can receive from a nighbor, use the neighbor maximum-prefix router configuration
command.
Route dampening
Flapping routes create problems for BGP. An approach was created to remove the update about a flapping route until it can be
guaranteed that the destination is more stable. This additional BGP scalability mechanism, called route flap dampening, was
created to reduce route update processing requirement by suppressing unstable routes.
http://packetlife.net/wiki/bgp/ Page 8