add docs for babeld

Signed-off-by: Marek Küthe <m.k@mk16.de>
This commit is contained in:
Marek Küthe 2023-01-07 20:32:28 +01:00
parent e35df25827
commit a22e2b6350
No known key found for this signature in database
GPG Key ID: 7E869146699108C7
2 changed files with 114 additions and 1 deletions

View File

@ -0,0 +1,108 @@
# Configuring babeld
babeld is the reference implementation of the babel protocol. One difference to the bird implementation is that babeld can calculate the cost based on latency.
## Installation
In order to install the babeld on your machine you should look for a package named `babeld`. On a Debian-based system you can use:
```bash
sudo apt install babeld -y
```
To see if you have installed babeld correctly, you can view the babeld version:
```bash
babeld -V
```
If you are using a system with Systemd, you can enable babeld in the autostart:
```bash
sudo systemctl enable babeld
```
## Configuration
The babeld configuration file is normally located at `/etc/babeld.conf`.
### Full example
```
random-id true
link-detect true
default hello-interval 4
default type tunnel rtt-min 1 rtt-max 1001 max-rtt-penalty 1000 enable-timestamps true
interface <PEER> type tunnel
redistribute ip <OWNNET> eq <OWN LENGTH> allow
redistribute local deny
redistribute deny
in ip <OWNNET> deny
in ip fd00::/8 le 64 ge 44 allow
in deny
```
Replace `<OWNNET>` with your prefix and `<OWN LENGTH>` with your prefix length.
```
random-id true
```
No explicit router ID is set by this instruction. Instead, a new random ID is generated at each startup. This allows the router to integrate itself into the network more quickly after a reboot.
```
link-detect true
```
When you peer with a peer, you do so through an interface. With this instruction babeld fetches information from the operating system. If the operating system tells babeld that the interface is down, the peer on this interface is considered down.
```
default hello-interval 4
```
Here you can set the default interval in which babeld Hello should send packets to its neighbors. As with bird, 4 seconds are set here.
```
default type tunnel rtt-min 1 rtt-max 1001 max-rtt-penalty 1000 enable-timestamps true
```
This statement specifies that if a peer interface has type tunnel, the cost is equal to the latency. This only works if the peer also uses babeld.
```
interface <PEER> type tunnel
```
The individual peers are configured here. You can use `tunnel`, `wired` or `wireless` as type. Other parameters are adjusted accordingly. If you want to adjust the cost manually, you can write `rxcost <cost>`, replacing `<cost>` with the cost.
```
redistribute ip <OWNNET> eq <OWN LENGTH> allow
redistribute local deny
redistribute deny
```
Here the filters are defined, which come from the kernel into the babeld Routing Table. Only the own prefix is imported.
```
in ip <OWNNET> deny
in ip fd00::/8 le 64 ge 44 allow
in deny
```
Here the filters are defined, which routes are filtered from neighbors.
The own route is not accepted. Only ULA addresses are accepted. All other routes are filtered.
The `out` and `install` filters are omitted. The babeld routing table contains only CRXN routes. Therefore no filtering must be made with the export into the kernel or to neighbors.
### Filter
babeld has a total of five filters:
- `in`
- `out`
- `redistribute`
- `redistribute local`
- `install`
The filter `in` filters routes coming from neighbors.
The filter `out` filters routes which are sent to neighbors.
The filter `redistribute` filters routes which are imported by the kernel.
The filter `redistribute local` filters routes which are imported by the kernel and have length 128.
The `install` filter filters routes that are installed into the kernel.
By default, all filters are set to `allow`. So all routes are accepted.

View File

@ -2,6 +2,11 @@
# Routing
- [Forwarding](forwarding)
- [Create a dummy interface](create-dummy-interface)
## bird
- [Setting up Bird](bird/bird)
- [max-len filter in bird](bird/maxlen-filter)
- [Create a dummy interface](create-dummy-interface)
## babeld
- [Setting up Babeld](babeld/babeld)