Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

why "bgp bestpath med missing-as-worst" command does not produce the desired result?

Dear all,can anyone tell me why "bgp bestpath med missing-as-worst"  command does not produce the desired result?
And I use GNS3 to do this lab,IOS Version : 12.4(3)
Tks...

Top:
           192.168.12.0/24       192.168.23.0/24
RA(f0/0)-----------(f0/0)RB(s2/0)------------(s2/0)RC
[AS1]                    [AS2]                    [AS3]

Configuration:
*RA*:
A(config-router)#do sh run | b r b
router bgp 1
no synchronization
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
neighbor 192.168.12.2 remote-as 2
neighbor 192.168.12.2 route-map setmed out
no auto-summary

ip route 1.1.1.0 255.255.255.0 Null0

route-map setmed permit 10
set metric 20

*RB*:
B(config-router)#do sh run | b r b
router bgp 2
no synchronization
bgp always-compare-med
bgp log-neighbor-changes
bgp bestpath med missing-as-worst
neighbor 192.168.12.1 remote-as 1
neighbor 192.168.23.3 remote-as 3
no auto-summary

*RC*:
C(config-router)#do sh run | b r b
router bgp 3
no synchronization
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
neighbor 192.168.23.2 remote-as 2
no auto-summary

ip route 1.1.1.0 255.255.255.0 Null0


But when I inspect RB's bgp table,it like bellow:

B(config-router)#do sh ip bgp
BGP table version is 2, local router ID is 192.168.23.2
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
*> 1.1.1.0/24       192.168.23.3             0                          0  3 i
*                          192.168.12.1            20                         0  1 i

