Professional Documents
Culture Documents
Introduction
This document contains frequently asked questions (FAQs) about Border Gateway Protocol
(BGP).
Q. How do I configure BGP with the use of a loopback address?A. The use of a loopback
interface ensures that the neighbor stays up and is not affected by
malfunctioning hardware.
BGP uses the IP address configured on the physical interface directly connected to the BGP
peer as the source address when it establishes the BGP peering session, by default. Issue the
neighbor <ip address> update−source <interface> command in order to change this
behavior and configure the BGP that speaks to the router to establish peering with the use of a
loopback address as the source address.
Refer to Sample Configuration for iBGP and eBGP With or Without a Loopback Address for
more information.
Q. What is the order of preference of attributes when some or all are
applied to one neighbor in BGP?
A. The order of preference varies based on whether the attributes are applied for inbound
updates or outbound updates.
For inbound updates the order of preference is:
route−map 1.
filter−list 2.
prefix−list, distribute−list 3.
For outbound updates the order of preference is:
prefix−list, distribute−list 1.
filter−list 2.
route−map 3.
Note: The attributes prefix−list and distribute−list are mutually exclusive, and only one command
(neighbor prefix−list or neighbor distribute−list) can be applied to each inbound
or outbound direction for a particular neighbor.
Q. What does a next hop of 0.0.0.0 mean in the show ip bgp command
output?
A. A network in the BGP table with a next hop address of 0.0.0.0 means that the network is
locally originated via redistribution of Interior Gateway Protocol (IGP) into BGP, or via a
network or aggregate command in the BGP configuration.
Q. What are the well known communities of the BGP community
attribute?
A. The community attribute is a transitive, optional attribute designed to group destinations in
a certain community and apply certain policies (such as accept, prefer, or redistribute). This
table shows the well known BGP communities.
Community Description
There are three most important keywords which we should have in mind while setting up BGP
neighbor relationship. Even sometimes when we have successful BGP relationship, we are not
able to see routes in the routing table. Following are the three important keywords.
1)ebgp-multihop :- In EBGP, neighbor relationships are only formed if we have directly
connected networks. We would require to use ebgp-multihop keyword with neighbor statement
so that neighbors which are not directly connected can form relationship with each other. We need
to specify a number with ebgp-multihop keyword, number can be between 1-255. This number
represents how many hop counts is the router away.
2)update-source. We need to specify the interface which will be used to update neighbor table
incase routers are not directly connected. Without update-source we will not be able to form BGP
neighbor relationships. update-source keyword will update the interface which will be used to
form neighbor relationship. see configuration example below for better understanding.
3) next-hop-self:- When ebgp relation replicates , next hop always changes.IBGP routers only
connected with other ibgp routers in same AS will not be able to talk with routers outside the AS,
if they are not directly connected with each other. We would require a next-hop-self keyword in
the ibgp router which is directly connected with ebgp neighbor so that other router in same AS
(IBGP) can talk with ebgp routers. Refer to configuration examples below:-
Lets assume that we have three routers and we have to setup a ebgp relationship in between
them. Router A ( AS :- 34 Serial0 192.168.1.1 , loopback0 1.1.1.1) , RouterB ( AS 34, loopback0
2.2.2.2 , Serial0 192.168.1.2 , Serial1 172.16.1.1), RouterC ( AS 400 , loopback0 3.3.3.3, Serial0
172.16.1.2)
Lets start configuring Router A
router BGP 34 –> As soon as we type 34 BGP process will start in the background
neighbor 192.168.1.2 remote-as 34 –> Bgp will know that this is IBGP looking at AS
Router B
router BGP 34
neighbor 192.168.1.1 remote-as 34
neighbor 172.16.1.2 remote-as 400 –> neighbor relationship with ebgp peer.
neighbor 3.3.3.3 remote-as 400
neighbor 3.3.3.3 ebgp-multihop 255 –> 255 is number of hops that neighbor is away. we can use
any number from 1-255, it can be more specific by using 1 or 2 but my personal fav is 255 as it
avoids confusion.
neighbor 3.3.3.3 update-source loopback 0 –> Here is the idea, when its sourcing the packets its
sourcing it from serial interface, we need to inform the otherside that source interface is not serial
interface, it is looback interface so that it cann match ip ip’s with the right interface and form
neighbor relationship.
we would require to do similar configuration on router c
router bgp 400
neighbor 172.16.1.1 remote-as 34
neighbor 2.2.2.2 remote-as 34
neighbor 2.2.2.2 ebgp-multihop 255
neighbor 2.2.2.2 update-source loopback 0
Now after forming the neighbro relationships we’ll use network commands to add neighbors in
routing table. Network command in BGP is bit different then Network command in other routing
protocols. we ‘ll need to define mask keywork with network command in order to advertise
clasless network where as if it is using a default mask we can ignore the same.
Example
Router C
router bgp 400
neighbor 172.16.1.0 mask 255.255.255.0
note:- i cannot use network 172.16.0.0 command without mask keyword as it will treat this as
class B network. For any customised subnetting scheme we ‘ll need to specify subnet mask with
mask keyword in network command.
Even after configuring above, Router A will not be able to talk with Router C. If we will use show
ip bgp command on Router A. we’ll see that it has a valid route for Router C but it will not be
able to ping router c. This is because next hop will be 3.3.3.3 which is not directly connected with
Router A. . First thing which will come in our mind is that rule of synchronisation has taken in to
effect but even after disabling synchronisation between router a and router B, Router C will not
be reachable. we would need a special command on Router B so that all IBGP peers of AS 34 can
talk with AS 400
To troubleshoot this we can use “debug ip bgp updates” but before using this debug we should
use ” clear ip bgp *” command. We’ll see that it will show us that there is no valid path for
networks in Router C. Next hop should be Router B but in the updates it will show next hp as
router c. to avoid the we will use next-hop self keyword in Router B.
Router B
router bgp 34
neighbor 192.168.1.1 next-hop-self
When Router B is sending an update to Router A it is sending the update without changging its
next hop so router A will receive next hop as Router C which is not directly connected. To avoid
this we will use next-hop-self command in Router B so that router A should receve valid route.