BABELD(8)

πŸ“¦
version 1.14 Β· 3 versions
, in alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ BABELD ✨

okay bestie, welcome to the babeld manual page, section 8, straight out of the System Manager's Manual πŸ’– this is the whole thing, no skips, no shortcuts, we're reading it together like the main characters we are πŸ‘‘


🌈 NAME 🌈

babeld β€” ad-hoc network routing daemon πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

babeld option...  [ -- ] interface...

πŸ’– DESCRIPTION πŸ’–

so Babel is a loop-avoiding distance-vector routing protocol, roughly based on DSDV and AODV, but with some extra provisions for estimating link cost and for redistributing routes from other routing protocols ✨

and listen, even though it's optimised for wireless mesh networks, Babel will also work efficiently on wired networks. versatile queen πŸ’…


πŸ’… OPTIONS πŸ’…

  • -V β€” shows you babeld's version and then dips. bye! πŸ‘‹
  • -m multicast-address β€” sets the link-local multicast address the protocol uses. the default is ff02:0:0:0:0:0:1:6 ✨
  • -p port β€” sets the UDP port number the protocol uses. the default is 6696.
  • -S state-file β€” names the file used for preserving long-term info between invocations of the babeld daemon. > heads up bestie: if you delete this file, the daemon will run in passive mode for 3 minutes the next time it's started, and other hosts might initially ignore it 😭 The default is /var/lib/babel-state.
  • -h hello-interval β€” sets the interval in seconds at which scheduled hello packets are sent on wireless interfaces. the default is 4 seconds.
  • -H wired-hello-interval β€” sets the interval in seconds at which scheduled hello packets are sent on wired interfaces. the default is 4 seconds.
  • -M half-time β€” sets the half-time in seconds of the exponential decay used for smoothing metrics when doing route selection; a value of 0 disables smoothing entirely. the default is 4s.
  • -k priority β€” sets the priority value used when installing routes into the kernel. the default is 0.
  • -A priority β€” allows duplicating external routes when their kernel priority is at least priority. > 🚨 do not use this option unless you genuinely know what you're doing, because it can cause persistent route flapping. like, persistent persistent. πŸ’€
  • -l β€” uses IFF_RUNNING (carrier sense) when figuring out interface availability.
  • -w β€” don't optimise wired links; assumes all interfaces are wireless unless they're explicitly overridden in the configuration file.
  • -s β€” skips split-horizon processing on wired interfaces. (and just so you know, split-horizon isn't performed on wireless interfaces anyway 🫢)
  • -r β€” uses a random router-id. the default is to use persistent router-ids derived from the MAC address of the first interface, which is easier to debug and more reliably prevents routing loops, but may sometimes cause a node to be unreachable for 120 seconds just after boot 😭 tradeoffs, babe.
  • -d level β€” debug level. 1 asks for a routing table dump at every iteration through the daemon's main loop. 2 additionally asks for tracing every message sent or received. 3 additionally dumps all interactions with the OS kernel. the default is 0.
  • -g port, -g path β€” sets up a local configuration server on port, or at path, in read-only mode. the protocol is described in the section Local Configuration Protocol below πŸ‘€
  • -G port, -G path β€” sets up a local configuration server on port, or at path, in read-write mode. > ⚠️ this lets any local user change babeld's configuration, so it may therefore be a security issue. not the vibe, fr fr.
  • -t table β€” uses the given kernel routing table for routes inserted by babeld.
  • -T table β€” exports routes from the given kernel routing table. you can specify this multiple times to export routes from more than one table πŸ”₯
  • -c filename β€” names the configuration file. this flag can be repeated multiple times. the default is /etc/babeld.conf.
  • -C statement β€” specifies a configuration statement directly on the command line. inline, iconic ✨
  • -D β€” daemonises at startup.
  • -L logfile β€” names a file to log random ``how do you do?'' messages to. this defaults to standard error if not daemonising, and to /var/log/babeld.log otherwise.
  • -I pidfile β€” names a file to write our process id to; use no pidfile if it's set to the empty string. the default is /var/run/babeld.pid.
  • interface... β€” the list of interfaces on which the protocol should operate πŸ’…

πŸŽ€ CONFIGURATION FILE FORMAT πŸŽ€

the configuration file is a sequence of lines, and each line specifies either a global option, an interface specification, or a filtering rule. comments are introduced by an octothorp ``#'' and run until the end of the line πŸ¦‹


Global options

  • protocol-group group β€” specifies the link-local multicast address used by the protocol. equivalent to the command-line option -m.
  • protocol-port port β€” specifies the UDP port number used by the protocol. equivalent to the command-line option -p.
  • kernel-priority priority β€” specifies the priority value used when installing routes into the kernel. equivalent to the command-line option -k.
  • reflect-kernel-metric {true|false} β€” reflect route metrics as kernel priorities. the priority effectively used is kernel-priority + metric ✨
  • allow-duplicates priority β€” allows duplicating external routes when their kernel priority is at least priority. > 🚨 don't use this option unless you know what you're doing, it can cause persistent route flapping.
  • random-id {true|false} β€” specifies whether to use a random router-id. equivalent to the command-line option -r.
  • ipv6-subtrees {true|false} β€” specifies whether to use native source-specific IPv6 forwarding instead of multiple routing tables. the default is chosen automatically depending on the kernel version.
  • debug level β€” specifies the debugging level. equivalent to the command-line option -d.
  • local-port port β€” specifies the TCP port on which babeld will listen for connections from a configuration client in read-only mode. equivalent to the command-line option -g.
  • local-port-readwrite port β€” specifies the TCP port on which babeld will listen for connections from a configuration client in read-write mode. equivalent to the command-line option -G. > ⚠️ this lets any local user change babeld's configuration, and may therefore be a security issue.
  • local-path path β€” specifies the filesystem path to a socket on which babeld will listen for connections from a configuration client in read-only mode. equivalent to the command-line option -g.
  • local-path-readwrite path β€” specifies the filesystem path to a socket on which babeld will listen for connections from a configuration client in read-write mode. equivalent to the command-line option -G. > ⚠️ any user with write access to that socket will be able to change babeld's configuration. be so serious.
  • export-table table β€” specifies the kernel routing table to use for routes inserted by babeld. equivalent to the command-line option -t.
  • import-table table β€” specifies a kernel routing table from which routes are redistributed by babeld. can be specified multiple times with a cumulative effect. equivalent to the command-line option -T.
  • kernel-check-interval seconds β€” specifies the interval between two kernel routing table dumps. the default is 300s (5 minutes). this may be set to 0 in order to never perform periodic kernel dumps πŸ™ˆ
  • shutdown-delay-ms milliseconds β€” during shutdown we first notify neighbours of our imminent shutdown by sending route retractions, then wait for the specified number of milliseconds, and then flush kernel routes. this ensures any inflight traffic is still properly forwarded. you may want to make sure the delay is appropriate for the maximum delay path in your network. setting this to zero is permissible ✨
  • link-detect {true|false} β€” specifies whether to use carrier sense for determining interface availability. equivalent to the command-line option -l.
  • smoothing-half-life seconds β€” specifies the half-life in seconds of the exponential decay used for smoothing metrics when performing route selection. equivalent to the command-line option -M.
  • daemonise {true|false} β€” specifies whether to daemonize at startup. equivalent to the command-line option -D.
  • skip-kernel-setup {true|false} β€” if this flag is set, no kernel (sysctl) setup is performed on startup, and it's assumed that enabling forwarding, disabling redirects and disabling the reverse-path filter is done by other means. this can be useful when running in environments where system permissions prevent setting kernel parameters β€” for instance without root permissions, or inside a Linux container 🫢
  • router-id id β€” specify the router-id explicitly, as a modified EUI-64 or a MAC-48 address. > 🚨 if two nodes have the same router-id, bad things will happen. don't use this option unless you know what you are doing.
  • state-file filename β€” specifies the name of the file used for preserving long-term information between invocations of the babeld daemon. equivalent to the command-line option -S.
  • log-file filename β€” specifies the name of the file used to log random messages to. equivalent to the command-line option -L.
  • pid-file filename β€” specifies the name of the file to which babeld writes out its process id. equivalent to the command-line option -I.
  • first-rule-priority priority β€” specifies the smallest (highest) rule priority used with source-specific routes. the default is 100.
  • key id id type {hmac-sha256|blake2s128} value value β€” configure a key for use with the key interface option. the type is one of hmac-sha256 or blake2s128. the value is a hexadecimal string (up to 64 bytes for hmac-sha256, up to 32 bytes for blake2s128) πŸ”‘

Interface configuration

an interface is configured by a line with the following format:

interface name [parameter...]

where name is the name of the interface (something like eth0). and the default value of an interface parameter can be specified changed by a line of the form

              default [parameter...]

Each parameter can be one of:

  • type {auto|wired|wireless|tunnel} β€” sets what kind of interface this is. Defaults to auto unless you passed the -w command-line flag. πŸ¦‹
  • link-quality {true|false|auto} β€” do we bother estimating link quality on this interface? Default is to do it on wireless interfaces only, no cap.
  • split-horizon {true|false|auto} β€” should we do split-horizon processing here? Default is to do it on wired interfaces, unless the -s flag was set.
  • rxcost cost β€” the cost of receiving frames on this interface under ideal conditions (like, zero packet loss πŸ’€). How that maps to the actual cost used for computing route metrics depends on whether link quality estimation is happening. Default is 256 if the interface is wireless, 96 otherwise.
  • hello-interval interval β€” the gap between hello packets on this interface. Default comes from the -h and -H command-line flags.
  • update-interval interval β€” the gap between full routing table dumps on this interface. Babel uses triggered updates and doesn't count to infinity, so you can set this pretty large β€” unless you're expecting significant packet loss. Default is four times the hello interval.
  • enable-timestamps {true|false} β€” send timestamps with every Hello and IHU message so RTT values can be computed. Default is true for tunnel interfaces, false otherwise.
  • unicast {true|false} β€” send multiple copies of TLVs other than Hellos to all neighbours instead of one multicast packet. Default false.
  • rfc6126-compatible {true|false} β€” turn off features that aren't compatible with RFC 6126 (the older Babel protocol), like source-specific routing and RTT estimation over unicast. Default false.
  • rtt-decay decay β€” the decay factor for the exponential moving average of RTT samples, in units of 1/256. Has to be between 1 and 256, inclusive. Higher values throw out old samples faster. Default is 42. ✨
  • rtt-min rtt β€” the minimum RTT, in milliseconds, from which we start increasing the cost to a neighbour. The extra cost is linear in (rtt - rtt-min). Default is 10 ms.
  • rtt-max rtt β€” the maximum RTT, in milliseconds, above which we stop increasing the cost to a neighbour. Default is 120 ms.
  • max-rtt-penalty cost β€” the maximum cost added to a neighbour because of RTT, i.e. when the RTT is higher than or equal to rtt-max. Default is 96 if the interface is of type tunnel, and 0 otherwise.
  • v4-via-v6 {true|false} β€” whether to announce IPv4 routes through this interface even when there's no IPv4 address. Default depends on the kernel version. πŸ™ˆ
  • probe-mtu {true|false} β€” pad all packets containing a Hello TLV to the MTU and disable fragmentation. This avoids establishing adjacencies across links with a mis-configured MTU, at the cost of slightly higher network usage.
  • key id β€” enable HMAC security on this interface, and use the key id. πŸ”₯
  • accept-bad-signatures {true|false} β€” accept packets with no signature or a wrong one. Only does anything if a key was configured on an interface. Default false.

🌸 Filtering rules 🌸

A filtering rule is one single line, formatted like this:

              filter selector...  action

filter says which filter this entry gets added to, and it can be one of:

  • in β€” applied to routes learned from Babel neighbours
  • out β€” applied to routes announced to Babel neighbours
  • redistribute β€” applied to routes redistributed from the kernel
  • install β€” applied to routes installed into the kernel

Each selector says the conditions under which the statement matches. It can be one of:

  • ip prefix β€” only applies to routes in the given prefix.
  • eq plen β€” only applies to routes with a prefix length equal to plen.
  • le plen β€” only applies to routes with a prefix length less or equal to plen.
  • ge plen β€” only applies to routes with a prefix length greater or equal to plen.
  • src-ip prefix β€” only applies to routes with a source prefix in the given prefix.
  • src-eq plen β€” only applies to routes with a source prefix length equal to plen.
  • src-le plen β€” only applies to routes with a source prefix length less or equal to plen.
  • src-ge plen β€” only applies to routes with a source prefix length greater or equal to plen.
  • neigh address β€” only applies to routes learned from a neighbour with link-local address address.
  • id id β€” only applies to routes originated by a router with router-id id.
  • proto p β€” only applies to kernel routes with kernel protocol number p. If neither proto nor local is specified, this entry applies to all non-local kernel routes with a protocol different from "boot". πŸ’…
  • local β€” only applies to local addresses.
  • if interface β€” for an input filter, this is the interface over which the route is learned. For an output filter, it's the interface over which the route is advertised. For a redistribute statement, it's the interface over which the route forwards packets.

Action says what happens when the entry matches. It can be one of:

  • allow β€” allow this route without changing its metric (or set its metric to 0 in the case of a redistribute filter).
  • deny β€” ignore this route. bye πŸ‘‹
  • metric value β€” for an input or output filter, allow this route after increasing its metric by value. For a redistribute filter, redistribute this route with metric value.
  • src-prefix prefix β€” for a redistribute filter, set the source prefix of this route to prefix.
  • table table β€” in an install filter, specify the kernel routing table to use. For source-specific routes this only works reliably for IPv6, and only when ipv6-subtrees is true. ⚠️
  • pref-src ip β€” specify the preferred source address to use with this route. Only useful in an install filter.

If action isn't specified, it defaults to allow.

By default, babeld redistributes all local addresses, and no other routes. So if you want to be sure only the routes you specify get redistributed, you should include the line

              redistribute local deny

as the last line in your configuration file.


πŸ‘‘ LOCAL CONFIGURATION INTERFACE πŸ‘‘

If babeld is invoked with the flag -g, it accepts TCP connections from local clients on the given port and address ::1 (the IPv6 localhost address), or on the given UNIX-domain socket path if the argument starts with β€˜/’.

When a client connects, babeld replies with BABEL followed by the supported version of the local configuration protocol (currently 1.0). Then comes a number of informational lines (version etc.), terminated by ok. After that the client can send requests, one per line. To each request, babeld replies with one or more lines of data terminated by one of ok, no, or bad.

The following requests are currently defined:

  • any configuration file directive, including interface;
  • flush interface;
  • dump;
  • monitor and unmonitor;
  • quit.

🌈 EXAMPLES 🌈

You can participate in a Babel network by simply running

              # babeld wlan0

where wlan0 is the name of your wireless interface. πŸŽ€

In order to gateway between multiple interfaces, just list them all on the command line:

              # babeld wlan0 eth0 sit1

On an access point, you'll probably want to redistribute some external routes into Babel:

              # babeld \
                  -C 'redistribute metric 256' \
                  wlan0

or, if you want to constrain the routes that you redistribute,

              # babeld \
                  -C 'redistribute proto 11 ip ::/0 le 64 metric 256' \
                  -C 'redistribute proto 11 ip 0.0.0.0/0 le 24 metric 256' \
                  wlan0

πŸ¦‹ Source-specific routing πŸ¦‹

If your want to redistribute kernel routes as source-specific to the network, with the 2001:DB8:0:1::/64 prefix:

              redistribute src-prefix 2001:DB8:0:1::/64

For more information about source-specific routing, please see

              Matthieu Boutier and Juliusz Chroboczek.  Source-sensitive
              routing.  In Proc. IFIP Networking 2015.  2015.

available online at

              http://arxiv.org/pdf/1403.0445v4.pdf

πŸ’– FILES πŸ’–

  • /etc/babeld.conf β€” the default location of the configuration file.
  • /var/lib/babel-state β€” the default location of the file storing long-term state.
  • /var/run/babeld.pid β€” the default location of the pid file.
  • /var/log/babeld.log β€” the default location of the log file.

⭐ SIGNALS ⭐

  • SIGUSR1 β€” dump Babel's routing tables to standard output or to the log file.
  • SIGUSR2 β€” check interfaces and kernel routes right now, then reopen the log file.

🚨 SECURITY 🚨

Babel is a completely insecure protocol: any attacker able to inject IP packets with a link-local source address can disrupt the protocol's operation. This is no different from unsecured neighbour discovery or ARP. not great, not gonna lie 😭

Usage of the -G flag allows any user logged on the local host to change babeld's configuration. ⚠️

Since Babel uses link-local IPv6 packets only, there's no need to update firewalls to allow forwarding of Babel protocol packets. If local filtering is being done, UDP datagrams to the port used by the protocol should be allowed. And because Babel uses unicast packets in some cases, it's not enough to just allow packets destined to Babel's multicast address.


🫢 SEE ALSO 🫢

routed(8), route6d(8), zebra(8), ahcpd(8).


🌸 AUTHOR 🌸

Juliusz Chroboczek.


and that's a wrap bestie πŸ’… this whole page is from the BABELD(8) manual, and the footer is the source/version line plus the date β€” go check the original for the exact stamp, ily, bye πŸ’–βœ¨