README 3.27 KB
Newer Older
1
Babel
2
=====
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
3

4
Babel is a loop-avoiding distance-vector routing protocol roughly
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
5
based on HSDV and AODV, but with provisions for link cost estimation
6
and redistribution of routes from other routing protocols.
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
7 8 9


Installation
10
============
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
11

12 13
    $ make
    $ su -c 'make install'
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
14

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

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

19 20
On Mac OS X, you'll need to do

21
    $ make LDLIBS=''
22

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
23

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
24
Setting up a network for use with Babel
25
=======================================
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
26

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
27
1. Set up every node's interface
28
--------------------------------
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
29

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
30
On every node, set up the wireless interface:
31

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

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
35
2. Set up every node's IP addresses
36
-----------------------------------
37

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
38 39
You will need to make sure that all of your nodes have a unique IPv6
address, and/or a unique IPv4 address.
40

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
41
On every node, run something like:
42

43 44
    # ip addr add 192.168.13.33/32 dev eth1
    # ip -6 addr add $(generate-ipv6-address -r)/128 dev eth1
45

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
46 47 48
You will find the generate-ipv6-address utility, which can generate random
IPv6 addresses according to RFC 4193, on

49
      http://www.pps.jussieu.fr/~jch/software/files/
50 51


52 53 54 55 56 57 58 59 60 61 62
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.

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


Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
66
3. Start the routing daemon
67
---------------------------
68

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

72
    # babeld eth1
73

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
74 75
If your node has multiple interfaces which you want to participate in
the Babel network, just list them all:
76

77
    # babeld eth0 eth1 sit1
78 79


Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
80
4. Setting up an Internet gateway
81
---------------------------------
82

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
83 84
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.
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
85 86 87
Babel will only redistribute routes with an explicit protocol
attached, so you must say something like:

88
    # ip route add 0.0.0.0/0 via 1.2.3.4 dev eth0 proto static
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
89 90

In order to redistribute all routes, you will say:
91

92
    # babeld -C 'redistribute metric 128' eth1
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
93

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
94 95
You may also be more selective in the routes you redistribute, for
instance by specifying the interface over which the route goes out:
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
96

97
    # babeld -C 'redistribute if eth0 metric 128' eth1
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
98

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
99
or by constraining the prefix length:
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
100

101 102 103
    # babeld -C 'redistribute ip ::/0 le 64 metric 128' \
             -C 'redistribute ip 0.0.0.0/0 le 28 metric 128' \
             eth1
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
104

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
105 106
You may also want to constrain which local routes (routes to local
interface addresses) you advertise:
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
107

108 109 110
    # babeld -C 'redistribute local if eth1' -C 'redistribute local deny' \
             -C 'redistribute metric 128' \
             eth1
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
111 112 113 114

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:

115
    http://www.pps.jussieu.fr/~jch/software/ahcp/
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
116

117
-- Juliusz Chroboczek