Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Octocat-spinner-32 .gitattributes Add .gitattributes. August 03, 2011
Octocat-spinner-32 .gitignore Add .gitignore file. July 30, 2011
Octocat-spinner-32 CHANGES Update CHANGES for 1.4.3. November 15, 2013
Octocat-spinner-32 LICENCE Update copyright date in LICENCE. January 03, 2008
Octocat-spinner-32 Makefile Rename network.{c,h} to interface.{c,h}. September 09, 2011
Octocat-spinner-32 README Update website address. December 01, 2013
Octocat-spinner-32 babeld.c Prevent a DoS by making the local interface non-blocking July 09, 2013
Octocat-spinner-32 babeld.h Make filenames variables "const". June 24, 2013
Octocat-spinner-32 Add random-id option to config file. June 24, 2013
Octocat-spinner-32 configuration.c Fix merging of interfaces in add_ifconf. June 24, 2013
Octocat-spinner-32 configuration.h Add support for default parameters to config parser. June 12, 2013
Octocat-spinner-32 interface.c Move some code around in interface_up. June 19, 2013
Octocat-spinner-32 interface.h Remove support for idle detection (-i). February 11, 2012
Octocat-spinner-32 kernel.c Add ability to get routes from multiple kernel tables. June 15, 2013
Octocat-spinner-32 kernel.h Add ability to get routes from multiple kernel tables. June 15, 2013
Octocat-spinner-32 kernel_netlink.c Better error handling when setup interface. June 27, 2013
Octocat-spinner-32 kernel_socket.c BSD: do not attempt atomic route changes. July 11, 2013
Octocat-spinner-32 local.c Make a function static (no previous prototype). June 24, 2013
Octocat-spinner-32 local.h Support multiple local clients. April 11, 2013
Octocat-spinner-32 message.c Give names to the various types of sub-TLV November 07, 2013
Octocat-spinner-32 message.h Give names to the various types of sub-TLV November 07, 2013
Octocat-spinner-32 neighbour.c Cap neighbour cost to INFINITY July 24, 2013
Octocat-spinner-32 neighbour.h Rename struct network to interface and associated changes. September 09, 2011
Octocat-spinner-32 net.c Fix headers for NetBSD November 08, 2013
Octocat-spinner-32 net.h Implement tcp_server_socket. March 31, 2008
Octocat-spinner-32 resend.c Make resends less aggressive. February 11, 2012
Octocat-spinner-32 resend.h Make resends less aggressive. February 11, 2012
Octocat-spinner-32 route.c Fix flush_all_routes : wasn't uninstalling the right one. June 13, 2013
Octocat-spinner-32 route.h Implement route selection using a smoothed metric. July 16, 2012
Octocat-spinner-32 source.c Add comment in update_source. November 25, 2011
Octocat-spinner-32 source.h Add reference counting to the source table. October 16, 2011
Octocat-spinner-32 util.c Implement parse_nat, an error-checking variant of atoi. July 16, 2012
Octocat-spinner-32 util.h Implement parse_nat, an error-checking variant of atoi. July 16, 2012
Octocat-spinner-32 xroute.c Use local variables in for_all_*routes. December 03, 2012
Octocat-spinner-32 xroute.h Implement xroutes_estimate. October 18, 2011

Babel is a loop-avoiding distance-vector routing protocol roughly
based on HSDV and AODV, but with provisions for link cost estimation
and redistribution of routes from other routing protocols.


    $ make
    $ su -c 'make install'

If compiling for OpenWRT, you will probably want to say something like

    $ make CC=mipsel-linux-gcc PLATFORM_DEFINES='-march=mips32'

On Mac OS X, you'll need to do

    $ make LDLIBS=''

Setting up a network for use with Babel

1. Set up every node's interface

On every node, set up the wireless interface:

    # iwconfig eth1 mode ad-hoc channel 11 essid "my-mesh-network"
    # ip link set up dev eth1

2. Set up every node's IP addresses

You will need to make sure that all of your nodes have a unique IPv6
address, and/or a unique IPv4 address.

On every node, run something like:

    # ip addr add dev eth1
    # ip -6 addr add $(generate-ipv6-address -r)/128 dev eth1

You will find the generate-ipv6-address utility, which can generate random
IPv6 addresses according to RFC 4193, on

A note about tunnels and VPNs

Some VPN implementations (notably OpenVPN and Linux GRE) do not
automatically add an IPv6 link-local address to the tunnel interface.
If you attempt to run Babel over such an interface, it will complain
that it ``couldn't allocate requested address''.

The solution is to manually add the link-local address to the
interface.  This can be done by running e.g.

    # ip -6 addr add $(ahcp-generate-address fe80::) dev gre0

3. Start the routing daemon

Run Babel on every node, specifying the set of interfaces that it
should consider:

    # babeld eth1

If your node has multiple interfaces which you want to participate in
the Babel network, just list them all:

    # babeld eth0 eth1 sit1

4. Setting up an Internet gateway

If you have one or more Internet gateways on your mesh network, you
will want to set them up so that they redistribute the default route.
Babel will only redistribute routes with an explicit protocol
attached, so you must say something like:

    # ip route add via dev eth0 proto static

In order to redistribute all routes, you will say:

    # babeld -C 'redistribute metric 128' eth1

You may also be more selective in the routes you redistribute, for
instance by specifying the interface over which the route goes out:

    # babeld -C 'redistribute if eth0 metric 128' eth1

or by constraining the prefix length:

    # babeld -C 'redistribute ip ::/0 le 64 metric 128' \
             -C 'redistribute ip le 28 metric 128' \

You may also want to constrain which local routes (routes to local
interface addresses) you advertise:

    # babeld -C 'redistribute local if eth1' -C 'redistribute local deny' \
             -C 'redistribute metric 128' \

If you find all of this too complicated and error-prone (as I do), you
may want to consider autoconfiguring your routing domain using AHCP:

-- Juliusz Chroboczek
Something went wrong with that request. Please try again.