BATMAN in IBSS with netifd

Hello,

I'm trying to configure BATMAN in my Open WRT device with netifd but, it's being impossible. That's my situation:

  • My transceiver doesn't support Mesh Point mode so I have to use adhoc (IBSS).
  • I have got the latest batman-adv module version inserted in my system.
  • I've got all the batman proto files.
  • I've configured direct wifi mesh communication and 'bat 0' interface using those shell commands and it works:
Node1

iw wlan0 set type ibss
ip link set wlan0 up
ip address add 192.168.2.33/24 dev wlan0
iw dev wlan0 ibss join ingerev 2412
ip link add name bat0 type batadv
ip link set dev wlan0 master bat0

Node 2

iw wlan0 set type ibss
ip link set wlan0 up
ip address add 192.168.2.34/24 dev wlan0
iw dev wlan0 ibss join ingerev 2412
ip link add name bat0 type batadv
ip link set dev wlan0 master bat0

The problem appears when I want to configure it modifying etc/config/wireless and etc/config/network files. This is what I've:

/etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '1'
	option phy 'phy0'
	option disabled '0'

config wifi-iface 'ap'
	option device 'radio0'
	option mode 'ap'
	option network 'radio0ap'
	option encryption 'psk2'
	option disabled '0'
	option ssid 'ingerev'
	option key '7116db6e'	

config wifi-iface 'sta'
	option device 'radio0'
	option mode 'sta'
	option network 'radio0sta'
	option ssid 'sta'
	option encryption 'psk2'
	option key 'stastast'
	option disabled '1'

config wifi-iface 'wmesh'
    option device 'radio0'
    option ifname 'adhoc0'
    option network 'bat0_hardif_wlan'
    option mode 'adhoc'
    option ssid 'mesh'
    option 'mcast_rate' '18000'
    option bssid '02:CA:FE:CA:CA:40'

/etc/config/network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'
	option ipv6 '0'

config interface 'usb'
	option ifname 'usb0'
	option proto 'static'
	option ipaddr '192.168.33.33'
	option netmask '255.255.255.0'
	option ipv6 '0'

config interface 'radio0ap'
	option ifname 'wlan0'
	option proto 'static'
	option ipaddr '192.168.2.33'
	option netmask '255.255.255.0'
	option ipv6 '1'

config interface 'radio0sta'
	option ifname 'wlan1'
	option proto 'dhcp'
	option ipv6 '1'

config interface 'lan'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.33'
	option netmask '255.255.255.0'
	option ipv6 '1'

config interface 'plc'
	option ifname 'eth2'
	option proto 'static'
	option ip6assign '60'
	option macaddr 'a0:b0:c0:d0:e0:f0'

config interface 'wan'
	option proto 'wwan'
	option ipv6 '0'
	option apn 'movistar.es'
	option username 'movistar'
	option password 'movistar'
	option discover_apn '1'

config globals 'globals'
	option ula_prefix 'auto'

config interface 'bat0_hardif_wlan'
    option mtu '1532'
    option proto 'batadv'
    option mesh 'bat0'
    option routing_algo 'BATMAN_V'

I do etc/init.d/network reload and there is no wireless interface... 'bat0' neither

I need your help. Thank you for your attention!

These two statements seem to be self-contradictory.

The latest batman-adv that I am aware of is 2019.4 which does not have "batman proto" files (changed with 2019.0 in March, 2019).

If 2019.4 or later is not available for your build (and even if it is), I'd suggest moving to 19.07 or master (snapshot).

See further:

With "batman proto files" I wanted to say that I have these files:

proto

Moreover, I had visited before all the links you have sent but, even so, I was not able to configure properly. The guide user only explains the mesh point mode, IBSS is not discussed: "IBSS configuration is not discussed in detail on this page."

About the availability of the BATMAN version with my build, I have to admit that I do not know how to check it. However, I do not understand your suggestion.

I will be waiting for your answer. Thanks for your help :wink:

My apologies, I though you were referring to /etc/config/batman-adv (which was used for the older configuration approach).


To determine the installed version, as an example from a running build of this summer (so not the "most recent" versions):

# opkg list-installed | fgrep bat
batctl-full - 2019.3-0
kmod-batman-adv - 4.19.72+2019.3-0
libattr - 2.4.48-2

so that build is running 2019.3


On using IBSS, from the perspective of batman-adv, it doesn't matter how the "hard" interfaces are connected together; 802.11s, IBSS, Ethernet, ... , just that they are (and that the MTU is correct).

So, if you're using IBSS, as long as it has the equivalent of option network 'nwi_mesh0' (from the example on the wiki page) in the wifi-iface stanza, netifd should associate it with the batman-adv batadv_hardif when it comes up.

config wifi-iface 'mesh0'
        option device 'radio5pci'
        option ifname 'mesh0'
        option network 'nwi_mesh0'
        option mode 'mesh'
        option mesh_fwding '0'
        option mesh_id '<your advertised mesh "name" goes here>'
        option encryption 'psk2+ccmp'
        option key '<your secure pass phrase goes here>'

I have not configured IBSS under OpenWrt in many years and my search on the wiki or forum wasn't very helpful. You may have better luck.

What I would do is first install LuCI (as I generally don't have it in my builds, though release versions do) and use it to set up an IBSS link between two routers, no batman-adv, with static IPs on each end. I'd probably start unencrypted, then add encryption (assuming that is possible). Once you can confirm that the two routers can ping each other, you can use that as a template for the others in your mesh. While batman-adv doesn't need IP addresses on the interface, keeping them there for debugging can be helpful.

  1. Firstly, I achieved ping between two routers without any other protocol. This step was ok.
  2. In my case, I have not got this SW installed. batman_adv is inserted in my system as a kernel module but, it is not installed with opkg.

mod

  1. I am not sure if the wiki page configuration is right for my system. If it does not support mesh point I guess that it can not work in mesh mode.

What should I do?

Thank you

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.