[Babel-users] How to configure babeld?

Daniel Gröber dxld at darkboxed.org
Sat Jan 7 00:35:10 GMT 2023


Hi Marek,

On Fri, Jan 06, 2023 at 05:58:02PM +0100, Marek Küthe wrote:
> I find enormously few examples on the internet. Furthermore, I do not
> understand the difference between the filter in, out and redistribute.

A quick overview:

- 'in' handles routes announced by neighbours before they are installed
  into babeld's internal table. I mainly use this for per-interface prefix
  ACLs.

- 'redistribute' handles routes found in the linux kernel routing table,
  allowing you to choose which routes to install into babeld's internal
  table and consequently announce to neighbours.

- 'out' handles routes as they are going out to neighbours, letting you
  make per-neighbour decisions on which routes to advertise to them or
  tweak metrics on a per-neigh/interface basis.

> Therefore I have some questions:
> 1) Suppose I get a route from a babel neighbor and I redistribute it,

That's a misunderstanding, routes from neighbors don't go through the
redistribute filter. See above.

> 2) Assuming I now have a /56 prefix configured on
> an interface and want to redistribute it, I only need to allow this in
> the out filter, right?

You need to allow it in the redistribute filter mainly, IIRC the others
default to allow anyway.

> I am currently trying to write the following configuration:
> 1) I want to send a local prefix /56 to all babel nodes. If the own /56
> prefix is received, it should be rejected.
> 2) Only ULA routes with a prefix length between 44 and 64 should be
> propagated from the babel neighbors. These are to be installed also with
> one in the kernel.
> 
> Currently I have the following configuration.
> However this does not work.

> ```
> random-id true
> link-detect true
> interface my_peer type tunnel
> 
> out local ip fd5c:3e37:2666:6a00::/56 allow

You don't want that "local" there. As far as I've been able to see from my
testing "local" only ever matches on the interface /128 addressess babeld
redistributes by default.

While we're on babeld's default rules keep this paragraph from the manpage
in mind:

    By  default,  babeld  redistributes  all  local addresses, and no other
    routes.  In order to make sure that only the routes you specify are re‐
    distributed, you should include the line
   
           redistribute local deny
   
    as the last line in your configuration file.

Anyway, as mentioned above "out" is the wrong filter here. You want
"redistribute", additionally note that `ip f00::/56` only matches on the IP
being in that prefix not on the prefix length. So you'll want to add an `eq
56` too.

> in ip fd::/8 ge 44 le 64
> out ip fd::/8 ge 44 le 64

IMO you don't need in and out until you do per-neigh/iface stuff so just do
remove them as allow should be the default (or just `in allow`, `out allow`
if that doesn't work).

One more note about `type tunnel` above: In my experience babeld's default
metric are kind of hard to debug if you're using the RTT extension which
`type tunnel` will enable. My defaults are:

    default type tunnel  rxcost 1  rtt-min 1  rtt-max 1001  max-rtt-penalty 1000

That way the metric of any route is actually the latency to get there
instead of the weird (96+rtt*96) babeld defaults to. You can tweak rtt-max
and max-rtt-penalty to get a per-hop latency cost cap to your liking.

If you add any `type wired` interfaces they will have a cost of 1 which I
find works fine to prefer them over tunnel links. However if you mix this
(or the default config) with `type wireless` I find things go a bit haywire
but I haven't figured out how this ETX stuff is supposed to work anyway :)

--Daniel



More information about the Babel-users mailing list