The prefix is assigned a MED value of 0,but it also the best path when i use "bgp bestpath med missing-as-worst" under bgp config mode.... :-(

1 ACCEPTED SOLUTION

Accepted Solutions

Re: why "bgp bestpath med missing-as-worst" command does not pr

Please have a look at the following discussion about setting of MEDs towards an eBGP neighbor:

https://supportforums.cisco.com/thread/343397?tstart=0

Note that BGP MED is set to 0 even if the injected BGP route comes from a connected route.

The first time I came across this MED sending behavior was 5-6 years ago in a service provider image. Routes were injected into BGP with 'network' command and were validated either via OSPF routes or statics to null0. Involuntary sending of MEDs was messing up with the load-balancing between 2 links of our incoming traffic from the same upstream service provider.

Note also that if a route is learned via iBGP, border router removes MED before advertising route to an eBGP peer (i.e. the above comments apply when a route is injected locally into the BGP of a border router and then sent to an eBGP peer).

I don't know what is causing the problem you reported in your latest post. Does this issue last for long or does it change after a while?

p.s. sorry, I edited post because I said 'iBGP' instead of 'eBGP' at some point.

14 REPLIES
Hall of Fame Super Silver

Re: why "bgp bestpath med missing-as-worst" command does not pr

Hello Haungpo,

you may need to clear the BGP session on RB to see changes in effect

Hope to help

Giuseppe

Re: why "bgp bestpath med missing-as-worst" command does not pr

Hi,

From This neigbor  (192.168.23.3) , network 1.1.1.0 should be assigned high metric value. could you please clear the BGP table and come back if its showing the same output.

HTH

Mohamed

New Member

Re: why "bgp bestpath med missing-as-worst" command does not pr

Thanks!

When after me used the  "bgp bestpath med missing-as-worst" command,I do both "soft"&"hard"  reset the bgp session!  The result was also show like above……

Re: why "bgp bestpath med missing-as-worst" command does not pr

Hi,

Strange output indeed,

On Router 1, remove the route-map  with a med of 20 sent to router 2, check the output (BGP table) from router 2 after removing the MED.

HTH

Mohamed

New Member

Re: why "bgp bestpath med missing-as-worst" command does not pr

New configuration:

Router(config-router)#do sh run | b r b
RA:

router bgp 1
no synchronization
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
neighbor 192.168.12.2 remote-as 2
no auto-summary
ip route 1.1.1.0 255.255.255.0 Null0

RB's bgp table:

Router(config-router)#do sh ip bgp
BGP table version is 2, local router ID is 192.168.23.2
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
*  1.1.1.0/24       192.168.23.3             0                0        3 i
*>                      192.168.12.1             0                0        1 i

Now,BGP select the next hop with lowest RID to the destination!

TKS,Best regards!

Re: why "bgp bestpath med missing-as-worst" command does not pr

Let me check it and come back to you later,

Mohamed

Re: why "bgp bestpath med missing-as-worst" command does not pr

Hi,

I have labed it up, Although it should produce the desired reult, but its not !!!!

some one might help here,,,

HTH

Mohamed

Cisco Employee

Re: why "bgp bestpath med missing-as-worst" command does not pr

Hello,

It seems that the recent BGP implementations send a metric of 0 for routes that do not have their metric set explicitely. Have you tried to capture and analyze the traffic on the links between routers? I am sure you will see that actually both R1 and R3 send the route with the MULTI_EXIT_DISC despite only one of them is explicitely configured to do so. I have labbed it up quickly and I have arrived at the same confusion as you until I tried to have a closer look what is going on between the BGP peers.

This makes it logical - one router advertises the network with some higher metric, according to your route-map, the other advertises it with 0. Of course the 0 is more preferred.

Can you have a look at the BGP communication?

Best regards,

Peter

New Member

Re: why "bgp bestpath med missing-as-worst" command does not pr

Tks all of you!

New Member

Re: why "bgp bestpath med missing-as-worst" command does not pr

That I found a interesting question:
when I use the "hard" reset on RA(Notice that  not on RB&RC  ),and then show RB's bgp table like bellow:
B(config-router)#do sh ip bgp
BGP table version is 5, local router ID is 192.168.23.2
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
*  1.1.1.0/24       192.168.12.1             0              0         1 i
*>                      192.168.23.3            20             0         3 i
But when i do the same on RB(or RC) latter,RB's bgp table is resume again!

Re: why "bgp bestpath med missing-as-worst" command does not pr

Please have a look at the following discussion about setting of MEDs towards an eBGP neighbor:

https://supportforums.cisco.com/thread/343397?tstart=0

Note that BGP MED is set to 0 even if the injected BGP route comes from a connected route.

The first time I came across this MED sending behavior was 5-6 years ago in a service provider image. Routes were injected into BGP with 'network' command and were validated either via OSPF routes or statics to null0. Involuntary sending of MEDs was messing up with the load-balancing between 2 links of our incoming traffic from the same upstream service provider.

Note also that if a route is learned via iBGP, border router removes MED before advertising route to an eBGP peer (i.e. the above comments apply when a route is injected locally into the BGP of a border router and then sent to an eBGP peer).

I don't know what is causing the problem you reported in your latest post. Does this issue last for long or does it change after a while?

p.s. sorry, I edited post because I said 'iBGP' instead of 'eBGP' at some point.

New Member

Re: why "bgp bestpath med missing-as-worst" command does not pr

Tks,marikakis !You are right……

That I use the configuration bellow after your post:

B(config-router)#do sh run | b r b
router bgp 2
no synchronization
bgp always-compare-med
bgp log-neighbor-changes
bgp bestpath med missing-as-worst
neighbor 192.168.12.1 remote-as 1
neighbor 192.168.12.1 route-map setmed1 in
neighbor 192.168.23.3 remote-as 3
neighbor 192.168.23.3 route-map setmed2 in
no auto-summary

route-map setmed2 permit 10
set metric 10

route-map setmed1 permit 10
set metric 0

RB's bgp table is :

B(config-router)#do sh ip bgp
BGP table version is 4, local router ID is 192.168.23.2
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
*> 1.1.1.0/24       192.168.23.3            10             0       3 i
*                        192.168.12.1    4294967295        0       1 i

I'v learn more from this discussion! Tks very much,everyone!

H.P.

Best regards!

New Member

why "bgp bestpath med missing-as-worst" command does not produc

I know this post is old but I wanted to point out that bgp bestpath med missing-as-worst only sets missing MEDs to infinity.

If show ip bgp displays

   Network          Next Hop            Metric LocPrf Weight Path

*  1.1.1.0/24       192.168.12.1             0              0         1 i

*>                      192.168.23.3            20             0         3 i

Then missing-as-worst accomplishes nothing.  It won't set 0 to infinity

But if it displays

   Network          Next Hop            Metric LocPrf Weight Path

*  1.1.1.0/24       192.168.12.1                            0         1 i

*>                      192.168.23.3            20             0         3 i

then you have a missing MED and you get this

   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.0/24       192.168.23.3            10             0       3 i

*                        192.168.12.1    4294967295        0       1 i

Hard to find info on this behavior so I wanted to post this

New Member

Re: why "bgp bestpath med missing-as-worst" command does not produce the desired result?

This is an expected behavior , The MED is forwarded to the next AS only and not beyond that , therefor if the route originate from a directly attached AS you will see the med ( 0 or an other value ) , if the route originate from an AS that is not directly attached and your neighbor is not configured to forward or manipulate the MED in this case the med will be missing and that is where this command will set the value to 4294967295.

3764
Views
7
Helpful
14
Replies
CreatePlease to create content