README 3.17 KB
Newer Older
1 2
Babel
*****
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 10 11 12 13 14


Installation
************

  $ make
  $ su -c 'make install'

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

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

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
19

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
20
Setting up a network for use with Babel
21
***************************************
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
22

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
23 24
1. Set up every node's interface
================================
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
25

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

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
28
  # iwconfig eth1 mode ad-hoc channel 11 essid "my-mesh-network"
29
  # ip link set up dev eth1
30

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
31 32
2. Set up every node's IP addresses
===================================
33

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

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
37
On every node, run something like:
38

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
39 40
  # ip addr add 192.168.13.33/32 dev eth1
  # ip -6 addr add $(ahcp-generate-address -r)/128 dev eth1
41

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
42 43
You will find the ahcp-generate-address utility, which can generate
random IPv6 addresses according to RFC 4193, in the ahcpd package.
44 45


46 47 48 49 50 51 52 53 54 55 56 57 58 59
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


Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
60 61
3. Start the routing daemon
===========================
62

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

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
66
  # babel eth1
67

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

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
71
  # babel eth0 eth1 sit1
72 73


Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
74 75
4. Setting up an Internet gateway
=================================
76

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
77 78
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
79 80 81 82 83 84
Babel will only redistribute routes with an explicit protocol
attached, so you must say something like:

  # ip route add 0.0.0.0/0 via 1.2.3.4 dev eth0 proto static

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

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
86
  # babel -C 'redistribute metric 128' eth1
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
87

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
88 89
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
90

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
91
  # babel -C 'redistribute if eth0 metric 128' eth1
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
92

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
93
or by constraining the prefix length:
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
94

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
95 96
  # babel -C 'redistribute ip ::/0 le 64 metric 128' \
          -C 'redistribute ip 0.0.0.0/0 le 28 metric 128' \
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
97
          eth1
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
98

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
99 100
You may also want to constrain which local routes (routes to local
interface addresses) you advertise:
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
101

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
102 103 104
  # babel -C 'redistribute local if eth1' -C 'redistribute local deny' \
          -C 'redistribute metric 128' \
          eth1
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
105 106 107 108 109

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:

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

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
111
                                        Juliusz Chroboczek