BGP Question

Unanswered Question
May 17th, 2008


Is it possible that same distination reach via diffrent ISP but metric value is same.? and that destination route is install in "Show ip route" table. Please let me known.


I have this problem too.
1 vote
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.8 (6 ratings)
Giuseppe Larosa Sat, 05/17/2008 - 10:49

Hello minu,

yes you can have two different eBGP advertisements installed in your routing table for an IP prefix.

Look at the command maximum-paths in the router bgp process. The default value is 1. if you use maximum-paths 2 you can have two paths installed in your ip routing table.

If you want to compare MED for advertisements coming from two different ISPs (BGP ASN) you can use the command

router bgp

bgp always-compare-med

! and to have a deterministic behaviour

bgp deterministic-med

maximum-paths 2


hope to help


Harold Ritter Sat, 05/17/2008 - 17:16


Bear in mind that IOS will not install the two paths in the RIB by default if they are not from the same neighbor AS.

You can use the following hidden command to change this behavior.

"bgp bestpath as-path multipath-relax"


lamav Sun, 05/18/2008 - 08:59

Thats interesting...

So, the maximum-paths command is only for installing multiple paths from the same neighbor?


minumathur Sun, 05/18/2008 - 18:41


That mean in " show ip route" do not have multiple routes for same destionation only this is happend with same AS not different different AS.

Please correct me if i am wrong..


royalblues Sun, 05/18/2008 - 23:54

yes.. if you have maximum-paths configured under BGP, and you receive multiple routes to the same destination via different AS, it will not be installed in the routing table

you need to enter the command that harold pointed out

bgp bestpath as-path multipath-relax

configuring the above along with the maximum-paths will ensure that multiple entries are installed in the RT




minumathur Mon, 05/19/2008 - 23:11

Hi Narayan

I beliave maximum-path command only use only AS. that means it is useful when you have two link with same AS, here my question is the if i have two links with different AS and it will design in such way that i will have all attributes are same , in that case should i get two routes in "show ip route "


royalblues Mon, 05/19/2008 - 23:34


When you enter the bgp best-path as-path multipath-relax command along with maximum paths command, the router will install 2 routes provided the other attributes are same

here is an example output where R1 (AS 100) is connected to both R2 (AS 200) and R3 (AS 300) both advertising prefix


router bgp 100

no synchronization

bgp log-neighbor-changes

bgp bestpath as-path multipath-relax

neighbor remote-as 200

neighbor remote-as 300

maximum-paths 2

no auto-summary


router bgp 200

no synchronization

bgp log-neighbor-changes

network mask

neighbor remote-as 100

no auto-summary


router bgp 300

no synchronization

bgp log-neighbor-changes

network mask

neighbor remote-as 100

no auto-summary

r1#sh ip bgp

BGP table version is 3, local router ID is

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

*> 0 0 200 i

* 0 0 300 i


r1#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is not set is subnetted, 1 subnets

B [20/0] via, 00:07:53

[20/0] via, 00:03:49 is subnetted, 1 subnets

C is directly connected, FastEthernet0/1 is subnetted, 1 subnets

C is directly connected, FastEthernet0/0


Note : it is possible that the command may not appear in the CLI help but you can type it as it is



lamav Tue, 05/20/2008 - 06:47


Nice presentation. There's no better way to prove the theory than to actually put it to the test.

I rated your post.


philiechang Tue, 05/20/2008 - 08:19


Since both paths are installed into the routing table does this mean it will load-balance between the 2 routers?



royalblues Tue, 05/20/2008 - 20:31

Yes it would and would be based on the CEF per destination loadbalance by default


minumathur Wed, 05/21/2008 - 00:11


thanks for clarification , this is really great help, onces again thanks


Giuseppe Larosa Tue, 05/20/2008 - 02:31

Hello Harold,

I thought that the usage of the command bgp always-compare-med was enough to achieve the intended result.


To enable the comparison of the Multi Exit Discriminator (MED) for paths from neighbors in different autonomous systems, use the bgp always-compare-med command in router configuration mode. To disallow the comparison, use the no form of this command.

Actually, I haven't tried what I was suggesting.

Thanks for your correction.

Best Regards


Harold Ritter Tue, 05/20/2008 - 05:00


This command will only force the comparison of MEDs between different ASes. It doesn't mean both paths will be installed if the MEDs are equal.

You absolutely need the hidden command "bgp bestpath as-path multipath-relax" to get the two paths to be installed in the RIB.



This Discussion