.. | .. |
---|
27 | 27 | $ insmod batman-adv.ko |
---|
28 | 28 | |
---|
29 | 29 | The module is now waiting for activation. You must add some interfaces on which |
---|
30 | | -batman can operate. After loading the module batman advanced will scan your |
---|
31 | | -systems interfaces to search for compatible interfaces. Once found, it will |
---|
32 | | -create subfolders in the ``/sys`` directories of each supported interface, |
---|
33 | | -e.g.:: |
---|
34 | | - |
---|
35 | | - $ ls /sys/class/net/eth0/batman_adv/ |
---|
36 | | - elp_interval iface_status mesh_iface throughput_override |
---|
37 | | - |
---|
38 | | -If an interface does not have the ``batman_adv`` subfolder, it probably is not |
---|
39 | | -supported. Not supported interfaces are: loopback, non-ethernet and batman's |
---|
40 | | -own interfaces. |
---|
41 | | - |
---|
42 | | -Note: After the module was loaded it will continuously watch for new |
---|
43 | | -interfaces to verify the compatibility. There is no need to reload the module |
---|
44 | | -if you plug your USB wifi adapter into your machine after batman advanced was |
---|
45 | | -initially loaded. |
---|
46 | | - |
---|
47 | | -The batman-adv soft-interface can be created using the iproute2 tool ``ip``:: |
---|
| 30 | +batman-adv can operate. The batman-adv soft-interface can be created using the |
---|
| 31 | +iproute2 tool ``ip``:: |
---|
48 | 32 | |
---|
49 | 33 | $ ip link add name bat0 type batadv |
---|
50 | 34 | |
---|
.. | .. |
---|
52 | 36 | |
---|
53 | 37 | $ ip link set dev eth0 master bat0 |
---|
54 | 38 | |
---|
55 | | -Repeat this step for all interfaces you wish to add. Now batman starts |
---|
| 39 | +Repeat this step for all interfaces you wish to add. Now batman-adv starts |
---|
56 | 40 | using/broadcasting on this/these interface(s). |
---|
57 | | - |
---|
58 | | -By reading the "iface_status" file you can check its status:: |
---|
59 | | - |
---|
60 | | - $ cat /sys/class/net/eth0/batman_adv/iface_status |
---|
61 | | - active |
---|
62 | 41 | |
---|
63 | 42 | To deactivate an interface you have to detach it from the "bat0" interface:: |
---|
64 | 43 | |
---|
65 | 44 | $ ip link set dev eth0 nomaster |
---|
66 | 45 | |
---|
| 46 | +The same can also be done using the batctl interface subcommand:: |
---|
67 | 47 | |
---|
68 | | -All mesh wide settings can be found in batman's own interface folder:: |
---|
| 48 | + batctl -m bat0 interface create |
---|
| 49 | + batctl -m bat0 interface add -M eth0 |
---|
69 | 50 | |
---|
70 | | - $ ls /sys/class/net/bat0/mesh/ |
---|
71 | | - aggregated_ogms fragmentation isolation_mark routing_algo |
---|
72 | | - ap_isolation gw_bandwidth log_level vlan0 |
---|
73 | | - bonding gw_mode multicast_mode |
---|
74 | | - bridge_loop_avoidance gw_sel_class network_coding |
---|
75 | | - distributed_arp_table hop_penalty orig_interval |
---|
| 51 | +To detach eth0 and destroy bat0:: |
---|
76 | 52 | |
---|
77 | | -There is a special folder for debugging information:: |
---|
| 53 | + batctl -m bat0 interface del -M eth0 |
---|
| 54 | + batctl -m bat0 interface destroy |
---|
78 | 55 | |
---|
79 | | - $ ls /sys/kernel/debug/batman_adv/bat0/ |
---|
80 | | - bla_backbone_table log neighbors transtable_local |
---|
81 | | - bla_claim_table mcast_flags originators |
---|
82 | | - dat_cache nc socket |
---|
83 | | - gateways nc_nodes transtable_global |
---|
| 56 | +There are additional settings for each batadv mesh interface, vlan and hardif |
---|
| 57 | +which can be modified using batctl. Detailed information about this can be found |
---|
| 58 | +in its manual. |
---|
84 | 59 | |
---|
85 | | -Some of the files contain all sort of status information regarding the mesh |
---|
86 | | -network. For example, you can view the table of originators (mesh |
---|
87 | | -participants) with:: |
---|
| 60 | +For instance, you can check the current originator interval (value |
---|
| 61 | +in milliseconds which determines how often batman-adv sends its broadcast |
---|
| 62 | +packets):: |
---|
88 | 63 | |
---|
89 | | - $ cat /sys/kernel/debug/batman_adv/bat0/originators |
---|
90 | | - |
---|
91 | | -Other files allow to change batman's behaviour to better fit your requirements. |
---|
92 | | -For instance, you can check the current originator interval (value in |
---|
93 | | -milliseconds which determines how often batman sends its broadcast packets):: |
---|
94 | | - |
---|
95 | | - $ cat /sys/class/net/bat0/mesh/orig_interval |
---|
| 64 | + $ batctl -M bat0 orig_interval |
---|
96 | 65 | 1000 |
---|
97 | 66 | |
---|
98 | 67 | and also change its value:: |
---|
99 | 68 | |
---|
100 | | - $ echo 3000 > /sys/class/net/bat0/mesh/orig_interval |
---|
| 69 | + $ batctl -M bat0 orig_interval 3000 |
---|
101 | 70 | |
---|
102 | 71 | In very mobile scenarios, you might want to adjust the originator interval to a |
---|
103 | 72 | lower value. This will make the mesh more responsive to topology changes, but |
---|
104 | 73 | will also increase the overhead. |
---|
| 74 | + |
---|
| 75 | +Information about the current state can be accessed via the batadv generic |
---|
| 76 | +netlink family. batctl provides a human readable version via its debug tables |
---|
| 77 | +subcommands. |
---|
105 | 78 | |
---|
106 | 79 | |
---|
107 | 80 | Usage |
---|
.. | .. |
---|
142 | 115 | $ dmesg | grep batman-adv |
---|
143 | 116 | |
---|
144 | 117 | When investigating problems with your mesh network, it is sometimes necessary to |
---|
145 | | -see more detail debug messages. This must be enabled when compiling the |
---|
146 | | -batman-adv module. When building batman-adv as part of kernel, use "make |
---|
| 118 | +see more detailed debug messages. This must be enabled when compiling the |
---|
| 119 | +batman-adv module. When building batman-adv as part of the kernel, use "make |
---|
147 | 120 | menuconfig" and enable the option ``B.A.T.M.A.N. debugging`` |
---|
148 | 121 | (``CONFIG_BATMAN_ADV_DEBUG=y``). |
---|
149 | 122 | |
---|
150 | | -Those additional debug messages can be accessed using a special file in |
---|
151 | | -debugfs:: |
---|
| 123 | +Those additional debug messages can be accessed using the perf infrastructure:: |
---|
152 | 124 | |
---|
153 | | - $ cat /sys/kernel/debug/batman_adv/bat0/log |
---|
| 125 | + $ trace-cmd stream -e batadv:batadv_dbg |
---|
154 | 126 | |
---|
155 | 127 | The additional debug output is by default disabled. It can be enabled during |
---|
156 | | -run time. Following log_levels are defined: |
---|
| 128 | +run time:: |
---|
157 | 129 | |
---|
158 | | -.. flat-table:: |
---|
| 130 | + $ batctl -m bat0 loglevel routes tt |
---|
159 | 131 | |
---|
160 | | - * - 0 |
---|
161 | | - - All debug output disabled |
---|
162 | | - * - 1 |
---|
163 | | - - Enable messages related to routing / flooding / broadcasting |
---|
164 | | - * - 2 |
---|
165 | | - - Enable messages related to route added / changed / deleted |
---|
166 | | - * - 4 |
---|
167 | | - - Enable messages related to translation table operations |
---|
168 | | - * - 8 |
---|
169 | | - - Enable messages related to bridge loop avoidance |
---|
170 | | - * - 16 |
---|
171 | | - - Enable messages related to DAT, ARP snooping and parsing |
---|
172 | | - * - 32 |
---|
173 | | - - Enable messages related to network coding |
---|
174 | | - * - 64 |
---|
175 | | - - Enable messages related to multicast |
---|
176 | | - * - 128 |
---|
177 | | - - Enable messages related to throughput meter |
---|
178 | | - * - 255 |
---|
179 | | - - Enable all messages |
---|
180 | | - |
---|
181 | | -The debug output can be changed at runtime using the file |
---|
182 | | -``/sys/class/net/bat0/mesh/log_level``. e.g.:: |
---|
183 | | - |
---|
184 | | - $ echo 6 > /sys/class/net/bat0/mesh/log_level |
---|
185 | | - |
---|
186 | | -will enable debug messages for when routes change. |
---|
| 132 | +will enable debug messages for when routes and translation table entries change. |
---|
187 | 133 | |
---|
188 | 134 | Counters for different types of packets entering and leaving the batman-adv |
---|
189 | 135 | module are available through ethtool:: |
---|
.. | .. |
---|
214 | 160 | #batman on irc.freenode.org |
---|
215 | 161 | Mailing-list: |
---|
216 | 162 | b.a.t.m.a.n@open-mesh.org (optional subscription at |
---|
217 | | - https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n) |
---|
| 163 | + https://lists.open-mesh.org/mailman3/postorius/lists/b.a.t.m.a.n.lists.open-mesh.org/) |
---|
218 | 164 | |
---|
219 | 165 | You can also contact the Authors: |
---|
220 | 166 | |
---|