| 51 | | batctl tcpdump [options] [interface] |
| 52 | | |
| 53 | | The following options are supported: |
| 54 | | |
| 55 | | -a (all packets) - switch tcpdump behaviour to work as the "normal" tcpdump and filter for non-batman advanced packets |
| 56 | | |
| 57 | | -d (dump packets) - print packet data in hex |
| 58 | | |
| 59 | | -p (packet type) - specify to filter for certain batman packets (1 = batman packets, 2 = icmp packets, 3 = unicast packets, 4 = broadcast packets) |
| 60 | | |
| 61 | | -v (verbose) - prints more information about each packet |
| 62 | | |
| 63 | | |
| 64 | | B.A.T.M.A.N. advanced encapsulates all traffic within batman packets. In total it uses 4 different packet types: |
| 65 | | |
| 66 | | batman packets - these transport the B.A.T.M.A.N. originator messages to build the mesh network |
| 67 | | |
| 68 | | batman icmp packets - lightweight implementation of the ICMP protocol (needed for ping and traceroute) |
| 69 | | |
| 70 | | batman unicast packets - unicast data is bound as payload in these packets |
| 71 | | |
| 72 | | batman broadcast packets - broadcast data is bound as payload in these packets |
| 73 | | |
| 74 | | |
| 75 | | The tcpdump output looks like: |
| 76 | | |
| 77 | | 34 05:47:22 6e:2b:79:45:c8:1a -> ff:ff:ff:ff:ff:ff BAT 6e:2b:79:45:c8:1a 6e:2b:79:45:c8:1a (seqno 401, tq 255, TTL 50, V 1, UD 0, DL 0) |
| 78 | | |
| 79 | | 60 -> packet size in bytes |
| 80 | | 17:56:57 -> time when this packet was seen |
| 81 | | 6e:2b:79:45:c8:1a -> sender mac address |
| 82 | | ff:ff:ff:ff:ff:ff -> recipient mac address |
| 83 | | BAT -> packet type (batman packet) |
| 84 | | 6e:2b:79:45:c8:1a -> batman packet originator |
| 85 | | 6e:2b:79:45:c8:1a -> batman old originator |
| 86 | | seqno 401 |
| 87 | | tq 255 |
| 88 | | ttl 50 |
| 89 | | V 1 -> batman version |
| 90 | | UD 0 -> [1|0] unidirectional |
| 91 | | DL 0 -> [1|0] directlink |
| 92 | | |
| | 86 | tcpdump layer 2 traffic on the given interface |
| | 87 | |
| | 88 | Usage: batctl tcpdump [options] interface [interface] |
| | 89 | options: |
| | 90 | -h print this help |
| | 91 | -n don't convert addresses to bat-host names |
| | 92 | -p dump specific packet type |
| | 93 | 1 - batman ogm packets |
| | 94 | 2 - batman icmp packets |
| | 95 | 4 - batman unicast packets |
| | 96 | 8 - batman broadcast packets |
| | 97 | 16 - batman vis packets |
| | 98 | 32 - non batman packets |
| | 99 | 33 - batman ogm & non batman packets |
| | 100 | |
| | 101 | Example output for tcpdump: |
| | 102 | |
| | 103 | $ batctl tcpdump mesh0 |
| | 104 | 01:51:42.401188 BAT kansas: OGM via neigh kansas, seqno 6718, tq 255, ttl 50, v 9, flags [..I], length 28 |
| | 105 | 01:51:42.489735 BAT kansas: OGM via neigh wyoming, seqno 6718, tq 245, ttl 49, v 9, flags [.D.], length 28 |
| | 106 | 01:51:42.510330 BAT wyoming: OGM via neigh wyoming, seqno 6721, tq 255, ttl 50, v 9, flags [..I], length 28 |
| | 107 | 01:51:42.601092 BAT wyoming: OGM via neigh kansas, seqno 6721, tq 245, ttl 49, v 9, flags [.D.], length 28 |
| | 108 | 01:51:43.361076 BAT kansas > wyoming: ICMP echo request, id 0, seq 1, ttl 1, v 9, length 19 |
| | 109 | 01:51:43.365347 BAT wyoming > kansas: ICMP echo reply, id 0, seq 1, ttl 50, v 9, length 19 |
| | 110 | 01:51:43.372224 BAT kansas > wyoming: ICMP echo request, id 0, seq 2, ttl 1, v 9, length 19 |
| | 111 | 01:51:43.376506 BAT wyoming > kansas: ICMP echo reply, id 0, seq 2, ttl 50, v 9, length 19 |
| | 112 | 01:51:43.381250 BAT kansas: OGM via neigh kansas, seqno 6719, tq 255, ttl 50, v 9, flags [..I], length 28 |
| | 113 | 01:51:43.386281 BAT kansas > wyoming: ICMP echo request, id 0, seq 3, ttl 1, v 9, length 19 |
| | 114 | 01:51:43.387910 BAT wyoming > kansas: ICMP echo reply, id 0, seq 3, ttl 50, v 9, length 19 |
| | 115 | 01:51:43.479503 BAT kansas: OGM via neigh wyoming, seqno 6719, tq 245, ttl 49, v 9, flags [.D.], length 28 |
| | 116 | 01:51:43.509899 BAT wyoming: OGM via neigh wyoming, seqno 6722, tq 255, ttl 50, v 9, flags [..I], length 28 |
| | 117 | 01:51:43.600999 BAT wyoming: OGM via neigh kansas, seqno 6722, tq 245, ttl 49, v 9, flags [.D.], length 28 |
| | 118 | 01:51:44.381064 BAT kansas: OGM via neigh kansas, seqno 6720, tq 255, ttl 50, v 9, flags [..I], length 28 |
| | 119 | |
| | 120 | batctl bisect |
| | 121 | ============= |
| | 122 | |
| | 123 | Analyzes the logfiles to build a small internal database of all sent sequence |
| | 124 | numbers and routing table changes. This database can be used to search for |
| | 125 | routing loops (default action), to trace OGMs of a host (use "-t" to |
| | 126 | specify the mac address or bat-host name) throughout the network or to |
| | 127 | display routing tables of the nodes (use "-r" to specify the mac address or |
| | 128 | bat-host name). You can name a specific sequence number or a range using the |
| | 129 | "-s" option to limit the output's range. Furthermore you can filter the |
| | 130 | output by specifying an originator (use "-o" to specify the mac address or |
| | 131 | bat-host name) to only see data connected to this originator. If "-n" was |
| | 132 | given batctl will not replace the mac addresses with bat-host names in the |
| | 133 | output. |
| | 134 | |
| | 135 | Usage: batctl bisect [options] <file1> <file2> .. <fileN> |
| | 136 | options: |
| | 137 | -h print this help |
| | 138 | -l run a loop detection of given mac address or bat-host (default) |
| | 139 | -n don't convert addresses to bat-host names |
| | 140 | -r print routing tables of given mac address or bat-host |
| | 141 | -s seqno range to limit the output |
| | 142 | -t trace seqnos of given mac address or bat-host |
| | 143 | |
| | 144 | Examples: |
| | 145 | |
| | 146 | $ batctl bisect log/* -l uml3 |
| | 147 | Analyzing routing tables of originator: uml3 [all sequence numbers] |
| | 148 | |
| | 149 | Checking host: uml3 |
| | 150 | Path towards uml7 (seqno 9 via neigh uml5): -> uml5 -> uml6 |
| | 151 | Path towards uml7 (seqno 10 via neigh uml4): -> uml4 -> uml5 -> uml6 |
| | 152 | Path towards uml6 (seqno 4 via neigh uml4): -> uml4 |
| | 153 | Path towards uml8 (seqno 12 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 |
| | 154 | Path towards uml8 (seqno 203 via neigh uml4): -> uml4 -> uml6 -> uml7 |
| | 155 | Path towards uml8 (seqno 391 via neigh uml2): -> uml2 -> uml3 -> uml2 aborted due to loop! |
| | 156 | Path towards uml8 (seqno 396 via neigh uml4): -> uml4 -> uml6 -> uml7 |
| | 157 | Path towards uml9 (seqno 10 via neigh uml5): -> uml5 -> uml6 -> uml7 -> uml9. |
| | 158 | Path towards uml9 (seqno 10 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 -> uml9. |
| | 159 | Path towards uml9 (seqno 11 via neigh uml4): -> uml4 -> uml6 -> uml7 -> uml8 -> uml9. |
| | 160 | Path towards uml9 (seqno 12 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 -> uml8 -> uml9. |
| | 161 | Path towards uml9 (seqno 21 via neigh uml5): -> uml5 -> uml6 -> uml7 -> uml8 -> uml9. |
| | 162 | Path towards uml9 (seqno 22 via neigh uml4): -> uml4 -> uml5 -> uml6 -> uml7 -> uml8 -> uml9. |
| | 163 | |
| | 164 | $ ./batctl bisect -t uml3 log/* |
| | 165 | Sequence number flow of originator: uml3 [all sequence numbers] |
| | 166 | [...] |
| | 167 | +=> uml3 (seqno 19) |
| | 168 | |- uml2 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] |
| | 169 | | |- uml3 [tq: 154, ttl: 49, neigh: uml2, prev_sender: uml3] |
| | 170 | | \- uml1 [tq: 154, ttl: 49, neigh: uml2, prev_sender: uml3] |
| | 171 | | |- uml3 [tq: 51, ttl: 48, neigh: uml1, prev_sender: uml2] |
| | 172 | | \- uml2 [tq: 51, ttl: 48, neigh: uml1, prev_sender: uml2] |
| | 173 | |- uml5 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] |
| | 174 | | |- uml6 [tq: 33, ttl: 48, neigh: uml5, prev_sender: uml3] |
| | 175 | | | |- uml5 [tq: 11, ttl: 47, neigh: uml6, prev_sender: uml5] |
| | 176 | | | |- uml7 [tq: 11, ttl: 47, neigh: uml6, prev_sender: uml5] |
| | 177 | | | | |- uml8 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] |
| | 178 | | | | | |- uml6 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] |
| | 179 | | | | | |- uml9 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] |
| | 180 | | | | | \- uml7 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] |
| | 181 | | | | |- uml6 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] |
| | 182 | | | | |- uml9 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] |
| | 183 | | | | \- uml5 [tq: 3, ttl: 46, neigh: uml7, prev_sender: uml6] |
| | 184 | | | \- uml4 [tq: 11, ttl: 47, neigh: uml6, prev_sender: uml5] |
| | 185 | | |- uml7 [tq: 33, ttl: 48, neigh: uml5, prev_sender: uml3] |
| | 186 | | \- uml4 [tq: 33, ttl: 48, neigh: uml5, prev_sender: uml3] |
| | 187 | \- uml4 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] |
| | 188 | |- uml3 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] |
| | 189 | |- uml6 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] |
| | 190 | |- uml2 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] |
| | 191 | \- uml5 [tq: 106, ttl: 49, neigh: uml4, prev_sender: uml3] |
| | 192 | +=> uml3 (seqno 20) |
| | 193 | |- uml2 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] |
| | 194 | | |- uml3 [tq: 160, ttl: 49, neigh: uml2, prev_sender: uml3] |
| | 195 | | |- uml1 [tq: 160, ttl: 49, neigh: uml2, prev_sender: uml3] |
| | 196 | | \- uml4 [tq: 160, ttl: 49, neigh: uml2, prev_sender: uml3] |
| | 197 | |- uml5 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] |
| | 198 | | |- uml3 [tq: 43, ttl: 48, neigh: uml5, prev_sender: uml3] |
| | 199 | | |- uml6 [tq: 43, ttl: 48, neigh: uml5, prev_sender: uml3] |
| | 200 | | | |- uml8 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] |
| | 201 | | | |- uml5 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] |
| | 202 | | | |- uml7 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] |
| | 203 | | | | |- uml8 [tq: 5, ttl: 46, neigh: uml7, prev_sender: uml6] |
| | 204 | | | | | |- uml6 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] |
| | 205 | | | | | |- uml9 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] |
| | 206 | | | | | \- uml7 [tq: 0, ttl: 45, neigh: uml8, prev_sender: uml7] |
| | 207 | | | | \- uml6 [tq: 5, ttl: 46, neigh: uml7, prev_sender: uml6] |
| | 208 | | | \- uml4 [tq: 16, ttl: 47, neigh: uml6, prev_sender: uml5] |
| | 209 | | \- uml4 [tq: 43, ttl: 48, neigh: uml5, prev_sender: uml3] |
| | 210 | |- uml1 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] |
| | 211 | | \- uml2 [tq: 49, ttl: 48, neigh: uml1, prev_sender: uml3] |
| | 212 | \- uml4 [tq: 255, ttl: 50, neigh: uml3, prev_sender: uml3] |
| | 213 | |- uml3 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] |
| | 214 | |- uml6 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] |
| | 215 | |- uml2 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] |
| | 216 | \- uml5 [tq: 114, ttl: 49, neigh: uml4, prev_sender: uml3] |
| | 217 | [...] |
| | 218 | |
| | 219 | batctl originators |
| | 220 | ================== |
| | 221 | |
| | 222 | Check the Originators table |
| | 223 | |
| | 224 | Usage: batctl originators|o |
| | 225 | |
| | 226 | Example: |
| | 227 | |
| | 228 | $ batctl originators |
| | 229 | Originator (#/255) Nexthop [outgoingIF]: Potential nexthops ... [B.A.T.M.A.N. adv 0.2-beta r1457, MainIF/MAC: eth0/fe:fe:00:00:01:01] |
| | 230 | fe:fe:00:00:05:01 (223) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 96) fe:fe:00:00:02:01 (223) |
| | 231 | fe:fe:00:00:04:01 (233) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 (100) fe:fe:00:00:02:01 (233) |
| | 232 | fe:fe:00:00:02:01 (254) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:02:01 (254) fe:fe:00:00:03:01 (100) |
| | 233 | fe:fe:00:00:07:01 (203) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:02:01 (203) fe:fe:00:00:03:01 ( 88) |
| | 234 | fe:fe:00:00:08:01 (196) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 0) fe:fe:00:00:02:01 (196) |
| | 235 | fe:fe:00:00:03:01 (244) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 (104) fe:fe:00:00:02:01 (244) |
| | 236 | fe:fe:00:00:09:01 (184) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:02:01 (184) fe:fe:00:00:03:01 ( 72) |
| | 237 | fe:fe:00:00:06:01 (214) fe:fe:00:00:02:01 [ eth0]: fe:fe:00:00:03:01 ( 76) fe:fe:00:00:02:01 (214) |
| | 238 | |
| | 239 | batctl interface |
| | 240 | ================ |
| | 241 | |
| | 242 | display or modify the interface settings |
| | 243 | |
| | 244 | Usage: batctl interface|if [none|interface] |
| | 245 | |
| | 246 | Example: |
| | 247 | |
| | 248 | $ batctl interface |
| | 249 | [ active] eth0 fe:fe:00:00:01:01 |
| | 250 | |
| | 251 | batctl interval |
| | 252 | =============== |
| | 253 | |
| | 254 | display or modify the originator interval in ms |
| | 255 | |
| | 256 | Usage: batctl interval|it [orig_interval] |
| | 257 | |
| | 258 | Example: |
| | 259 | |
| | 260 | $ batctl interval |
| | 261 | 1000 |
| | 262 | |
| | 263 | batctl log |
| | 264 | ========== |
| | 265 | |
| | 266 | read the log produced by the kernel module |
| | 267 | |
| | 268 | Usage: batctl log|l |
| | 269 | |
| | 270 | Example: |
| | 271 | |
| | 272 | $ batctl log |
| | 273 | r) |
| | 274 | [ 400] Received BATMAN packet via NB: fe:fe:00:00:02:01 IF: eth0 [fe:fe:00:00:01:01] (from OG: fe:fe:00:00:01:01 via prev OG: fe:fe:00:00:01:01 seqno 670, tq 245, TTL 49, V 8, IDF 1) |
| | 275 | [ 400] Drop packet: originator packet from myself (via neighbour) |
| | 276 | [ 400] Received BATMAN packet via NB: fe:fe:00:00:02:01 IF: eth0 [fe:fe:00:00:01:01] (from OG: fe:fe:00:00:02:01 via prev OG: fe:fe:00:00:02:01 seqno 545, tq 255, TTL 50, V 8, IDF 0) |
| | 277 | [ 400] updating last_seqno: old 544, new 545 |
| | 278 | [ 400] bidirectional: orig = fe:fe:00:00:02:01 neigh = fe:fe:00:00:02:01 => own_bcast = 64, real recv = 64, local tq: 255, asym_penalty: 255, total tq: 255 |
| | 279 | [ 400] update_originator(): Searching and updating originator entry of received packet |
| | 280 | [ 400] Updating existing last-hop neighbour of originator |
| | 281 | [...] |
| | 282 | |
| | 283 | batctl loglevel |
| | 284 | =============== |
| | 285 | |
| | 286 | display or modify the log level |
| | 287 | |
| | 288 | Usage: batctl |ll [level] |
| | 289 | |
| | 290 | Example: |
| | 291 | $ batctl loglevel |
| | 292 | [x] critical (0) |
| | 293 | [x] warnings (1) |
| | 294 | [x] notices (2) |
| | 295 | [x] batman (4) |
| | 296 | [x] routes (8) |
| | 297 | |
| | 298 | batctl aggregation |
| | 299 | ================== |
| | 300 | |
| | 301 | display or modify the packet aggregation setting |
| | 302 | |
| | 303 | Usage: batctl aggregation|ag [0|1] |
| | 304 | |
| | 305 | batctl translocal |
| | 306 | ================= |
| | 307 | |
| | 308 | display the local translation table |
| | 309 | |
| | 310 | Usage: batctl translocal|tl |
| | 311 | |
| | 312 | Example: |
| | 313 | |
| | 314 | $ batctl translocal |
| | 315 | Locally retrieved addresses (from bat0) announced via HNA: |
| | 316 | * d6:e0:fd:d9:00:00 |
| | 317 | |
| | 318 | batctl transglobal |
| | 319 | ================== |
| | 320 | |
| | 321 | display the global translation table |
| | 322 | |
| | 323 | Usage: batctl transglobal|tg |
| | 324 | |
| | 325 | Example: |
| | 326 | |
| | 327 | Globally announced HNAs received via the mesh (translation table): |
| | 328 | * 16:aa:c4:a2:00:00 via fe:fe:00:00:09:01 |
| | 329 | * 5a:32:f9:df:00:00 via fe:fe:00:00:03:01 |
| | 330 | * 32:ae:5a:00:00:00 via fe:fe:00:00:04:01 |
| | 331 | * 86:88:80:29:00:00 via fe:fe:00:00:08:01 |
| | 332 | * 9e:d8:72:f2:00:00 via fe:fe:00:00:02:01 |
| | 333 | * 76:84:68:49:00:00 via fe:fe:00:00:05:01 |
| | 334 | * 86:4b:b2:d2:00:00 via fe:fe:00:00:07:01 |
| | 335 | * ca:a1:5b:e5:00:00 via fe:fe:00:00:06:01 |
| | 336 | |
| | 337 | batctl visformat |
| | 338 | ================ |
| | 339 | |
| | 340 | display or modify the vis output format |
| | 341 | |
| | 342 | Usage: batctl visformat|vf [format] |
| | 343 | |
| | 344 | Example: |
| | 345 | |
| | 346 | $ batctl visformat |
| | 347 | [x] dot_draw |
| | 348 | [ ] json |
| | 349 | |
| | 350 | |
| | 351 | |