Skip to content

libresystems/raspberry_os_batman_bridge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Batman-adv Setup Script for Raspberry Pi OS

A comprehensive setup script for configuring Batman-adv mesh networking on Raspberry Pi OS, with support for both WiFi and Ethernet interfaces.

Features

  • Easy installation of Batman-adv and required dependencies
  • Support for both WiFi and Ethernet interfaces
  • Automatic gateway selection and load balancing
  • Configurable mesh network settings
  • Built-in diagnostic tools
  • Visualization support with Alfred and batadv-vis
  • Backup and restore functionality
  • Uninstall option

Prerequisites

  • Raspberry Pi running Raspberry Pi OS (Bookworm recommended)
  • Root access
  • Internet connection for initial setup
  • WiFi adapter (if using WiFi mesh)

Quick Installation

You can run the script directly from GitHub using one of these methods:

Method 1: Using curl

sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/kimasplund/raspberry_os_batman_bridge/main/enable_batman.sh)"

Method 2: Using wget

sudo bash -c "$(wget -O- https://raw.githubusercontent.com/kimasplund/raspberry_os_batman_bridge/main/enable_batman.sh)"

Manual Installation

  1. Clone the repository:
git clone https://github.com/kimasplund/raspberry_os_batman_bridge.git
cd raspberry_os_batman_bridge
  1. Make the script executable:
chmod +x enable_batman.sh
  1. Run the script as root:
sudo ./enable_batman.sh

Usage Options

The script supports the following command-line options:

-h, --help              Display help message
-s, --static-ip         Configure with static IP instead of DHCP
-w, --wifi-iface NAME   Specify WiFi interface name (default: wlan0)
-e, --eth-iface NAME    Specify Ethernet interface name (default: eth0)
-v, --visualization     Install and configure Alfred visualization tools
-u, --uninstall         Remove Batman-adv configuration and restore backups

Configuration Options

During installation, you'll be prompted to configure:

  1. WiFi Settings:

    • SSID
    • Password
    • Country code
  2. Batman-adv Settings:

    • Mesh network name
    • WiFi channel (auto/manual)
    • Bandwidth settings
    • Routing algorithm (BATMAN_V/BATMAN_IV)
    • Gateway mode (server/client/off)

Diagnostic Tools

After installation, a diagnostic tool is available at /usr/local/bin/batman-diagnose.sh. Run it with:

sudo batman-diagnose.sh

The diagnostic tool provides options to:

  • Check internet connectivity
  • Monitor gateway selection and status
  • View mesh topology and routing
  • Check link quality between nodes
  • Monitor throughput settings
  • Verify system status

Useful Commands

After installation, you can use these commands to monitor your mesh network:

# Check interface status
batctl meshif bat0 interface

# Check mesh neighbors
batctl meshif bat0 originators

# Check gateway status
batctl meshif bat0 gateways

# Check routing table
batctl meshif bat0 translocal

# Check interface details
ip link show bat0

# Check gateway selection
batctl meshif bat0 gateways -r

# Check link quality
batctl meshif bat0 interface <iface>

Gateway Selection

The script supports three gateway modes:

  1. server - This node can act as a gateway (Use if this Pi has internet access)
  2. client - This node will use other nodes as gateways (Use for most nodes)
  3. off - This node won't participate in gateway selection (Use for specialized nodes)

Batman-adv automatically selects the best gateway based on:

  • Link quality
  • Available bandwidth
  • Network latency
  • Number of hops

Multiple nodes can be set as 'server' - Batman-adv will choose the optimal gateway for each connection.

Uninstallation

To remove Batman-adv and restore your original network configuration:

sudo ./enable_batman.sh --uninstall

Author

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%