BGP Questions and Answers Vol 1.0
BGP Questions and Answers Vol 1.0
Ques 3. What is the difference between eBGP multihop and ttl security?
Below is the difference between eBGP Multihop and TTL Security -
Ques 4. Which protocol and port number does BGP use for neighborship?
BPG uses TCP protocol and port number 179 for forming neighborship.
Below is the configuration configure BGP with the use of a loopback address -
R1 Configuration -
Interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
Interface FastEthernet0
ip address 10.0.0.0.1 255.255.255.0
!
router bgp 100
neighbor 2.2.2.2 remote-as 200
neighbor 2.2.2.2 update-source Loopback0 >>>>>> this command specifies that the TCP
connection with BGP peer should be established using loopback interface.
!
ip route 2.2.2.2 255.255.255.255 10.0.0.2 >>>>>> Static Route for reachability to remote
BGP peer
End
R2 configuration -
Interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
Interface FastEthernet0
ip address 10.0.0.0.2 255.255.255.0
!
router bgp 200
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback0 >>>>>> This command specifies that the TCP
connection with BGP peer should be established using loopback interface.
!
ip route 1.1.1.1 255.255.255.255 10.0.0.2 >>>>>> Static Route for reachability to remote
BGP peer
End
Ques 8. What is the order of preference of attributes when applied to one neighbor in BGP?
BGP works through these attributes in this specific order when choosing a path -
Highest weight (This is a cisco proprietary value)
Highest LOCAL_PREF
Prefer a route that is locally sourced
Shortest AS_PATH
ORIGIN
Lowest MED
External BGP routes are preferred over internal BGP routes
If no external route select path with the lowest IGP cost to the next hop router for
IBGP.
The most recent route
The lowest BGP router ID.
Ques 9. What does a next hop of 0.0.0.0 mean in the show ip bgp command output?
A network output in the BGP table with a next hop address of 0.0.0.0 means that either
network is locally originated via redistribution of Interior Gateway Protocol (IGP) into BGP,
or via a network or aggregate command in the BGP configuration.
Ques 10. What are the well-known communities of the BGP community attribute?
Below are well known BGP community attributes -
Ques 11. How does BGP behave differently with auto-summary enabled or disabled?
In the latest Cisco IOS releases, auto-summary is disabled by default. When auto-summary is
enabled, it summarizes the locally originated BGP networks to their classful boundaries.
Auto-summary is disabled, the routes introduced locally into the BGP table are not
summarized to their classful boundaries.
Ques 12. What formats can I use to configure the BGP community attribute?
In latest releases of Cisco IOS (12.0 onwards), we can configure communities in 3different
formats –
Decimal format
Hexadecimal format
AA:NN format
By default, Cisco IOS uses the older decimal format. In order to configure in AA: NN, where
the first part is the AS number and the second part is a 2-byte number, issue the “ip bgp-
community new-format” in global configuration.
Ques 13. How can I verify if a BGP router announces its BGP networks and propagates them
to the global BGP mesh?
Below are the commands to verify the IP blocks are announced to BGP neighbors ISP:
“show ip bgp neighbors [address] advertised-routes” for sent networks
“show ip bgp neighbors [address] routes” for received networks
Ques 15. Is there any special configuration needed on PIX/ASA to allow BGP sessions through
it?
Below diagram will be referred to while showing the step by step configuration required on
ASA/PIX to allow BGP sessions through it -
Step 1 – (Configure access list to allow TCP port 179 / BGP as below –
access-list BGP-NEIGHBOR extended permit tcp host 192.168.10.1 host 192.168.20.1 eq 179
access-list BGP-NEIGHBOR extended permit tcp host 192.168.20.1 host 192.168.10.1 eq 179
Step 3 – (Create a class map to match the BGP Traffic using the ACL above)
class-map BGP-CLASS
match access-list BGP-NEIGHBOR
Entry #1 – AS_PATH 300 100, MED 150, external, NEXT_HOP 4.4.4.4, RID 4.4.4.4
Entry #2 – AS_PATH 200 100, MED 200, external, NEXT_HOP 2.2.2.2, RID 2.2.2.2
Entry #3 – AS_PATH 300 100, MED 100, internal, NEXT_HOP 3.3.3.3, RID 3.3.3.3
Ques 19. Do internal i.e. iBGP sessions modify the next hop?
Internal BGP i.e. iBGP preserves the next hop attribute learned from eBGP peers.
This means we are required to enforce the iBGP router to advertise itself as next hop and
not the external BGP peer.
In order to make sure we can reach the eBGP next hop, following are the options –
Include the network that the next hop belongs to in the IGP or
Issue the next-hop-self neighbor command
The BGP route is otherwise unreachable.
Ques 20. Do external BGP (eBGP) sessions modify the next hop?
Yes, Routes advertised to eBGP peers will have Next-Hop attribute changed to eBGP routers
IP address.
Ques 21. Do external BGP (eBGP) sessions between confederations modify the next hop?
No, eBGP sessions between confederation AS do not modify the next hop attribute.
Ques 22. In external BGP (eBGP) sessions, which IP address is sent as the next hop?
In eBGP peering, the next hop is the IP address of the neighbor that announces the route.
Ques 23. Does the route reflector change the next hop attribute of a reflected prefix?
By default, the next hop attribute is not changed when a prefix is reflected by route
reflector.
Ques 24. How can I announce a prefix conditionally to one ISP only when I lose the connection
to my primary ISP?
BGP advertises routes from its BGP table to external peers by default. The BGP conditional
advertisement feature provides additional control of route advertisement depending on the
existence of other prefixes in the BGP table. Normally, routes are propagated regardless of
the existence of a different path. The BGP conditional advertisement feature uses the non-
exist-map and advertise-map configuration commands to track routes by the route prefix. If
a route prefix is not present in the non-exist-map command, the route specified by the
advertise-map command is announced.
Ques 25. How can I configure BGP to provide load sharing and redundancy in my network?
Below are the choices in BGP while load sharing in the network –
a) When equal cost multiple links between eBGP neighbors
- Using static routing for Loopback Address as a BGP Neighbor.
b) When Dual-Homed to One Internet Service Provider (ISP) Through a Single Local
Router
- Using maximum-paths command
c) Load Sharing When Dual-Homed to One ISP Through Multiple Local Routers
- Using as-path prepend
d) Load Sharing When Multihomed to Two ISPs Through a Single Local Router
- Using weight and selective prefix receive/advertisement
- Using Local preference and as-path prepend
Detailed usage of BGP attributes to perform Load Sharing and redundancy is shared in below
link -
https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13762-
40.html
Ques 26. How much memory should I have in my router to receive the complete BGP routing
table from my ISP?
Cisco recommendation is to have a minimum of 512 MB of RAM in the router to store a
complete global BGP routing table from one BGP peer.
Ques 27. What are the benefits of configuring BGP peer groups?
Below are the key benefits which can be reaped out from BGP peer groups –
Reduction of the resource of BGP devices when it makes the updates to the BGP
neighbors.
Reduction in amount of configuration which is requires to be done on BGP enabled
device.
Configuration becomes simple and easy
Ques 28. Why do I see the same route twice from the same peer in BGP?
Two entries are seen due to soft-reconfiguration configured. Both the unmodified path and
the modified path, which depends on the inbound policy, if permitted, are stored in the path
table for the prefix.
Ques 29. What is synchronization, and how does it influence BGP routes installed in the IP
routing table?
If your AS passes traffic from another AS to a third AS, BGP should not advertise a route
before all routers in your AS learn about the route via IGP. BGP waits until IGP propagates
the route within the AS and then advertises it to external peers. A BGP router with
synchronization enabled does not install iBGP learned routes into its routing table if it is not
able to validate those routes in its IGP.
BGP synchronization rule - Do not advertise a route learned from IBGP to an external
neighbor unless a matching route is learned from an IGP. This was an old rule. However,
with newer Cisco IOS 12.2(8)T and later, this feature is off by default.
Ques 30. How do I know which Cisco IOS software release supports a particular BGP feature?
Use Software Research (registered customers only) in order to quickly find which Cisco IOS
software release supports your feature.
Link to “Software Research” is - https://software.cisco.com/selection/research.html
Ques 31. How can I set the Multi Exit Discriminator (MED) value on prefixes advertised to
external BGP (eBGP) neighbors to match the Interior Gateway Protocol (IGP) next hop metric?
The set metric-type internal route-map configuration command causes BGP to advertise a
MED that corresponds to the IGP metric associated with the next hop of the route.
Ques 33. What does r RIB-Failure mean in the show ip bgp command output?
RIB-Faliure in “show ip bgp” command may be due to one of the below reasons -
Route with better administrative distance already present in IGP. For example, if a
static route already exists in IP Routing table.
Memory failure.
The number of routes in VPN routing/forwarding (VRF) exceeds the route-limit
configured under the VRF instance.
Ques 34. How can I redistribute internal BGP (iBGP) learned default-route (0.0.0.0/0) route
into EIGRP/OSPF/IS-IS?
By default, iBGP redistribution into IGP is disabled. Issue the bgp redistribute-internal
command in order to enable redistribution of iBGP routes into IGP. A sample configuration
for redistributing a iBGP learned default route 0.0.0.0/0 into EIGRP is shown in this output.
Configurations for OSPF/IS-IS are similar.
router bgp 65200
bgp redistribute-internal
!
router eigrp 200
redistribute bgp 65200 route-map DEFAULT
!
ip prefix-list default-route seq 5 permit 0.0.0.0/0
!
route-map DEFAULT permit 10
match ip address prefix-list default-route
Ques 35. How can I filter all IP routes advertised to a BGP neighbor except the default route
0.0.0.0/0?
The specific routes can be filtered if you use inbound filter-list, distribute-list, prefix-list and
route-map all at the same time for the same bgp neighbor. This is the order of operation:
Filter-list
Router-map
Distribute-list (or) prefix-list
Ques 36. Is it possible to track an interface and change the route availability?
Yes, it is possible to track the state change of an interface and route availability with the
Enhanced Object tracking.
Ques 37. How does IP RIB Update allocate memory?
IP RIB Update allocates the prefixes, and attributes are held in chunks. It is not possible to
free the entire chunk until every element in the chunk is freed. If more routes are learned,
then those free elements in the chunks are used.
Ques 39. Why are there no statistic results when I use the debug bfd events and debug bfd
packets commands?
It is the normal behaviour, as bfd hellos are sent in sub minimal seconds and in case you run
debugs for that, the router cannot handle. So the bfd messages are seen in debug only when
flaps happens.
Ques 41. Difference between hard reset and soft reset in BGP?
Below table details on difference between hard reset and Soft reset in BGP –
OPEN Message -
Open messages are used to start a BGP session by requesting that a BGP session be opened over
an existing TCP/IP session. Once two BGP routers have completed a TCP 3-way handshake they
will attempt to establish a BGP session, this is done using open messages. In the open message
information about BGP router will be available. Routers use this message to identify itself and to
specify its BGP operational parameters. Open message is always send when the TCP session is
established between neighbors.
KEEPALIVE Message -
If a router accepts the parameters specified in Open message, it responds Keepalive. By default
Cisco sends keepalive every 60 sec or a period equal to 1/3 the hold time.
UPDATE Message -
Advertises feasible routes, withdrawn routes or both.
NOTOFICATION Message -
This message is sent whenever something bad has happened, e.g. an error is detected and
causes the BGP connection to close.
Connect State:
BGP waits for a TCP connection to be completed. If successful, the BGP state machine moves into
OpenSent state after sending the OPEN message to the peer. Failure in this state could result in
either going into Active state or Connect state, or reverting back to idle state, depending on the
failure reasons.
Ques 45. What are values of keepalive and Dead timers in BGP?
Keepalive - 60 seconds
Hold-down - 180 seconds (3 multiplied by Keepalive)
Ques 46. How many public and private AS numbers are there?
Public AS Numbers - Range from 1 to 64511
Private AS Numbers - Range from 64512 to 65535
Ques 48. Does the router have to be restarted after a new BGP Neighbor Maximum Prefix is
configured?
If the new maximum number of Prefixes is larger that the current maximum, there is no need to
soft/hard clear the BGP session, and reload is not required.
Ques 49. Is there a command to check the advertised routes along with the prepend of the
AS-paths?
Below are the options to verify -
Check the BGP AS PATH Attribute on Peering device. This is one of the easiest ways to
check whether the router performs AS PATH prepending or not.
Run debug on BGP updates (in outbound direction) and then check for prepends. Use an
access-list while you debug BGP updates.
Another option would be to take a packet capture on exit interface and see what update
is being sent on the wire.
Ques 51. What does the %IPRT-3-ROUTEINSERTERROR: Error inserting routing entry error
message mean?
This error message indicates that there is not enough memory to accommodate BGP
prefixes, learnt from neighbors.
Ques 52. What is the difference between when a route is injected in BGP via redistribute
command or a network command?
When you use the redistribution of IGP into BGP to advertise the route, then there is no
need to specify the network statement for all the subnets individually. Also when the route
is obtained from any other routing protocols into BGP table by redistribution, the
Origin attribute is Incomplete (?)
When you specify the network command then it is Internal/IGP (i).
Ques 57. Why is there a problem with iBGP in large networks? How can this problem be
solved?
There must be a full mesh of iBGP sessions, in other words: each BGP router within an AS
must have iBGP sessions with all other BGP routers in the AS. By requiring that all
information in iBGP is learned directly from the router that learned the information over
eBGP, there can't be any loops in iBGP. The full mesh requirement can be solved using either
route reflectors or confederations.
Route reflectors distribute iBGP information from one router to another, which is normally
not allowed in iBGP. Since the clients of the route reflector get all iBGP from the route
reflector they don't need to have iBGP sessions with all other BGP routers. Reflectors add
additional path attributes that allow them to detect and eliminate loops.
In Confederation, the AS is split into a number of sub-ASes, so the iBGP full mesh is done
within each sub-AS and a modified version of eBGP is used between sub-ASes. To the
outside, the confederation behaves like a single AS
Ques 58. Name BGP path attributes to control incoming and outgoing traffic
Inbound Traffic Flow can be influenced by manipulating the following attributes -
AS-Path Prepending
MED
Outbound Traffic Flow can be influenced by manipulating the following attributes -
Weight
Local Preference
Ques 59. My BGP is showing 0.0.0.0 as router-id; what could be the possible reason?
BGP Router-ID of 0.0.0.0 is set when below 3 conditions of assigning Router-ID fail -
Use the address configured by the BGP router-id command
Use the Loopback interface address with the highest IP address
Use the highest IP address of the interface
Ques 60. If my BGP neighbor is stuck in idle or active state, what should I do?
The reason for BGP neighbor stuck in idle or active state are –
Wrong AS Configured
Misconfigured Local IP or Per IP address
Authentication issues
TCP port 179 allowed across the peers
Multihop and peer TTL misconfigurations
Usually, there are configuration issues that stop the BGP connection from getting
established. It can be a wrong AS, misconfigured local IP / peer IP address, authentication
issues, and others.
SoO Rule of Operation: SoO is applied on updates coming to PE1 from CE router and when
these routes are advertised as VPNV4 route to PE router PE2, the PE2 router doesn’t
advertise the routes back to the CE router hence avoiding the routing loop.
Further, below link showcases scenario (1) SoO not applied (2) SoO applied
https://ipwithease.com/soo-site-of-origin-bgp-extended-community-attribute/
Ques 62. What do you understand by BGP split-horizon rule?
The BGP split-horizon rule governs the route advertisements between IBGP peers, which
specifies that routes learn via IBGP are never propagated to other IBGP peers.
The BGP split-horizon rule prevents R2 from propagating routes learned from R1 to RT3.
Similar to the split-horizon rule in the distance-vector routing protocols, BGP split-horizon is
necessary to ensure that routing loops are not started within an AS. As a result, full-mesh
IBGP peering is required within an AS for all the routers within the AS to learn about the BGP
routes.
BGP has default 4 well known communities that can be used to mark prefixes; listed as
follows:
Internet: advertise these routes to all neighbors.
Local-as: prevent sending routes outside the local AS within the confederation.
No-Advertise: do not advertise this route to any peer, internal or external.
No-Export: do not advertise this route to external BGP peers.
Ques 69. In Multihoming scenario if primary link gets fail, after how long traffic will be shifted
to secondary link.
By default, fast external failover is enabled for eBGP neighbor. So when the egress interface
fails, it immediately bring down the BGP session and next best path will be selected. If you
have it disabled, it will rely on the BGP hold timer.
Ques 76. Can we use local preference outside the autonomous system?
No, since Local preference has local significance. Further, Local preference is not attached to
eBGP updates, only to iBGP updates.
What could be the probable reason for this error log? What is mitigation approach?
Reason for error message – “On Router R2, BGP AS number 20 is configured instead of AS 2.”
Ques 79. What will the BGP first check to see if a prefix is accessible?
To see if a prefix is accessible, 1st check BGP does is whether Next Hop Router is reachable.
Ques 80. What are the two methods for reducing the number of IBGP connection in a
network?
2 methods of reducing number of iBGP connections are –
Route Reflectors
BGP Confederation
Ques 84. Two BGP peers connected through a routed firewall are unable to establish a
peering relationship. What could be the most likely cause?
Primary reason is that EBGP multihop is not configured between the 2 BGP peers.
Ques 85. What is the order of preference of attributes (route-map, filter-list, prefix-list,
distribute-list ) when some or all are applied to one neighbor in BGP? Kindly share for inbound
updates ?
This is the order of operation:
Route map
Filter list
IP prefix list
Distribute list
Ques 86. What is the order of preference of attributes (route-map, filter-list ,prefix-list,
distribute-list ) when some or all are applied to one neighbor in BGP? Kindly share for outbound
updates?
This is the order of operation:
Distribute list
IP prefix list
Filter list
Route map
Ques 87. How can I verify if a BGP router announces its BGP networks and propagates them?
Use below commands in order to check if the IPprefix are announced to the directly
connected BGP neighbor -
“show ip bgp neighbors [address] advertised-routes” command shows which
messages are being sent.
“show ip bgp neighbors [address] routes” command shows which messages are
being received.
Ques 88. Does the route reflector change the next hop attribute of a reflected prefix?
By default, the next hop attribute is not changed when a prefix is reflected by route
reflector. However, you can issue the neighbor next-hop-self command in order to change
the attribute of the next hop for prefixes reflected from an eBGP peer to any route reflector
client.
Ques 89. How much of minimal RAM is required to learn complete BGP routing table from
one BGP peer?
Cisco typically recommends a minimum of 512 MB of RAM in the router to store a complete
global BGP routing table from one BGP peer.
Ques 90. What are the benefits of configuring BGP peer groups?
Below are the key benefits which can be reaped out from BGP peer groups –
Reduction of the resource of BGP devices when it makes the updates to the BGP
neighbors.
Reduction in amount of configuration which is requires to be done on BGP enabled
device.
Configuration becomes simple and easy
Ques 92. What is the version of BGP that first supported CIDR?
In the BGP the current versions i.e. BGP-4 version supports CIDR.
Ques 93. In the global routing table, can the same AS number show up more than once in a
path.
Yes, this is pretty much possible. This happens because some AS inject their AS number in the
path more than once. However, when AS Path Prepending is not used across AS, every AS
number will only show up once, since same AS can’t because BGP doesn't allow looping AS
paths.
Ques 95. What is the cost of external and internal BGP routes?
eBGP (External) = 20
iBGP (Internal) = 200
Ques 96. Which parameters and attributes have to be equal before MED is compared to
select the best path?
Below attributes need to be equal before MED is compared -
WEIGHT
LOCAL_PREF
AS_PATH
Origin
Ques 98. In general which routes will affect by route dampening? eBGP or iBGP?
The main functionality is to stop the rippling effect of route updates or withdraws. It only
applies to routes learn with eBGP.
Ques 100. How do I debug routes for a particular vrf in the Cisco IOS-XR environment?
Use the debug bgp keepalive [vrf [vrf-name | all]] vpnv4 unicast command in order to
debug routes for a given vrf in the Cisco IOS-XR environment.