[quagga-users 14638] BGP MED question (using quagga-1.2.0)

Templin, Fred L Fred.L.Templin at boeing.com
Thu Mar 9 00:11:49 GMT 2017


I am setting up a little IPv6 BGP test network using quagga-1.2.0 with three BGP
routers; each in its own AS. Router R1 is in AS1, router R2 is in AS2 and router R3
is in AS3. R1 peers with R2 and R3, but R2 and R3 do not peer with each other.
All three routers are connected to the same multi-access link (for example,
an Ethernet LAN segment). All three routers use IPv6 link-local addresses on
their interface connections to the multi-access link (R1 is fe80::1, R2 is fe80::2
and R3 is fe80::3).

I have configurations in routers R2 and R3 that attempt to set the MED values
for routes originated from those routers. See below for more on that.

On R1, I have the following lines in the BGP configuration:

          bgp bestpath as-path ignore
          bgp always-compare-med
          bgp deterministic-med

To my understanding, the first line tells BGP to ignore the AS_PATH rule in
the BGP route selection process. The second line tells BGP to compare the
MED values even if the same IPv6 route is originated from different ASes.
And, the third line I added for good measure even though I'm not sure I
fully understand its use. Do these configurations look correct?

On R2, I set the MED value to 10000 and on R3 I set the MED value to 5000.
But, when I install the same IPv6 route on both R2 and R3 (e.g., 2001::/64)
R1 shows R2 as being the best next hop. But, because of the MED settings,
I was expecting R3 to be selected.

As a clue, when I open a vtysh on R1 I get the following:

r1# sh ipv6 bgp
BGP table version is 0, local router ID is
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  2001::/64        fe80::3               1024             0 3 ?
*>                  fe80::2               1024             0 2 ?

Total number of prefixes 1

So the routing table shows the 2001::/64 route coming from both R2 and R3,
but both have Metric set to 1024 and the route from R2 shows up as the
preferred route. I was rather expecting to see the Metric for R2 as 10000
and the Metric for R3 as 5000. So, this makes me wonder if I haven't set
the Metrics correctly in my R2/R3 config files. See below for the config
file entries for router R2. Router R3 has very similar entries so I will not
send its config for now. And, if you need to see more of the router R1
configuration I could send that too.

Thanks in advance for your thoughts on this,

Fred Templin
fred.l.templin at boeing.com

Router R2 configs:
        interface eth0
          ip address
        interface aero0
          ipv6 address fe80::2/64
        ! BGP configuration
        ! You should configure the AS number below,
        ! along with this router's peers.
        router bgp 2
          bgp router-id
          no bgp default ipv4-unicast
          neighbor fe80::1 remote-as 1
          neighbor fe80::1 interface aero0
          neighbor fe80::1 advertisement-interval 0
          neighbor fe80::1 route-map setmetricout out
          address-family ipv6
          redistribute connected
          redistribute static
          redistribute kernel
          neighbor fe80::1 activate
          neighbor fe80::1 next-hop-self
          neighbor fe80::1 distribute-list 101 out
          ipv6 access-list 101 permit 2001::/16
          ipv6 access-list 101 deny any
          route-map setmetricout permit 10
                set metric 10000

More information about the Quagga-users mailing list