iBGP and Next-Hop cost

Ondrej Zajicek santiago at crfreenet.org
Thu Sep 10 13:03:24 CEST 2015


On Thu, Sep 10, 2015 at 10:40:22AM +0100, Adam Priestley wrote:
> Hello list,
> 
> I am trying to understand where I might be going wrong in my implementation
> or understanding of the following setup.
>
> The documentation states that "BGP depends on existing IGP routing table
> with AS-internal routes to determine immediate next hops for routes and to
> know their internal distances to boundary routers for the purpose of BGP
> route selection". However:
> When inspecting the available routes from one of my bird routers elsewhere
> on the network, I see one for which the next-hop OSPF cost is 20, and one
> where the cost is 30. Both routes still show the same MED, the same
> localpref, same as-path etc, but the route with the higher OSPF cost is
> always being installed.
> 
> The only reason I can see for this route to be preferred is that the
> originating router has the lower router-id, but this check comes after the
> supposed IGP distance check in the route selection rules. So am I
> completely misunderstanding how this process works, or have I just done
> something wrong? Any advice would be greatly appreciated.

Hello

For BGP recursive routes, the (X/Y) in show route is priority / IGP metric.
'?' means that IGP metric for some reason cannot be determined. This baffled
me as otherwise the BGP routes use proper next hops from OSPF routes.

I examined it and for some reason[*] BIRD does not accept OSPF type-2
external metric as IGP metric for the purpose of recursive route
comparison. There are two solutions, either export that static routes to
OSPF as type-1 external routes instead of type-2 external routes, or set
the ipg_metric route attribute explicitly in OSPF import filters (e.g.
'igp_metric = ospf_metric1' would use ospf_metric1 always even for type-2
external route).

[*] Probably because type-2 external routes have both type-2 metric and
regular metric, both have 24-bit range and it would be problematic
to compress that into 32-bit igp metric range.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20150910/3c9704c0/attachment.asc>


More information about the Bird-users mailing list