1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00
Maximilian Wilhelm b1a2d2417b Add addon module for B.A.T.M.A.N. advanced interface configuration. #12
batman wasn't in master-next so it got removed during the last merge
this commit adds it back to master.
See PR #12

From Maximilian Wilhelm:
  This commit adds support for configuring B.A.T.M.A.N. advanced interfaces
  with ifupdown2. B.A.T.M.A.N. advanced is a protocol to build Layer2 based
  mesh networks with. It's supported in the Linux kernel and thus available
  in many Linux environments.

  A configuration could look like this

  auto bat0
  iface bat0
      batman-ifaces eth1 eth2.23
      batman-ifaces-ignore-regex .*_nodes
      batman-hop-penalty 23
      #
      address 192.0.2.42/24

  where »bat0« would be the local connection to the mesh network.

  The interfaces »eth1« and »eth2.23« would be used by the B.A.T.M.A.N. adv.
  protocol to communicate to other member of the mesh network.

  Any interfaces matching the »ifaces-ignore-regex« will be gently ignored
  by ifquery and ifreload as there might be some tunnels or interfaces
  added to the mesh network by other means which should not be removed by
  any subsequent ifreload run.

  The »hop-penalty» parameter set the penalty of this node within the mesh
  network.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>

Author: Maximilian Wilhelm <max@rfc2324.org>
2018-12-19 07:12:58 +01:00

50 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
echo "Installing batman-adv module on debian/ubuntu"
echo ""
echo "Batman is a Layer2-Mesh protocol which uses Ethernet devices (like eth*,
vlans, etc.) to communicate with peers and provides access to the L2-mesh via
a batX interface. You can only create a batman instance if at least one batman-
-iface (read: an interface where the mesh protocol is spoken on) is present and
added to the batman-mesh-instance."
echo "More info: https://en.wikipedia.org/wiki/B.A.T.M.A.N."
echo ""
echo "installing batctl: apt-get install batctl"
apt-get install batctl
echo ""
echo ""
echo "loading batman-adv module: modprobe batman-adv"
modprobe batman-adv
echo ""
echo "usefull commands:
$ batctl if add \$IFACE
$ batctl -m bat0 if add \$IFACE"
echo "please read: man batctl"
echo ""
echo ""
echo "configuration example:
$ cat /etc/network/interfaces
auto bat0
iface bat0
batman-ifaces \$IFACE [\$IFACES...]
batman-ifaces-ignore-regex .*_nodes
batman-hop-penalty 23
address 192.0.2.42/24
$
$
$ ifreload -a
$ ifquery -a -c
auto bat0
iface bat0 [pass]
batman-ifaces tap0 tap1 [pass]
batman-ifaces-ignore-regex .*_nodes [pass]
batman-hop-penalty 23 [pass]
address 192.0.2.42/24 [pass]
$"