Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52735a6f authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Simon Wunderlich
Browse files

batman-adv: Drop documentation about sysfs files



The sysfs files will be marked as deprecated in the near future. They
are already replaced by the batadv generic netlink family. The
documentation should not advertise its usage anymore and instead
promote the generic netlink family and a userspace tool to access it.

Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
parent 4c35e15a
Loading
Loading
Loading
Loading
+24 −67
Original line number Original line Diff line number Diff line
@@ -27,24 +27,8 @@ Load the batman-adv module into your kernel::
  $ insmod batman-adv.ko
  $ insmod batman-adv.ko


The module is now waiting for activation. You must add some interfaces on which
The module is now waiting for activation. You must add some interfaces on which
batman can operate. After loading the module batman advanced will scan your
batman-adv can operate. The batman-adv soft-interface can be created using the
systems interfaces to search for compatible interfaces. Once found, it will
iproute2 tool ``ip``::
create subfolders in the ``/sys`` directories of each supported interface,
e.g.::

  $ ls /sys/class/net/eth0/batman_adv/
  elp_interval iface_status mesh_iface throughput_override

If an interface does not have the ``batman_adv`` subfolder, it probably is not
supported. Not supported interfaces are: loopback, non-ethernet and batman's
own interfaces.

Note: After the module was loaded it will continuously watch for new
interfaces to verify the compatibility. There is no need to reload the module
if you plug your USB wifi adapter into your machine after batman advanced was
initially loaded.

The batman-adv soft-interface can be created using the iproute2 tool ``ip``::


  $ ip link add name bat0 type batadv
  $ ip link add name bat0 type batadv


@@ -52,38 +36,37 @@ To activate a given interface simply attach it to the ``bat0`` interface::


  $ ip link set dev eth0 master bat0
  $ ip link set dev eth0 master bat0


Repeat this step for all interfaces you wish to add. Now batman starts
Repeat this step for all interfaces you wish to add. Now batman-adv starts
using/broadcasting on this/these interface(s).
using/broadcasting on this/these interface(s).


By reading the "iface_status" file you can check its status::

  $ cat /sys/class/net/eth0/batman_adv/iface_status
  active

To deactivate an interface you have to detach it from the "bat0" interface::
To deactivate an interface you have to detach it from the "bat0" interface::


  $ ip link set dev eth0 nomaster
  $ ip link set dev eth0 nomaster


The same can also be done using the batctl interface subcommand::

  batctl -m bat0 interface create
  batctl -m bat0 interface add -M eth0

To detach eth0 and destroy bat0::


All mesh wide settings can be found in batman's own interface folder::
  batctl -m bat0 interface del -M eth0
  batctl -m bat0 interface destroy


  $ ls /sys/class/net/bat0/mesh/
There are additional settings for each batadv mesh interface, vlan and hardif
  aggregated_ogms       fragmentation isolation_mark routing_algo
which can be modified using batctl. Detailed information about this can be found
  ap_isolation          gw_bandwidth  log_level      vlan0
in its manual.
  bonding               gw_mode       multicast_mode
  bridge_loop_avoidance gw_sel_class  network_coding
  distributed_arp_table hop_penalty   orig_interval


Some files allow to change batman-adv's behaviour to better fit your
For instance, you can check the current originator interval (value
requirements. For instance, you can check the current originator interval (value
in milliseconds which determines how often batman-adv sends its broadcast
in milliseconds which determines how often batman sends its broadcast packets)::
packets)::


  $ cat /sys/class/net/bat0/mesh/orig_interval
  $ batctl -M bat0 orig_interval
  1000
  1000


and also change its value::
and also change its value::


  $ echo 3000 > /sys/class/net/bat0/mesh/orig_interval
  $ batctl -M bat0 orig_interval 3000


In very mobile scenarios, you might want to adjust the originator interval to a
In very mobile scenarios, you might want to adjust the originator interval to a
lower value. This will make the mesh more responsive to topology changes, but
lower value. This will make the mesh more responsive to topology changes, but
@@ -142,37 +125,11 @@ Those additional debug messages can be accessed using the perf infrastructure::
  $ trace-cmd stream -e batadv:batadv_dbg
  $ trace-cmd stream -e batadv:batadv_dbg


The additional debug output is by default disabled. It can be enabled during
The additional debug output is by default disabled. It can be enabled during
run time. Following log_levels are defined:
run time::


.. flat-table::
  $ batctl -m bat0 loglevel routes tt


   * - 0
will enable debug messages for when routes and translation table entries change.
     - All debug output disabled
   * - 1
     - Enable messages related to routing / flooding / broadcasting
   * - 2
     - Enable messages related to route added / changed / deleted
   * - 4
     - Enable messages related to translation table operations
   * - 8
     - Enable messages related to bridge loop avoidance
   * - 16
     - Enable messages related to DAT, ARP snooping and parsing
   * - 32
     - Enable messages related to network coding
   * - 64
     - Enable messages related to multicast
   * - 128
     - Enable messages related to throughput meter
   * - 255
     - Enable all messages

The debug output can be changed at runtime using the file
``/sys/class/net/bat0/mesh/log_level``. e.g.::

  $ echo 6 > /sys/class/net/bat0/mesh/log_level

will enable debug messages for when routes change.


Counters for different types of packets entering and leaving the batman-adv
Counters for different types of packets entering and leaving the batman-adv
module are available through ethtool::
module are available through ethtool::