Repository : ssh://git@diktynna/batctl
On branch : master
commit 233f44ee5fca8aa6f27c8aa8fefb00f8d604d103 Author: Sven Eckelmann sven@narfation.org Date: Fri May 14 15:37:01 2021 +0200
batctl: Reorder and clean up README
The readme was completely unordered, contained wrong entries and was missing entries for some commands. Cleaning this up a little bit should make it easier for the new commands to find the correct place in this file.
Signed-off-by: Sven Eckelmann sven@narfation.org
233f44ee5fca8aa6f27c8aa8fefb00f8d604d103 README.rst | 862 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 495 insertions(+), 367 deletions(-)
diff --git a/README.rst b/README.rst index 9c55ad5..ab5fa84 100644 --- a/README.rst +++ b/README.rst @@ -16,7 +16,7 @@ settings.
How does it work ? -================== +------------------
batctl uses the raw packet sockets to inject custom icmp packets into the data flow. That's why ping and traceroute work almost like their IP based @@ -26,7 +26,7 @@ recognize the packets.
The bat-hosts file -================== +------------------
This file is similar to the /etc/hosts file. You can write one MAC address and one host name per line. batctl will analyze the file to find the matching MAC @@ -34,8 +34,55 @@ address to your provided host name. Host names are much easier to remember than MAC addresses. ;)
+Commands +======== + + +batctl interface +---------------- + +display or modify the interface settings + +Usage:: + + batctl interface|if [add|del iface(s)] + +Example:: + + $ batctl interface + eth0: active + + +batctl ping +----------- + +Sends a Layer 2 batman-adv ping to check round trip time and connectivity + +Usage:: + + batctl ping [parameters] mac|bat-host|host-name|IP-address + parameters: + -c ping packet count + -h print this help + -i interval in seconds + -t timeout in seconds + -T don't try to translate mac to originator address + -R record route + +Example:: + + $ batctl ping fe:fe:00:00:09:01 + PING fe:fe:00:00:09:01 (fe:fe:00:00:09:01) 19(47) bytes of data + 19 bytes from fe:fe:00:00:09:01 icmp_seq=1 ttl=43 time=8.74 ms + 19 bytes from fe:fe:00:00:09:01 icmp_seq=2 ttl=43 time=7.48 ms + 19 bytes from fe:fe:00:00:09:01 icmp_seq=3 ttl=43 time=8.23 ms + ^C--- fe:fe:00:00:09:01 ping statistics --- + 3 packets transmitted, 3 received, 0% packet loss + rtt min/avg/max/mdev = 7.476/8.151/8.743/1.267 ms + + batctl statistics -================= +-----------------
The batman-adv kernel module maintains a number of traffic counters which are exported to user space. With batctl these counters can be easily retrieved. The output may vary @@ -84,84 +131,8 @@ Example:: dat_reply_rx: 0
-batctl translate -================ - -Translates a destination (hostname, IPv4, IPv6, MAC, bat_host-name) to the -originator mac address responsible for it. - -Usage:: - - batctl translate mac|bat-host|host-name|IP-address - -Example:: - - $ batctl translate www.google.de - 02:ca:fe:af:fe:01 - $ batctl translate 02:ca:fe:af:fe:01 - 02:ca:fe:af:fe:01 - $ batctl translate 192.168.1.2 - 02:ca:fe:af:fe:05 - $ batctl translate fe:fe:00:00:09:01 - 02:ca:fe:af:fe:05 - $ batctl translate 2001::1 - 02:ca:fe:af:fe:05 - - -batctl ping -=========== - -Sends a Layer 2 batman-adv ping to check round trip time and connectivity - -Usage:: - - batctl ping [parameters] mac|bat-host|host-name|IP-address - parameters: - -c ping packet count - -h print this help - -i interval in seconds - -t timeout in seconds - -T don't try to translate mac to originator address - -R record route - -Example:: - - $ batctl ping fe:fe:00:00:09:01 - PING fe:fe:00:00:09:01 (fe:fe:00:00:09:01) 19(47) bytes of data - 19 bytes from fe:fe:00:00:09:01 icmp_seq=1 ttl=43 time=8.74 ms - 19 bytes from fe:fe:00:00:09:01 icmp_seq=2 ttl=43 time=7.48 ms - 19 bytes from fe:fe:00:00:09:01 icmp_seq=3 ttl=43 time=8.23 ms - ^C--- fe:fe:00:00:09:01 ping statistics --- - 3 packets transmitted, 3 received, 0% packet loss - rtt min/avg/max/mdev = 7.476/8.151/8.743/1.267 ms - - -batctl traceroute -================= - -Traceroute sends 3 packets to each hop, awaits the answers and prints out the -response times. - -Usage:: - - batctl traceroute [parameters] mac|bat-host|host-name|IP-address - -Example:: - - $ batctl traceroute fe:fe:00:00:09:01 - traceroute to fe:fe:00:00:09:01 (fe:fe:00:00:09:01), 50 hops max, 19 byte packets - 1: fe:fe:00:00:02:01 4.932 ms 2.338 ms 1.333 ms - 2: fe:fe:00:00:03:01 6.860 ms 1.579 ms 1.260 ms - 3: fe:fe:00:00:04:01 2.342 ms 1.547 ms 1.655 ms - 4: fe:fe:00:00:05:01 2.906 ms 2.211 ms 2.253 ms - 5: fe:fe:00:00:06:01 3.577 ms 2.687 ms 3.088 ms - 6: fe:fe:00:00:07:01 4.217 ms 5.741 ms 3.551 ms - 7: fe:fe:00:00:08:01 5.017 ms 5.547 ms 4.294 ms - 8: fe:fe:00:00:09:01 5.730 ms 4.970 ms 6.437 ms - - batctl tcpdump -============== +--------------
tcpdump layer 2 and/or layer 3 traffic on the given interface
@@ -207,126 +178,217 @@ Example output for tcpdump:: 01:51:44.381064 BAT kansas: OGM via neigh kansas, seqno 6720, tq 255, ttl 50, v 9, flags [..I], length 28
-batctl bisect_iv -================ +batctl traceroute +-----------------
-Analyzes the B.A.T.M.A.N. IV logfiles to build a small internal database of all sent sequence -numbers and routing table changes. This database can be used to search for routing loops -(default action), to trace OGMs of a host (use "-t" to specify the mac address or -bat-host name) throughout the network or to display routing tables of the nodes (use "-r" to -specify the mac address or bat-host name). You can name a specific sequence number or a range -using the "-s" option to limit the output's range. Furthermore you can filter the output by -specifying an originator (use "-o" to specify the mac address or bat-host name) to only see -data connected to this originator. If "-n" was given batctl will not replace the mac -addresses with bat-host names in the output. +Traceroute sends 3 packets to each hop, awaits the answers and prints out the +response times.
Usage::
- batctl bisect_iv [parameters] <file1> <file2> .. <fileN> - parameters: + batctl traceroute [parameters] mac|bat-host|host-name|IP-address
- -h print this help - -l run a loop detection of given mac address or bat-host (default) - -n don't convert addresses to bat-host names - -r print routing tables of given mac address or bat-host - -s seqno range to limit the output - -t trace seqnos of given mac address or bat-host +Example::
-Examples:: + $ batctl traceroute fe:fe:00:00:09:01 + traceroute to fe:fe:00:00:09:01 (fe:fe:00:00:09:01), 50 hops max, 19 byte packets + 1: fe:fe:00:00:02:01 4.932 ms 2.338 ms 1.333 ms + 2: fe:fe:00:00:03:01 6.860 ms 1.579 ms 1.260 ms + 3: fe:fe:00:00:04:01 2.342 ms 1.547 ms 1.655 ms + 4: fe:fe:00:00:05:01 2.906 ms 2.211 ms 2.253 ms + 5: fe:fe:00:00:06:01 3.577 ms 2.687 ms 3.088 ms + 6: fe:fe:00:00:07:01 4.217 ms 5.741 ms 3.551 ms + 7: fe:fe:00:00:08:01 5.017 ms 5.547 ms 4.294 ms + 8: fe:fe:00:00:09:01 5.730 ms 4.970 ms 6.437 ms
- $ batctl bisect_iv log/* -l uml3 - Analyzing routing tables of originator: uml3 [all sequence numbers]
- Checking host: uml3 - Path towards uml7 (seqno 9 via neigh uml5): -> uml5 -> uml6 - Path towards uml7 (seqno 10 via neigh uml4): -> uml4 -> uml5 -> uml6 - Path towards uml6 (seqno 4 via neigh uml4): -> uml4 - Path towards uml8 (seqno 12 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 - Path towards uml8 (seqno 203 via neigh uml4): -> uml4 -> uml6 -> uml7 - Path towards uml8 (seqno 391 via neigh uml2): -> uml2 -> uml3 -> uml2 aborted due to loop! - Path towards uml8 (seqno 396 via neigh uml4): -> uml4 -> uml6 -> uml7 - Path towards uml9 (seqno 10 via neigh uml5): -> uml5 -> uml6 -> uml7 -> uml9. - Path towards uml9 (seqno 10 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 -> uml9. - Path towards uml9 (seqno 11 via neigh uml4): -> uml4 -> uml6 -> uml7 -> uml8 -> uml9. - Path towards uml9 (seqno 12 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 -> uml8 -> uml9. - Path towards uml9 (seqno 21 via neigh uml5): -> uml5 -> uml6 -> uml7 -> uml8 -> uml9. - Path towards uml9 (seqno 22 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 -> uml8 -> uml9. +batctl translate +----------------
- $ ./batctl bisect_iv -t uml3 log/* - Sequence number flow of originator: uml3 [all sequence numbers] - [...] - +=> uml3 (seqno 19) - |- uml2 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] - | |- uml3 [tq: 154, ttl: 49, neigh: uml2, prev_sender: uml3] - | - uml1 [tq: 154, ttl: 49, neigh: uml2, prev_sender: uml3] - | |- uml3 [tq: 51, ttl: 48, neigh: uml1, prev_sender: uml2] - | - uml2 [tq: 51, ttl: 48, neigh: uml1, prev_sender: uml2] - |- uml5 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] - | |- uml6 [tq: 33, ttl: 48, neigh: uml5, prev_sender: uml3] - | | |- uml5 [tq: 11, ttl: 47, neigh: uml6, prev_sender: uml5] - | | |- uml7 [tq: 11, ttl: 47, neigh: uml6, prev_sender: uml5] - | | | |- uml8 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] - | | | | |- uml6 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] - | | | | |- uml9 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] - | | | | - uml7 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] - | | | |- uml6 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] - | | | |- uml9 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] - | | | - uml5 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] - | | - uml4 [tq: 11, ttl: 47, neigh: uml6, prev_sender: uml5] - | |- uml7 [tq: 33, ttl: 48, neigh: uml5, prev_sender: uml3] - | - uml4 [tq: 33, ttl: 48, neigh: uml5, prev_sender: uml3] - - uml4 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] - |- uml3 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] - |- uml6 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] - |- uml2 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] - - uml5 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] - +=> uml3 (seqno 20) - |- uml2 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] - | |- uml3 [tq: 160, ttl: 49, neigh: uml2, prev_sender: uml3] - | |- uml1 [tq: 160, ttl: 49, neigh: uml2, prev_sender: uml3] - | - uml4 [tq: 160, ttl: 49, neigh: uml2, prev_sender: uml3] - |- uml5 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] - | |- uml3 [tq: 43, ttl: 48, neigh: uml5, prev_sender: uml3] - | |- uml6 [tq: 43, ttl: 48, neigh: uml5, prev_sender: uml3] - | | |- uml8 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] - | | |- uml5 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] - | | |- uml7 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] - | | | |- uml8 [tq: 5, ttl: 46, neigh: uml7, prev_sender: uml6] - | | | | |- uml6 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] - | | | | |- uml9 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] - | | | | - uml7 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] - | | | - uml6 [tq: 5, ttl: 46, neigh: uml7, prev_sender: uml6] - | | - uml4 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] - | - uml4 [tq: 43, ttl: 48, neigh: uml5, prev_sender: uml3] - |- uml1 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] - | - uml2 [tq: 49, ttl: 48, neigh: uml1, prev_sender: uml3] - - uml4 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] - |- uml3 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] - |- uml6 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] - |- uml2 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] - - uml5 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] - [...] +Translates a destination (hostname, IPv4, IPv6, MAC, bat_host-name) to the +originator mac address responsible for it.
+Usage::
-batctl originators -================== + batctl translate mac|bat-host|host-name|IP-address
-Check the Originators table +Example:: + + $ batctl translate www.google.de + 02:ca:fe:af:fe:01 + $ batctl translate 02:ca:fe:af:fe:01 + 02:ca:fe:af:fe:01 + $ batctl translate 192.168.1.2 + 02:ca:fe:af:fe:05 + $ batctl translate fe:fe:00:00:09:01 + 02:ca:fe:af:fe:05 + $ batctl translate 2001::1 + 02:ca:fe:af:fe:05 + + +Debug information tables +======================== + + +batctl backbonetable +-------------------- + +Check the bridge loop avoidance backbone table
Usage::
- batctl originators|o + batctl backbonetable|bbt
Example::
- $ batctl originators - [B.A.T.M.A.N. adv 2011.4.0, MainIF/MAC: eth0/fe:fe:00:00:01:01 (bat0)] - Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ... - fe:fe:00:00:08:01 0.820s (194) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 65) fe:fe:00:00:02:01 (194) - fe:fe:00:00:03:01 0.980s (245) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 81) fe:fe:00:00:02:01 (245) - fe:fe:00:00:05:01 0.140s (221) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 76) fe:fe:00:00:02:01 (221) - fe:fe:00:00:04:01 0.010s (235) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:02:01 (235) fe:fe:00:00:03:01 ( 81) - fe:fe:00:00:09:01 0.830s (187) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 63) fe:fe:00:00:02:01 (187) + Originator VID last seen (CRC ) + 4a:97:a4:b8:fc:17 on -1 1.376s (0x847a) + + +batctl claimtable +----------------- + +Check the bridge loop avoidance claim table table + +Usage:: + + batctl claimtable|cl + +Example:: + + Client VID Originator [o] (CRC ) + e4:95:6e:4f:06:28 on -1 by 02:ba:de:af:fe:01 [*] (0xbb73) + 08:ee:8b:84:82:8b on -1 by 02:ba:de:af:fe:01 [*] (0xbb73) + ac:86:74:9f:4d:80 on -1 by 02:ba:de:af:fe:01 [*] (0x3b7e) + 60:14:66:6f:ec:52 on -1 by 02:ba:de:af:fe:01 [*] (0xbb73) + 3a:ef:e8:e0:10:02 on -1 by 02:ba:de:af:fe:01 [*] (0xbb73) + 56:bd:b4:a7:0b:aa on -1 by 02:ba:de:af:fe:01 [*] (0xbb73) + 42:3a:6e:68:01:7d on -1 by 02:ba:de:af:fe:01 [*] (0xbb73) + 0c:d7:46:2c:41:39 on -1 by 02:ba:de:af:fe:01 [*] (0xbb73) + + +batctl dat_cache +---------------- + +display the local D.A.T. cache + +Usage:: + + batctl dat_cache|dc + +Example:: + + Distributed ARP Table (bat0): + IPv4 MAC last-seen + * 172.100.0.1 b6:9b:d0:ea:b1:13 0:00 + +where + +IPv4: + is the IP address of a client in the mesh network +MAC: + is the MAC address associated to that IP +last-seen: + is the amount of time since last refresh of this entry + + +batctl gateways +--------------- + +Check the detected (and maybe selected) gateways + +Usage:: + + batctl gateways|gwl + +Example:: + + Router ( TQ) Next Hop [outgoingIf] Bandwidth + 02:62:e7:ab:01:01 (180) ae:1b:bf:52:25:58 [ enp0s1]: 10.0/2.0 MBit + 02:62:e7:ab:05:01 (180) ae:1b:bf:52:25:58 [ enp0s1]: 10.0/2.0 MBit + 02:62:e7:ab:06:01 (235) ae:1b:bf:52:25:58 [ enp0s1]: 10.0/2.0 MBit + 02:62:e7:ab:02:01 (176) ae:1b:bf:52:25:58 [ enp0s1]: 10.0/2.0 MBit + 02:62:e7:ab:03:01 (180) ae:1b:bf:52:25:58 [ enp0s1]: 10.0/2.0 MBit + 02:62:e7:ab:04:01 (180) ae:1b:bf:52:25:58 [ enp0s1]: 10.0/2.0 MBit + + +batctl mcast_flags +------------------ + +display local and remote multicast flags + +Usage:: + + batctl mcast_flags|mf + +Example:: + + Multicast flags (own flags: [U46]) + * Bridged [U] U + * No IGMP/MLD Querier [4/6]: ./. + * Shadowing IGMP/MLD Querier [4/6]: 4/6 + ------------------------------------------- + Originator Flags + 02:04:64:a4:39:c1 [U..] + 02:04:64:a4:39:c2 [U..] + 02:04:64:a4:39:c3 [...] + +where + +Originator: + the MAC address of the originating (primary interface) batman-adv node +Flags: + multicast flags of the according node +U: + wants all unsnoopable multicast traffic, meaning other nodes need to always + forward any multicast traffic destined to ff02::1 or 224.0.0.0/24 to it +4: + wants all IPv4 multicast traffic, meaning other nodes need to always forward + any IPv4 multicast traffic to it +6: + wants all IPv6 multicast traffic, meaning other nodes need to always forward + any IPv6 multicast traffic to it + +If a node does not have multicast optimizations available (e.g. old batman-adv +version or optimizations not compiled in), therefore not announcing any +multicast tvlv/flags, a '-' will be displayed instead of '[...]'. + + +batctl neighbors +---------------- + +Check the neighbors table + +Usage:: + + batctl neighbors|n + +Example:: + + IF Neighbor last-seen + enp0s1 16:7b:3c:c2:bf:b8 4.612s + enp0s1 ae:1b:bf:52:25:58 0.740s + + +batctl originators +------------------ + +Check the Originators table + +Usage:: + + batctl originators|o + +Example:: + + $ batctl originators + [B.A.T.M.A.N. adv 2011.4.0, MainIF/MAC: eth0/fe:fe:00:00:01:01 (bat0)] + Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ... + fe:fe:00:00:08:01 0.820s (194) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 65) fe:fe:00:00:02:01 (194) + fe:fe:00:00:03:01 0.980s (245) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 81) fe:fe:00:00:02:01 (245) + fe:fe:00:00:05:01 0.140s (221) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 76) fe:fe:00:00:02:01 (221) + fe:fe:00:00:04:01 0.010s (235) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:02:01 (235) fe:fe:00:00:03:01 ( 81) + fe:fe:00:00:09:01 0.830s (187) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 63) fe:fe:00:00:02:01 (187) fe:fe:00:00:06:01 0.830s (213) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 71) fe:fe:00:00:02:01 (213) fe:fe:00:00:02:01 0.240s (255) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 81) fe:fe:00:00:02:01 (255) fe:fe:00:00:07:01 0.670s (200) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 68) fe:fe:00:00:02:01 (200) @@ -356,203 +418,169 @@ Example:: fe:f0:00:00:01:01 0.510s (255) fe:f0:00:00:01:01 [ eth0]: fe:f1:00:00:01:01 (240) fe:f0:00:00:01:01 (255)
-batctl interface -================
-display or modify the interface settings +batctl translocal +----------------- + +display the local translation table
Usage::
- batctl interface|if [add|del iface(s)] + batctl translocal|tl
Example::
- $ batctl interface - eth0: active - - -batctl interval -=============== - -display or modify the originator interval in ms - -Usage:: + $ batctl translocal + Locally retrieved addresses (from bat0) announced via TT (TTVN: 1): + * fe:fe:00:00:01:01 [RPNXW]
- batctl orig_interval|it [interval] +In particular, RPNXW are flags which have the following meanings:
-Example:: +R/Roaming: + this client moved to another node but it is still kept for consistency reasons + until the next OGM is sent. +P/noPurge: + this client represents the local soft interface and will never be deleted. +N/New: + this client has recently been added but is not advertised in the mesh until + the next OGM is sent (for consistency reasons). +X/delete: + this client has to be removed for some reason, but it is still kept for + consistency reasons until the next OGM is sent. +W/Wireless: + this client is connected to the node through a wireless device.
- $ batctl interval - 1000 +If any of the flags is not enabled, a '.' will substitute its symbol.
-batctl elp interval -=================== +batctl transglobal +------------------
-display or modify the elp interval in ms for hard interface +display the global translation table
Usage::
- batctl hardif $hardif elp_interval|et [interval] + batctl transglobal|tg
Example::
- $ batctl hardif eth0 elp_interval 200 - $ batctl hardif eth0 elp_interval - 200 - - -batctl throughput override -========================== + Globally announced TT entries received via the mesh bat0 + Client (TTVN) Originator (Curr TTVN) Flags + * fe:fe:00:00:01:01 ( 12) via fe:fe:00:00:01:02 ( 50) [RXW]
-display or modify the throughput override in kbit/s for hard interface +where
-Usage:: +TTVN: + is the translation-table-version-number which introduced this client +Curr TTVN: + is the translation-table-version-number currently advertised by the + originator serving this client (different clients advertised by the same + originator have the same Curr TTVN) +Flags that mean: + R/Roaming: + this client moved to another node but it is still kept for consistency + reasons until the next OGM is sent. + X/delete: + this client has to be removed for some reason, but it is still kept for + consistency reasons until the next OGM is sent. + W/Wireless: + this client is connected to the node through a wireless device.
- batctl hardif $hardif throughput_override|to [kbit] +If any of the flags is not enabled, a '.' will substitute its symbol.
-Example::
- $ batctl hardif eth0 throughput_override 15000 - $ batctl hardif eth0 throughput_override 15mbit - $ batctl hardif eth0 throughput_override - 15.0 MBit +Settings +========
-batctl loglevel -=============== +batctl aggregation +------------------
-display or modify the log level +display or modify the packet aggregation setting
Usage::
- batctl loglevel|ll [level] - -Example:: - - $ batctl loglevel - [x] all debug output disabled (none) - [ ] messages related to routing / flooding / broadcasting (batman) - [ ] messages related to route added / changed / deleted (routes) - [ ] messages related to translation table operations (tt) - [ ] messages related to bridge loop avoidance (bla) - [ ] messages related to arp snooping and distributed arp table (dat) - [ ] messages related to network coding (nc) - [ ] messages related to multicast (mcast) - [ ] messages related to throughput meter (tp) + batctl aggregation|ag [0|1]
-batctl nc_nodes -=============== +ap_isolation +------------
-display the neighbor nodes considered for network coded packets +display or modify the client isolation setting
Usage::
- batctl nc_nodes|nn - -Example:: + batctl ap_isolation|ap [0|1]
- Node: fe:fe:00:0a:01:01 - Ingoing: fe:fe:00:0a:01:01 fe:fe:00:0a:02:01 - Outgoing: fe:fe:00:0a:01:01 fe:fe:00:0a:02:01
-Where +bonding +-------
-Node: - is the neighbor -Ingoing: - is the neighbors this neighbor can hear packets from -Outgoing: - is the neighbors that can hear packets from this neighbor - - -batctl network_coding -===================== - -display or modify the network coding setting +display or modify the bonding setting
Usage::
- batctl network_coding|nc [0|1] + batctl bonding|b [0|1]
-Note that network coding requires a working promiscuous mode on all interfaces.
+bridge_loop_avoidance +---------------------
-batctl multicast_forceflood -=========================== - -display or modify the multicast forceflood setting +display or modify the bridge_loop_avoidance setting
Usage::
- batctl multicast_forceflood|mff [0|1] + batctl bridge_loop_avoidance|bl [0|1]
-batctl multicast_fanout -======================= +distributed_arp_table +---------------------
-display or modify the multicast fanout setting +display or modify the distributed_arp_table setting
Usage::
- batctl multicast_fanout|mo [fanout] + batctl distributed_arp_table|dat [0|1]
-batctl mcast_flags -================== +batctl elp interval +-------------------
-display local and remote multicast flags +display or modify the elp interval in ms for hard interface
Usage::
- batctl mcast_flags|mf + batctl hardif $hardif elp_interval|et [interval]
Example::
- Multicast flags (own flags: [U46]) - * Bridged [U] U - * No IGMP/MLD Querier [4/6]: ./. - * Shadowing IGMP/MLD Querier [4/6]: 4/6 - ------------------------------------------- - Originator Flags - 02:04:64:a4:39:c1 [U..] - 02:04:64:a4:39:c2 [U..] - 02:04:64:a4:39:c3 [...] + $ batctl hardif eth0 elp_interval 200 + $ batctl hardif eth0 elp_interval + 200
-where
-Originator: - the MAC address of the originating (primary interface) batman-adv node -Flags: - multicast flags of the according node -U: - wants all unsnoopable multicast traffic, meaning other nodes need to always - forward any multicast traffic destined to ff02::1 or 224.0.0.0/24 to it -4: - wants all IPv4 multicast traffic, meaning other nodes need to always forward - any IPv4 multicast traffic to it -6: - wants all IPv6 multicast traffic, meaning other nodes need to always forward - any IPv6 multicast traffic to it +fragmentation +-------------
-If a node does not have multicast optimizations available (e.g. old batman-adv -version or optimizations not compiled in), therefore not announcing any -multicast tvlv/flags, a '-' will be displayed instead of '[...]'. +display or modify the fragmentation setting
+Usage::
-batctl aggregation -================== + batctl fragmentation|f [0|1]
-display or modify the packet aggregation setting + +gw_mode +------- + +display or modify the gw_mode setting
Usage::
- batctl aggregation|ag [0|1] + batctl gw_mode|gw [0|1]
batctl hop_penalty -================== +------------------
display or modify the hop_penalty (0-255)
@@ -572,7 +600,7 @@ Example::
batctl isolation_mark -===================== +---------------------
display or modify the isolation mark. This value is used by Extended Isolation feature. @@ -587,103 +615,203 @@ Usage:: * Example 4: ``batctl mark 0x0f``
-batctl translocal -================= +batctl loglevel +---------------
-display the local translation table +display or modify the log level
Usage::
- batctl translocal|tl + batctl loglevel|ll [level]
Example::
- $ batctl translocal - Locally retrieved addresses (from bat0) announced via TT (TTVN: 1): - * fe:fe:00:00:01:01 [RPNXW] + $ batctl loglevel + [x] all debug output disabled (none) + [ ] messages related to routing / flooding / broadcasting (batman) + [ ] messages related to route added / changed / deleted (routes) + [ ] messages related to translation table operations (tt) + [ ] messages related to bridge loop avoidance (bla) + [ ] messages related to arp snooping and distributed arp table (dat) + [ ] messages related to network coding (nc) + [ ] messages related to multicast (mcast) + [ ] messages related to throughput meter (tp)
-In particular, RPNXW are flags which have the following meanings:
-R/Roaming: - this client moved to another node but it is still kept for consistency reasons - until the next OGM is sent. -P/noPurge: - this client represents the local soft interface and will never be deleted. -N/New: - this client has recently been added but is not advertised in the mesh until - the next OGM is sent (for consistency reasons). -X/delete: - this client has to be removed for some reason, but it is still kept for - consistency reasons until the next OGM is sent. -W/Wireless: - this client is connected to the node through a wireless device. +batctl multicast_fanout +-----------------------
-If any of the flags is not enabled, a '.' will substitute its symbol. +display or modify the multicast fanout setting
+Usage::
-batctl transglobal -================== + batctl multicast_fanout|mo [fanout]
-display the global translation table + +batctl multicast_forceflood +--------------------------- + +display or modify the multicast forceflood setting
Usage::
- batctl transglobal|tg + batctl multicast_forceflood|mff [0|1]
-Example::
- Globally announced TT entries received via the mesh bat0 - Client (TTVN) Originator (Curr TTVN) Flags - * fe:fe:00:00:01:01 ( 12) via fe:fe:00:00:01:02 ( 50) [RXW] +batctl network_coding +---------------------
-where +display or modify the network coding setting
-TTVN: - is the translation-table-version-number which introduced this client -Curr TTVN: - is the translation-table-version-number currently advertised by the - originator serving this client (different clients advertised by the same - originator have the same Curr TTVN) -Flags that mean: - R/Roaming: - this client moved to another node but it is still kept for consistency - reasons until the next OGM is sent. - X/delete: - this client has to be removed for some reason, but it is still kept for - consistency reasons until the next OGM is sent. - W/Wireless: - this client is connected to the node through a wireless device. +Usage::
-If any of the flags is not enabled, a '.' will substitute its symbol. + batctl network_coding|nc [0|1]
+Note that network coding requires a working promiscuous mode on all interfaces.
-batctl dat_cache -=================
-display the local D.A.T. cache +batctl orig_interval +-------------------- + +display or modify the originator interval in ms
Usage::
- batctl dat_cache|dc + batctl orig_interval|it [interval]
Example::
- Distributed ARP Table (bat0): - IPv4 MAC last-seen - * 172.100.0.1 b6:9b:d0:ea:b1:13 0:00 + $ batctl interval + 1000
-where
-IPv4: - is the IP address of a client in the mesh network -MAC: - is the MAC address associated to that IP -last-seen: - is the amount of time since last refresh of this entry +batctl throughput override +-------------------------- + +display or modify the throughput override in kbit/s for hard interface + +Usage:: + + batctl hardif $hardif throughput_override|to [kbit] + +Example:: + + $ batctl hardif eth0 throughput_override 15000 + $ batctl hardif eth0 throughput_override 15mbit + $ batctl hardif eth0 throughput_override + 15.0 MBit + + +Advanced Analytics +================== + +batctl bisect_iv +---------------- + +Analyzes the B.A.T.M.A.N. IV logfiles to build a small internal database of all sent sequence +numbers and routing table changes. This database can be used to search for routing loops +(default action), to trace OGMs of a host (use "-t" to specify the mac address or +bat-host name) throughout the network or to display routing tables of the nodes (use "-r" to +specify the mac address or bat-host name). You can name a specific sequence number or a range +using the "-s" option to limit the output's range. Furthermore you can filter the output by +specifying an originator (use "-o" to specify the mac address or bat-host name) to only see +data connected to this originator. If "-n" was given batctl will not replace the mac +addresses with bat-host names in the output. + +Usage:: + + batctl bisect_iv [parameters] <file1> <file2> .. <fileN> + parameters: + + -h print this help + -l run a loop detection of given mac address or bat-host (default) + -n don't convert addresses to bat-host names + -r print routing tables of given mac address or bat-host + -s seqno range to limit the output + -t trace seqnos of given mac address or bat-host + +Examples:: + + $ batctl bisect_iv log/* -l uml3 + Analyzing routing tables of originator: uml3 [all sequence numbers] + + Checking host: uml3 + Path towards uml7 (seqno 9 via neigh uml5): -> uml5 -> uml6 + Path towards uml7 (seqno 10 via neigh uml4): -> uml4 -> uml5 -> uml6 + Path towards uml6 (seqno 4 via neigh uml4): -> uml4 + Path towards uml8 (seqno 12 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 + Path towards uml8 (seqno 203 via neigh uml4): -> uml4 -> uml6 -> uml7 + Path towards uml8 (seqno 391 via neigh uml2): -> uml2 -> uml3 -> uml2 aborted due to loop! + Path towards uml8 (seqno 396 via neigh uml4): -> uml4 -> uml6 -> uml7 + Path towards uml9 (seqno 10 via neigh uml5): -> uml5 -> uml6 -> uml7 -> uml9. + Path towards uml9 (seqno 10 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 -> uml9. + Path towards uml9 (seqno 11 via neigh uml4): -> uml4 -> uml6 -> uml7 -> uml8 -> uml9. + Path towards uml9 (seqno 12 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 -> uml8 -> uml9. + Path towards uml9 (seqno 21 via neigh uml5): -> uml5 -> uml6 -> uml7 -> uml8 -> uml9. + Path towards uml9 (seqno 22 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 -> uml8 -> uml9. + + $ ./batctl bisect_iv -t uml3 log/* + Sequence number flow of originator: uml3 [all sequence numbers] + [...] + +=> uml3 (seqno 19) + |- uml2 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] + | |- uml3 [tq: 154, ttl: 49, neigh: uml2, prev_sender: uml3] + | - uml1 [tq: 154, ttl: 49, neigh: uml2, prev_sender: uml3] + | |- uml3 [tq: 51, ttl: 48, neigh: uml1, prev_sender: uml2] + | - uml2 [tq: 51, ttl: 48, neigh: uml1, prev_sender: uml2] + |- uml5 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] + | |- uml6 [tq: 33, ttl: 48, neigh: uml5, prev_sender: uml3] + | | |- uml5 [tq: 11, ttl: 47, neigh: uml6, prev_sender: uml5] + | | |- uml7 [tq: 11, ttl: 47, neigh: uml6, prev_sender: uml5] + | | | |- uml8 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] + | | | | |- uml6 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] + | | | | |- uml9 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] + | | | | - uml7 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] + | | | |- uml6 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] + | | | |- uml9 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] + | | | - uml5 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] + | | - uml4 [tq: 11, ttl: 47, neigh: uml6, prev_sender: uml5] + | |- uml7 [tq: 33, ttl: 48, neigh: uml5, prev_sender: uml3] + | - uml4 [tq: 33, ttl: 48, neigh: uml5, prev_sender: uml3] + - uml4 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] + |- uml3 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] + |- uml6 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] + |- uml2 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] + - uml5 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] + +=> uml3 (seqno 20) + |- uml2 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] + | |- uml3 [tq: 160, ttl: 49, neigh: uml2, prev_sender: uml3] + | |- uml1 [tq: 160, ttl: 49, neigh: uml2, prev_sender: uml3] + | - uml4 [tq: 160, ttl: 49, neigh: uml2, prev_sender: uml3] + |- uml5 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] + | |- uml3 [tq: 43, ttl: 48, neigh: uml5, prev_sender: uml3] + | |- uml6 [tq: 43, ttl: 48, neigh: uml5, prev_sender: uml3] + | | |- uml8 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] + | | |- uml5 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] + | | |- uml7 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] + | | | |- uml8 [tq: 5, ttl: 46, neigh: uml7, prev_sender: uml6] + | | | | |- uml6 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] + | | | | |- uml9 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] + | | | | - uml7 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] + | | | - uml6 [tq: 5, ttl: 46, neigh: uml7, prev_sender: uml6] + | | - uml4 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] + | - uml4 [tq: 43, ttl: 48, neigh: uml5, prev_sender: uml3] + |- uml1 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] + | - uml2 [tq: 49, ttl: 48, neigh: uml1, prev_sender: uml3] + - uml4 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] + |- uml3 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] + |- uml6 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] + |- uml2 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] + - uml5 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] + [...] + + +Appendix +========
batctl and network name spaces -============================== +------------------------------
The batman-adv kernel module is netns aware. Mesh instances can be created in name spaces, and interfaces in that name space added to the