| 204 | |
| 205 | = B.A.T.M.A.N. |
| 206 | |
| 207 | Better Approach To Mobile Adhoc Networking is a routing protocol which enables the user to create a decentralized layer 2 network. For more information see the [https://www.open-mesh.org/projects/batman-adv/wiki official BATMAN wiki]. |
| 208 | |
| 209 | This example is directed at Ubuntu users, though BATMAN can be used with OpenWRT and Buildroot as well. |
| 210 | |
| 211 | Before configuration make sure you have antennas or attenuators connected. Then verify your wireless radio is capable of being used for mesh. This can be checked using the command "iw list |grep mesh -i". |
| 212 | |
| 213 | To begin, flash two boards with the image linked below: |
| 214 | |
| 215 | http://dev.gateworks.com/newport/images/focal-newport.img.gz |
| 216 | |
| 217 | Boot them and install batman-adv: |
| 218 | |
| 219 | {{{#!bash |
| 220 | apt install batctl -y |
| 221 | }}} |
| 222 | |
| 223 | Edit /etc/modules add the line below: |
| 224 | {{{ |
| 225 | batman-adv |
| 226 | }}} |
| 227 | 'sync' then power cycle the boards, once you're back to the command prompt issue the following commands: |
| 228 | {{{#!bash |
| 229 | ip link set up dev wlan0 |
| 230 | iw dev wlan0 del |
| 231 | iw phy phy0 interface add wlan0 type mesh |
| 232 | ip link set up mtu 1532 dev wlan0 |
| 233 | iw dev wlan0 mesh join my-mesh-network |
| 234 | batctl if add wlan0 |
| 235 | # Optional, use "batctl if" to see if your interface is active. |
| 236 | ip link set up dev bat0 |
| 237 | batctl n |
| 238 | }}} |
| 239 | |
| 240 | With this is done on both boards "batctrl n" should display the MAC of the neighbor board: |
| 241 | {{{ |
| 242 | root@focal-newport:~# batctl n |
| 243 | [B.A.T.M.A.N. adv 2019.4, MainIF/MAC: wlan0/04:f0:21:3e:59:55 (bat0/ae:23:a0:50:1c:27 BATMAN_IV)] |
| 244 | IF Neighbor last-seen |
| 245 | wlan0 04:f0:21:3e:59:56 0.084s |
| 246 | }}} |