12-23-2011 07:46 PM - edited 03-04-2019 02:44 PM
Hi everybody
Please consider the following scenario:
In the above scenario, BGP is being used between AS 2 and AS1
R1 and R2 are in AS2, while R4 is AS 1
R1 and R2 are running BGP and RIP
R4 has loopback 10.0.0.0/8 which is being advertised to R1 and R2 in AS 2
When I issue " show ip bgp" on R1, I get the following output:
R1#show ip bgp
BGP table version is 2, local router ID is 199.199.199.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* i10.0.0.0 200.200.200.4 0 100 0 1 i
*> 199.199.199.4 0 0 1 i
R1#
10.0.0.0 route has " .>" missing.
When I issue " Show ip bgp 10.0.0.0" on R1 ,I get the following output:
R1#show ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 2
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
2
1
200.200.200.4 (metric 1) from 198.198.198.2 (200.200.200.2)
Origin IGP, metric 0, localpref 100, valid, internal
1
199.199.199.4 from 199.199.199.4 (10.10.10.4)
Origin IGP, metric 0, localpref 100, valid, external, best
The above output indicates there are two best routes to reach 10.0.0.0. If there are two best path available to reach 10.0.0.0 from R1,why Prefix 10.0.0.0 has " >" missing in the output of" show ip bgp" on R1.
===================================================
Configurations are given below:
R1#show running-config
Building configuration...
Current configuration : 1169 bytes
version 12.4
hostname R1
no aaa new-model
memory-size iomem 5
ip cef
no ip domain lookup
ip auth-proxy max-nodata-conns 3
-
interface Serial0/0
ip address 198.198.198.1 255.255.255.0
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
ip address 199.199.199.1 255.255.255.0
clock rate 2000000
!
router rip
network 198.198.198.0
network 199.199.199.0
!
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor 198.198.198.2 remote-as 2
neighbor 199.199.199.4 remote-as 1
no auto-summary
R1#show ip route
Gateway of last resort is not set
R 200.200.200.0/24 [120/1] via 198.198.198.2, 00:00:27, Serial0/0
C 198.198.198.0/24 is directly connected, Serial0/0
C 199.199.199.0/24 is directly connected, Serial0/1
B 10.0.0.0/8 [20/0] via 199.199.199.4, 00:31:52
========================================
R2# show running-config
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
hostname R2
boot-start-marker
boot-end-marker
no aaa new-model
memory-size iomem 5
ip cef
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
multilink bundle-name authenticated
interface Serial0/0
ip address 198.198.198.2 255.255.255.0
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface Serial0/2
ip address 200.200.200.2 255.255.255.0
clock rate 2000000
!
interface Serial0/3
no ip address
shutdown
clock rate 2000000
!
router rip
network 198.198.198.0
network 200.200.200.0
!
router bgp 2
no synchronization
bgp log-neighbor-changes
neighbor 198.198.198.1 remote-as 2
neighbor 200.200.200.4 remote-as 1
no auto-summary
R2#show ip route
Gateway of last resort is not set
C 200.200.200.0/24 is directly connected, Serial0/2
C 198.198.198.0/24 is directly connected, Serial0/0
R 199.199.199.0/24 [120/1] via 198.198.198.1, 00:00:25, Serial0/0
B 10.0.0.0/8 [20/0] via 200.200.200.4, 00:31:44
============================================================
Thanks and have a nice weekend.
Solved! Go to Solution.
12-23-2011 09:34 PM
sarahr202 wrote:
When I issue " Show ip bgp 10.0.0.0" on R1 ,I get the following output:
R1#show ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 2
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
2
1
200.200.200.4 (metric 1) from 198.198.198.2 (200.200.200.2)
Origin IGP, metric 0, localpref 100, valid, internal
1
199.199.199.4 from 199.199.199.4 (10.10.10.4)
Origin IGP, metric 0, localpref 100, valid, external, best
The above output indicates there are two best routes to reach 10.0.0.0. If there are two best path available to reach 10.0.0.0 from R1,why Prefix 10.0.0.0 has " >" missing in the output of" show ip bgp" on R1.
No, the output indicates there is only one best route which I bolded for you.
If you review this document:
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml
You will see the tie breaker is the 7th rule from the algorithm
Regards,
Edison
12-24-2011 08:11 AM
You are correct. Routes are compared based on Administrative Distance or Prefix Length.
The longest prefix length will be preferred
The lowest AD will be preferred
In your case, you have 2 contending routes learned via BGP. When both routes are learned via BGP, you rule out the Administrative Distance concept and follow the BGP Best Path Algorithm.
Regards,
Edison
12-24-2011 01:39 PM
You can make the same argument for External EIGRP and Internal EIGRP, are they different routing protocols?
12-25-2011 08:15 AM
The rule is to use the 'Best Path Algorithm' (URL posted before) when routes are learned via BGP.
By following this rule, you can influence routing decision on BGP speaking routers w/o depending solely on the Administrative Distance. For instance, if you want to choose an iBGP learned route over an eBGP learned route, you can use any of the 6 previous steps by using the BGP metrics such as WEIGHT, LOCAL_PREF, AS_PATH among others.
I've had to use these metrics extensively during designs for better traffic engineering.
Regards,
Edison
12-23-2011 09:34 PM
sarahr202 wrote:
When I issue " Show ip bgp 10.0.0.0" on R1 ,I get the following output:
R1#show ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 2
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
2
1
200.200.200.4 (metric 1) from 198.198.198.2 (200.200.200.2)
Origin IGP, metric 0, localpref 100, valid, internal
1
199.199.199.4 from 199.199.199.4 (10.10.10.4)
Origin IGP, metric 0, localpref 100, valid, external, best
The above output indicates there are two best routes to reach 10.0.0.0. If there are two best path available to reach 10.0.0.0 from R1,why Prefix 10.0.0.0 has " >" missing in the output of" show ip bgp" on R1.
No, the output indicates there is only one best route which I bolded for you.
If you review this document:
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml
You will see the tie breaker is the 7th rule from the algorithm
Regards,
Edison
12-23-2011 10:15 PM
Hi Edison
One thing still puzzles me.
Let say R1 is receiving prefix 199.199.199.0 from ospf, and rip
Since AD of ospf is lower than that of rip, R1 chose prefix advertised by ospf.
In our case R1 is receiving 10.0.0.0/8 from R4 via EBGP which has AD of 20 ,R 1 is also receiving the same prefix from R2 via iBGP which has AD of 200.
Routers use the concept of AD when receiving prefix from multiple routing protocols; routers use metric/cost to choose the best path to reach a prefix being advertised by different routers running same protocol.
Since EBGP has AD of 20 and IBGP has AD of 200, R1 will always prefer the lower AD and thus routes advertised via EBGP will be chosen .
Then why R1 has to check the list to decide which path to choose to reach 10.0.0.0, R1 should simply look at AD of EBGP and and choose the prefix advertised by EBGP without even looking at the list .?
Your expert advised is greatly sought.
Thanks and happy holidays to you.
12-24-2011 08:11 AM
You are correct. Routes are compared based on Administrative Distance or Prefix Length.
The longest prefix length will be preferred
The lowest AD will be preferred
In your case, you have 2 contending routes learned via BGP. When both routes are learned via BGP, you rule out the Administrative Distance concept and follow the BGP Best Path Algorithm.
Regards,
Edison
12-24-2011 09:11 AM
HI Edison.
You are saying since there is no contending routing protocols in our case thus the concept of AD does not apply here.
But here is my confusion:
Will the prefix 10.0.0.0 advertised by EBGP neighbor R4 to R1, regarded as EBGP advertised route?
Will the prefix 10.0.0 advertised by IBGP neighbor R2 to R1, regarded as IBGP advertised route?
If yes, then we have two contending routing protocols IBGP which has AD of 200 and EBGP which has AD of 20,both of them advertising prefix 10.0.0.0/8 to R1
I would realy appreciate your input.
Happy holidays!
12-24-2011 09:41 AM
The routing protocol in question is BGP. There is no routing protocol called iBGP nor eBGP.
iBGP and eBGP are neighbor types and you never use Administrative Distance as a factor when comparing routes between eBGP and iBGP. As you stated, the AD will be used when comparing BGP with other IGPs if contending routes have identical prefix lengths.
Regards,
Edison
12-24-2011 11:17 AM
Hi Edison
My question is If IBgp anf EBgp are not protocols and they are just terms to define bgp neighbors then why do we have ADs assigned to them as indicated below:
Routing protocol /Route source | Default Distance Values |
Connected interface | 0 |
Static route | 1 |
Enhanced Interior Gateway Routing Protocol (EIGRP) summary route | 5 |
External Border Gateway Protocol (eBGP) | 20 |
Internal EIGRP | 90 |
IGRP | 100 |
OSPF | 110 |
Intermediate System-to-Intermediate System (IS-IS) | 115 |
Routing Information Protocol (RIP) | 120 |
Exterior Gateway Protocol (EGP) | 140 |
On Demand Routing (ODR) | 160 |
External EIGRP | 170 |
Internal BGP | 200 |
Unknown | 255 |
Thanks and have a nice weekend.
12-24-2011 01:39 PM
You can make the same argument for External EIGRP and Internal EIGRP, are they different routing protocols?
12-24-2011 01:47 PM
In case of external eigrp ( Ad 170) eigrp (ad 90) and both advertising same prefix, Router does use the concept of AD.
What I don't understand is why the router does not use the concept of AD when receiving same prefix from ebgp( ad 20) and ibgp (ad 200).
Thanks and I really appreciate your help..
Happy holidays!.
12-25-2011 08:15 AM
The rule is to use the 'Best Path Algorithm' (URL posted before) when routes are learned via BGP.
By following this rule, you can influence routing decision on BGP speaking routers w/o depending solely on the Administrative Distance. For instance, if you want to choose an iBGP learned route over an eBGP learned route, you can use any of the 6 previous steps by using the BGP metrics such as WEIGHT, LOCAL_PREF, AS_PATH among others.
I've had to use these metrics extensively during designs for better traffic engineering.
Regards,
Edison
12-25-2011 03:55 PM
Thanks Edison
I apologize for this being stubborn.
Here is gist of what I have learned thanks to you.
The concept of AD applies when router has to choose a same prefix advertised by different contending protocols or some times same protocol such as EIGRP( external eigrp ad 170. eigrp 90).
However in the case of BGP where BGP is the only routing protocol, the concept of AD does not apply unlike EIGRP.
Like EIGRP, BGP does have different AD, (Ibgp 200,ebgp 20). But these AD were not taken into account by router when choosing a same prefix advertised by Ebgp peer and IBGP peer. In such situation, router just follow the " The best path algorithm".
thanks and happy holidays
12-25-2011 05:27 PM
Correct.
Per your diagram above, you can influence R1 to go via R2 in order to get to R4 even if the route learned from R2 is iBGP (AD 200).
You can change the local_pref for 10.0.0.0/8 in R2 when the route is being learned from R4.
After making the change, examine the routing table as well as the bgp table in R1 and you will see the iBGP route chosen as preferred.
You can use other metrics such as WEIGHT or AS_PATH Prepend on R1 to come up with the same traffic engineering.
Again, any of those chances can be done without altering the Administrative Distance on iBGP nor eBGP.
Regards,
Edison
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide