Mailing List Archive

BGP MED question (using quagga-1.2.0)
Hi,

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 10.0.1.2
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@boeing.com

Router R2 configs:
*************
interface eth0
ip address 10.0.0.2/24
!
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 10.0.0.2
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
exit-address-family
!
ipv6 access-list 101 permit 2001::/16
ipv6 access-list 101 deny any
route-map setmetricout permit 10
set metric 10000
!



_______________________________________________
Quagga-users mailing list
Quagga-users@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-users
Re: BGP MED question (using quagga-1.2.0) [ In reply to ]
A few thought on this:

1) Metric <> MED. They are different values set different ways.
2) MEDs are inherently broken (inherently, not specifically in Quagga). Because of this they get a lot less use than you might think. A bit of googling can probably satisfy any desire for details you may have.
3) I would guess (without any proof, but with pretty good confidence) that the commands you're using are not well-tested code paths in Quagga. That means a higher risk of bugs biting you.

Maybe if you tell us more about what you're doing, someone will suggest a better way.

/a

On Mar 8, 2017, at 7:11 PM, Templin, Fred L <Fred.L.Templin@boeing.com> wrote:
> 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 10.0.1.2
> 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@boeing.com
>
> Router R2 configs:
> *************
> interface eth0
> ip address 10.0.0.2/24
> !
> 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 10.0.0.2
> 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
> exit-address-family
> !
> ipv6 access-list 101 permit 2001::/16
> ipv6 access-list 101 deny any
> route-map setmetricout permit 10
> set metric 10000
> !

_______________________________________________
Quagga-users mailing list
Quagga-users@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-users
Re: BGP MED question (using quagga-1.2.0) [ In reply to ]
On Mar 8, 2017, at 9:17 PM, Alexis Rosen <quagga-users@alexis.users.panix.com> wrote:
> A few thought on this:
>
> 1) Metric <> MED. They are different values set different ways.

Sorry, my mistake- this is wrong. Typing too fast, thinking too slow...

But the other two points are true.

/a

> 2) MEDs are inherently broken (inherently, not specifically in Quagga). Because of this they get a lot less use than you might think. A bit of googling can probably satisfy any desire for details you may have.
> 3) I would guess (without any proof, but with pretty good confidence) that the commands you're using are not well-tested code paths in Quagga. That means a higher risk of bugs biting you.
>
> Maybe if you tell us more about what you're doing, someone will suggest a better way.
>
> /a
>
> On Mar 8, 2017, at 7:11 PM, Templin, Fred L <Fred.L.Templin@boeing.com> wrote:
>> 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 10.0.1.2
>> 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@boeing.com
>>
>> Router R2 configs:
>> *************
>> interface eth0
>> ip address 10.0.0.2/24
>> !
>> 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 10.0.0.2
>> 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
>> exit-address-family
>> !
>> ipv6 access-list 101 permit 2001::/16
>> ipv6 access-list 101 deny any
>> route-map setmetricout permit 10
>> set metric 10000
>> !
>
> _______________________________________________
> Quagga-users mailing list
> Quagga-users@lists.quagga.net
> https://lists.quagga.net/mailman/listinfo/quagga-users


_______________________________________________
Quagga-users mailing list
Quagga-users@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-users
Re: BGP MED question (using quagga-1.2.0) [ In reply to ]
Hi Alexis,

Thank you for your responses. What I want to do is exactly what is depicted
in an example from the cisco documentation:

http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#localpref

(Scroll down to where it shows the metric/MED figure.) In the figure, it shows
RTA receiving updates for prefix 18.10.0.0 from routers RTB, RTC and RTD. RTB
is in AS400 and has MED value 50 while RTC and RTD are both in AS300 with MED
120 and 200 respectively. When RTA does not set "bgp always-compare-med"
RTC is selected as the preferred route since it has the lowest MED value for
routers in AS300. But, when "bgp always-compare-med" is set, RTB is selected
even though it is in a different AS than RTC and RTD.

I assume this works on cisco routers since it appears in their documentation.
Is this something that Quagga is not currently handling correctly?

Thanks - Fred

PS I got my router configurations from the examples given in the above
cisco documentation.


> -----Original Message-----
> From: Alexis Rosen [mailto:quagga-users@alexis.users.panix.com]
> Sent: Wednesday, March 08, 2017 6:33 PM
> To: Templin, Fred L <Fred.L.Templin@boeing.com>
> Cc: quagga-users@lists.quagga.net
> Subject: Re: [quagga-users 14639] BGP MED question (using quagga-1.2.0)
>
> On Mar 8, 2017, at 9:17 PM, Alexis Rosen <quagga-users@alexis.users.panix.com> wrote:
> > A few thought on this:
> >
> > 1) Metric <> MED. They are different values set different ways.
>
> Sorry, my mistake- this is wrong. Typing too fast, thinking too slow...
>
> But the other two points are true.
>
> /a
>
> > 2) MEDs are inherently broken (inherently, not specifically in Quagga). Because of this they get a lot less use than you might think. A
> bit of googling can probably satisfy any desire for details you may have.
> > 3) I would guess (without any proof, but with pretty good confidence) that the commands you're using are not well-tested code
> paths in Quagga. That means a higher risk of bugs biting you.
> >
> > Maybe if you tell us more about what you're doing, someone will suggest a better way.
> >
> > /a
> >
> > On Mar 8, 2017, at 7:11 PM, Templin, Fred L <Fred.L.Templin@boeing.com> wrote:
> >> 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 10.0.1.2
> >> 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@boeing.com
> >>
> >> Router R2 configs:
> >> *************
> >> interface eth0
> >> ip address 10.0.0.2/24
> >> !
> >> 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 10.0.0.2
> >> 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
> >> exit-address-family
> >> !
> >> ipv6 access-list 101 permit 2001::/16
> >> ipv6 access-list 101 deny any
> >> route-map setmetricout permit 10
> >> set metric 10000
> >> !
> >
> > _______________________________________________
> > Quagga-users mailing list
> > Quagga-users@lists.quagga.net
> > https://lists.quagga.net/mailman/listinfo/quagga-users
>



_______________________________________________
Quagga-users mailing list
Quagga-users@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-users