Script for Starting and Stopping B.A.T.M.A.N Advanced

by prashere
GNU/Linux ◆ xterm-256color ◆ bash 4329 views

B.A.T.M.A.N Adv is a mesh routing protocol which is now bundled as a kernel module and shipped by default on all Linux kernel (you don’t need to install it, it’s already there).

batctl is a command line utility program to manage B.A.T.M.A.N Adv. It doesn’t come by default. It has to be installed manually either through your distributions package manager (like apt-get or dnf or pacman) or compiled from source


At PYMESH (Pondicherry Meshnet), we were experimenting with setting up batman nodes and we wrote a simple shell scripts to configure a laptop wireless to act as a mesh node using batman adv.

git clone the script to your machine

git clone https://github.com/PYMeshnet/scripts.git

Navigate to the cloned directory

cd scripts

To put a node into mesh mode

sudo ./node_init

Once a node is put into mesh mode and is peered with another batman adv node in it’s range, we use batctl to look for neighbours.

sudo batctl o

Again, we use batctl to ping the neighbours using their hw address

sudo batctl ping <hw addr>

To put a node back into normal mode

sudo ./node_quit