1BABELD(8) System Manager's Manual BABELD(8)
2
3
4
6 babeld - ad-hoc network routing daemon
7
9 babeld option... [ -- ] interface...
10
12 Babel is a loop-avoiding distance-vector routing protocol roughly based
13 on DSDV and AODV, but with provisions for link cost estimation and re‐
14 distribution of routes from other routing protocols.
15
16 While it is optimised for wireless mesh networks, Babel will also work
17 efficiently on wired networks.
18
20 -V Display babeld's version and quit.
21
22 -m multicast-address
23 Specify the link-local multicast address to be used by the pro‐
24 tocol. The default is ff02:0:0:0:0:0:1:6.
25
26 -p port
27 Specify the UDP port number to be used by the protocol. The de‐
28 fault is 6696.
29
30 -S state-file
31 Set the name of the file used for preserving long-term informa‐
32 tion between invocations of the babeld daemon. If this file is
33 deleted, the daemon will run in passive mode for 3 minutes when
34 it is next started, and other hosts might initially ignore it.
35 The default is /var/lib/babel-state.
36
37 -h hello-interval
38 Specify the interval in seconds at which scheduled hello packets
39 are sent on wireless interfaces. The default is 4 seconds.
40
41 -H wired-hello-interval
42 Specify the interval in seconds at which scheduled hello packets
43 are sent on wired interfaces. The default is 4 seconds.
44
45 -z kind [,factor]
46 Enable diversity-sensitive routing. The value kind defines the
47 diversity algorithm used, and can be one of 0 (no diversity), 1
48 (per-interface diversity with no memory), 2 (per-channel diver‐
49 sity with no memory), or 3 (per-channel diversity with memory).
50 The value factor specifies by how much the cost of non-interfer‐
51 ing routes is multiplied, in units of 1/256; the default is 128
52 (i.e. division by 2).
53
54 -M half-time
55 Specify the half-time in seconds of the exponential decay used
56 for smoothing metrics for performing route selection; the value
57 0 disables smoothing. The default is 4s.
58
59 -k priority
60 Specify the priority value used when installing routes into the
61 kernel. The default is 0.
62
63 -A priority
64 Allow duplicating external routes when their kernel priority is
65 at least priority. Do not use this option unless you know what
66 you are doing, as it can cause persistent route flapping.
67
68 -l Use IFF_RUNNING (carrier sense) when determining interface
69 availability.
70
71 -w Don't optimise wired links, assume all interfaces are wireless
72 unless explicitly overridden in the configuration file.
73
74 -s Do not perform split-horizon processing on wired interfaces.
75 Split-horizon is not performed on wireless interfaces.
76
77 -r Use a random router-id. The default is to use persistent
78 router-ids derived from the MAC address of the first interface,
79 which is easier to debug and more reliably prevents routing
80 loops but may sometimes cause a node to be unreachable for 120
81 seconds just after boot.
82
83 -d level
84 Debug level. A value of 1 requests a routing table dump at ev‐
85 ery iteration through the daemon's main loop. A value of 2 ad‐
86 ditionally requests tracing every message sent or received. A
87 value of 3 additionally dumps all interactions with the OS ker‐
88 nel. The default is 0.
89
90 -g port, -g path
91 Set up a local configuration server on port port or at path in
92 read-only mode. The protocol is described in the section Local
93 Configuration Protocol below.
94
95 -G port, -G path
96 Set up a local configuration server on port port or at path in
97 read-write mode. This allows any local user to change babeld's
98 configuration, and may therefore be a security issue.
99
100 -t table
101 Use the given kernel routing table for routes inserted by ba‐
102 beld.
103
104 -T table
105 Export routes from the given kernel routing table. This can be
106 specified multiple times in order to export routes from more
107 than one table.
108
109 -c filename
110 Specify the name of the configuration file. This flag can be
111 repeated multiple times. The default is /etc/babeld.conf.
112
113 -C statement
114 Specify a configuration statement directly on the command line.
115
116 -D Daemonise at startup.
117
118 -L logfile
119 Specify a file to log random ``how do you do?'' messages to.
120 This defaults to standard error if not daemonising, and to
121 /var/log/babeld.log otherwise.
122
123 -I pidfile
124 Specify a file to write our process id to, use no pidfile if set
125 to the empty string. The default is /var/run/babeld.pid.
126
127 interface...
128 The list of interfaces on which the protocol should operate.
129
131 The configuration file is a sequence of lines each of which specifies a
132 global option, an interface specification or a filtering rule. Com‐
133 ments are introduced by an octothorp ``#'' and terminate at the end of
134 the line.
135
136 Global options
137 protocol-group group
138 This specifies the link-local multicast address to be used by
139 the protocol, and is equivalent to the command-line option -m.
140
141 protocol-port port
142 This specifies the UDP port number to be used by the protocol,
143 and is equivalent to the command-line option -p.
144
145 kernel-priority priority
146 This specifies the priority value used when installing routes
147 into the kernel, and is equivalent to the command-line option
148 -k.
149
150 reflect-kernel-metric {true|false}
151 Reflect route metrics as kernel priorities. The priority effec‐
152 tively used is kernel-priority + metric.
153
154 allow-duplicates priority
155 This allows duplicating external routes when their kernel prior‐
156 ity is at least priority. Do not use this option unless you
157 know what you are doing, as it can cause persistent route flap‐
158 ping.
159
160 random-id {true|false}
161 This specifies whether to use a random router-id, and is equiva‐
162 lent to the command-line option -r.
163
164 ipv6-subtrees {true|false}
165 This specifies whether to use native source-specific IPv6 for‐
166 warding rather than multiple routing tables. The default is
167 chosen automatically depending on the kernel version.
168
169 debug level
170 This specifies the debugging level, and is equivalent to the
171 command-line option -d.
172
173 local-port port
174 This specifies the TCP port on which babeld will listen for con‐
175 nections from a configuration client in read-only mode, and is
176 equivalent to the command-line option -g.
177
178 local-port-readwrite port
179 This specifies the TCP port on which babeld will listen for con‐
180 nections from a configuration client in read-write mode, and is
181 equivalent to the command-line option -G. This allows any local
182 user to change babeld's configuration, and may therefore be a
183 security issue.
184
185 local-path path
186 This specifies the filesystem path to a socket on which babeld
187 will listen for connections from a configuration client in read-
188 only mode, and is equivalent to the command-line option -g.
189
190 local-path-readwrite path
191 This specifies the filesystem path to a socket on which babeld
192 will listen for connections from a configuration client in read-
193 write mode, and is equivalent to the command-line option -G.
194 Any user with write access to that socket will be able to change
195 babeld's configuration.
196
197 export-table table
198 This specifies the kernel routing table to use for routes in‐
199 serted by babeld, and is equivalent to the command-line option
200 -t.
201
202 import-table table
203 This specifies a kernel routing table from which routes are re‐
204 distributed by babeld, and can be specified multiple times with
205 a cumulative effect. This is equivalent to the command-line op‐
206 tion -T.
207
208 link-detect {true|false}
209 This specifies whether to use carrier sense for determining in‐
210 terface availability, and is equivalent to the command-line op‐
211 tion -l.
212
213 diversity {true|false|kind}
214 This specifies the diversity algorithm to use; true is equiva‐
215 lent to kind 3. The default is false (do not use any diversity
216 algorithm).
217
218 diversity-factor factor
219 This specifies by how much the cost of non-interfering routes
220 should be multiplied, in units of 1/256. The default is 128
221 (division by 2).
222
223 smoothing-half-life seconds
224 This specifies the half-life in seconds of the exponential decay
225 used for smoothing metrics for performing route selection, and
226 is equivalent to the command-line option -M.
227
228 daemonise {true|false}
229 This specifies whether to daemonize at startup, and is equiva‐
230 lent to the command-line option -D.
231
232 skip-kernel-setup {true|false}
233 If this flag is set, no kernel (sysctl) setup is performed on
234 startup, and it is assumed that enabling forwarding, disabling
235 redirects and disabling the reverse-path filter is performed by
236 other means. This can be useful when running in environments
237 where system permissions prevent setting kernel parameters, for
238 instance without root permissions or inside a Linux container.
239
240 router-id id
241 Specify the router-id explicitly, as a modified EUI-64 or a
242 MAC-48 address. If two nodes have the same router-id, bad
243 things will happen. Don't use this option unless you know what
244 you are doing.
245
246 state-file filename
247 This specifies the name of the file used for preserving long-
248 term information between invocations of the babeld daemon, and
249 is equivalent to the command-line option -S.
250
251 log-file filename
252 This specifies the name of the file used to log random messages
253 to, and is equivalent to the command-line option -L.
254
255 pid-file filename
256 This specifies the name of the file to which babeld writes out
257 its process id, and is equivalent to the command-line option -I.
258
259 Interface configuration
260 An interface is configured by a line with the following format:
261
262 interface name [parameter...]
263
264 where name is the name of the interface (something like eth0). The de‐
265 fault value of an interface parameter can be specified changed by a
266 line of the form
267
268 default [parameter...]
269
270 Each parameter can be one of:
271
272 type {auto|wired|wireless|tunnel}
273
274 The default is auto unless the -w command-line flag was speci‐
275 fied.
276
277 link-quality {true|false|auto}
278 This specifies whether link quality estimation should be per‐
279 formed on this interface. The default is to perform link qual‐
280 ity estimation on wireless interfaces only.
281
282 split-horizon {true|false|auto}
283 This specifies whether to perform split-horizon processing on
284 this interface. The default is to perform split-horizon pro‐
285 cessing on on wired interfaces, unless the -s flag was set.
286
287 rxcost cost
288 This defines the cost of receiving frames on the given interface
289 under ideal conditions (no packet loss); how this relates to the
290 actual cost used for computing metrics of routes going through
291 this interface depends on whether link quality estimation is be‐
292 ing done. The default is 256 if the interface is wireless, and
293 96 otherwise.
294
295 channel channel
296 Sets the channel for this interface. The value channel can be
297 either an integer, or one of the strings interfering or nonin‐
298 terfering. The default is to autodetect the channel number for
299 wireless interfaces, and noninterfering for other interfaces.
300
301 faraway {true|false}
302 This specifies whether the network is "far away", in the sense
303 that networks behind it don't interfere with networks in front
304 of it. By default, networks are not far away.
305
306 hello-interval interval
307 This defines the interval between hello packets sent on this in‐
308 terface. The default is specified with the -h and -H command-
309 line flags.
310
311 update-interval interval
312 This defines the interval between full routing table dumps sent
313 on this interface; since Babel uses triggered updates and
314 doesn't count to infinity, this can be set to a fairly large
315 value, unless significant packet loss is expected. The default
316 is four times the hello interval.
317
318 enable-timestamps {true|false}
319 Enable sending timestamps with each Hello and IHU message in or‐
320 der to compute RTT values. The default is true for tunnel in‐
321 terfaces, and false otherwise.
322
323 unicast {true|false}
324 Send multiple copies of TLVs other than Hellos to all neighbours
325 rather than sending a single multicast packet. The default is
326 false.
327
328 rfc6126-compatible {true|false}
329 Disable some features that are incompatible with RFC 6126 (the
330 older version of the Babel protocol), such as source-specific
331 routing and RTT estimation over unicast. The default is false.
332
333 rtt-decay decay
334 This specifies the decay factor for the exponential moving aver‐
335 age of RTT samples, in units of 1/256. Must be between 1 and
336 256, inclusive. Higher values discard old samples faster. The
337 default is 42.
338
339 rtt-min rtt
340 This specifies the minimum RTT, in milliseconds, starting from
341 which we increase the cost to a neighbour. The additional cost
342 is linear in (rtt - rtt-min). The default is 10 ms.
343
344 rtt-max rtt
345 This specifies the maximum RTT, in milliseconds, above which we
346 don't increase the cost to a neighbour. The default is 120 ms.
347
348 max-rtt-penalty cost
349 This specifies the maximum cost added to a neighbour because of
350 RTT, i.e. when the RTT is higher or equal than rtt-max. The de‐
351 fault is 96 if the interface is of type tunnel, and 0 otherwise.
352
353 Filtering rules
354 A filtering rule is defined by a single line with the following format:
355
356 filter selector... action
357
358 Filter specifies the filter to which this entry will be added, and can
359 be one of in (applied to routes learned from Babel neighbours), out
360 (applied to routes announced to Babel neighbours), redistribute (ap‐
361 plied to routes redistributed from the kernel), or install (applied to
362 routes installed into the kernel).
363
364 Each selector specifies the conditions under which the given statement
365 matches. It can be one of
366
367 ip prefix
368 This entry only applies to routes in the given prefix.
369
370 eq plen
371 This entry only applies to routes with a prefix length equal to
372 plen.
373
374 le plen
375 This entry only applies to routes with a prefix length less or
376 equal to plen.
377
378 ge plen
379 This entry only applies to routes with a prefix length greater
380 or equal to plen.
381
382 src-ip prefix
383 This entry only applies to routes with a source prefix in the
384 given prefix.
385
386 src-eq plen
387 This entry only applies to routes with a source prefix length
388 equal to plen.
389
390 src-le plen
391 This entry only applies to routes with a source prefix length
392 less or equal to plen.
393
394 src-ge plen
395 This entry only applies to routes with a source prefix length
396 greater or equal to plen.
397
398 neigh address
399 This entry only applies to routes learned from a neighbour with
400 link-local address address.
401
402 id id This entry only applies to routes originated by a router with
403 router-id id.
404
405 proto p
406 This entry only applies to kernel routes with kernel protocol
407 number p. If neither proto nor local is specified, this entry
408 applies to all non-local kernel routes with a protocol different
409 from "boot".
410
411 local This entry only applies to local addresses.
412
413 if interface
414 For an input filter, this specifies the interface over which the
415 route is learned. For an output filter, this specifies the in‐
416 terface over which this route is advertised. For a redistribute
417 statement, this specifies the interface over which the route
418 forwards packets.
419
420 Action specifies the action to be taken when this entry matches. It
421 can have one of the following values:
422
423 allow Allow this route, without changing its metric (or setting its
424 metric to 0 in case of a redistribute filter).
425
426 deny Ignore this route.
427
428 metric value
429 For an input or output filter, allow this route after increasing
430 its metric by value. For a redistribute filter, redistribute
431 this route with metric value.
432
433 src-prefix prefix
434 For a redistribute filter, set the source prefix of this route
435 to prefix.
436
437 table table
438 In an install filter, specify the kernel routing table to use.
439 For source-specific routes, this only works reliably for IPv6,
440 and only when ipv6-subtrees is true.
441
442 pref-src ip
443 Specify the preferred source address to use with this route.
444 Only useful in an install filter.
445
446 If action is not specified, it defaults to allow.
447
448 By default, babeld redistributes all local addresses, and no other
449 routes. In order to make sure that only the routes you specify are re‐
450 distributed, you should include the line
451
452 redistribute local deny
453
454 as the last line in your configuration file.
455
457 If babeld is invoked with the flag -g, it accepts TCP connections from
458 local clients on the given port and address ::1 (the IPv6 localhost ad‐
459 dress), or on the given UNIX-domain socket path if the argument starts
460 with ‘/’. When a client connects, babeld replies with BABEL followed
461 with the supported version of the local configuration protocol (cur‐
462 rently 1.0). This is followed with a number of informational lines
463 (version etc.), terminated by ok. The client can then send requests,
464 one per line. To each request, babeld replies with one or more lines
465 of data terminated by one of ok, no, or bad.
466
467 The following requests are currently defined:
468
469 • any configuration file directive, including interface;
470
471 • flush interface;
472
473 • dump;
474
475 • monitor and unmonitor;
476
477 • quit.
478
480 You can participate in a Babel network by simply running
481
482 # babeld wlan0
483
484 where wlan0 is the name of your wireless interface.
485
486 In order to gateway between multiple interfaces, just list them all on
487 the command line:
488
489 # babeld wlan0 eth0 sit1
490
491 On an access point, you'll probably want to redistribute some external
492 routes into Babel:
493
494 # babeld \
495 -C 'redistribute metric 256' \
496 wlan0
497
498 or, if you want to constrain the routes that you redistribute,
499
500 # babeld \
501 -C 'redistribute proto 11 ip ::/0 le 64 metric 256' \
502 -C 'redistribute proto 11 ip 0.0.0.0/0 le 24 metric 256' \
503 wlan0
504
505 Source-specific routing
506 If your want to redistribute kernel routes as source-specific to the
507 network, with the 2001:DB8:0:1::/64 prefix:
508
509 redistribute src-prefix 2001:DB8:0:1::/64
510
511 For more information about source-specific routing, please see
512
513 Matthieu Boutier and Juliusz Chroboczek. Source-sensitive rout‐
514 ing. In Proc. IFIP Networking 2015. 2015.
515
516 available online at
517
518 http://arxiv.org/pdf/1403.0445v4.pdf
519
521 /etc/babeld.conf
522 The default location of the configuration file.
523
524 /var/lib/babel-state
525 The default location of the file storing long-term state.
526
527 /var/run/babeld.pid
528 The default location of the pid file.
529
530 /var/log/babeld.log
531 The default location of the log file.
532
534 SIGUSR1
535 Dump Babel's routing tables to standard output or to the log
536 file.
537
538 SIGUSR2
539 Check interfaces and kernel routes right now, then reopen the
540 log file.
541
543 Babel is a completely insecure protocol: any attacker able to inject IP
544 packets with a link-local source address can disrupt the protocol's op‐
545 eration. This is no different from unsecured neighbour discovery or
546 ARP.
547
548 Usage of the -G flag allows any user logged on the local host to change
549 babeld's configuration.
550
551 Since Babel uses link-local IPv6 packets only, there is no need to up‐
552 date firewalls to allow forwarding of Babel protocol packets. If local
553 filtering is being done, UDP datagrams to the port used by the protocol
554 should be allowed. As Babel uses unicast packets in some cases, it is
555 not enough to just allow packets destined to Babel's multicast address.
556
558 routed(8), route6d(8), zebra(8), ahcpd(8).
559
561 Juliusz Chroboczek.
562
563
564
565 BABELD(8)