Batman adv over powerline

Which device are you using ?

Do you have any radio interface at all available ?

sorry, completely forgot...
Primary router is a Fritz 3370 with internet access via pppoe. Second one would be an Archer C50 v1.
Both with wifi. They both shall be access points for clients like smartphones. And thy are running a self build OpenWRT 19.07.3.

Kernel version: 4.14.180
batman version: openwrt-2019.2-7
batctl version: openwrt-2019.2-4

I intend to maybe add Fritz 7412 and w8970 v1 later.

Ok, does these commands run successfully ?

batctl -m bat0 interface create
batctl -m bat0 interface add -M eth0

I have not yet done a batman-adv with just ethernet myself

let see if we can find out what required

Sure
Thank you already or your help

I first ran the batctl ... destroy because the bat0 device was (kind of) create already by my /etc/config/network. It fails at the last one

root@owrt:~# batctl -m bat0 interface destroy
root@owrt:~# batctl -m bat0 interface create
root@owrt:~# batctl -m bat0 interface add -M eth0
Error - interface does not exist: -M

after running these commands I got the following:

root@owrt:~# ip -detail link show bat0
22: bat0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether ee:b0:76:5b:11:34 brd ff:ff:ff:ff:ff:ff promiscuity 0 
    batadv addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 

Ok, i took these commands from wiki, they might be not so OpenWRT friendly as the switches might be different

Right
I have tried that one before and in fact the -M is the only problem here. It works (at least I think it does) without the -M switch

root@owrt:~# batctl -m bat0 interface add eth0
root@owrt:~# ip -detail link show bat0
22: bat0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether ee:b0:76:5b:11:34 brd ff:ff:ff:ff:ff:ff promiscuity 0 
    batadv addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
root@owrt:~# ip -detail link show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bat0 state UP mode DEFAULT group default qlen 1000
    link/ether 0a:2f:cb:8b:59:5d brd ff:ff:ff:ff:ff:ff promiscuity 2 
    batadv_slave addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

Ok, cool

Now if you have 2 devices connected via Ethernet and setup the bat0 interface

does

batctl n

show another device ?

I did the same steps on both devices. The good news batctl n doesn't throw errors any more. The bad news:

root@owrt:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: eth0/x:x:x:x:x:x (bat0/x:x:x:x:x:x BATMAN_IV)]
IF             Neighbor              last-seen

And to let you know: currently both devices are connected via lan cable and the archer c50 is requesting an ip address on its lan interface from the fritz 3370.

Ok, so I think we need more commands

On wireless you need to set mesh-id and join same mesh

batctl will if it works show layer 2 mac we can set layer 3 ip later

ie

iw phy phy0 interface add mesh0 type mp mesh_id mymesh

and

iw dev $MESH_IFACE station dump

or

Just set ip on each node and see if they can ping each other

NodeA: ip link set up dev bat0
NodeA: ip addr add 192.168.0.1/24 dev bat0

NodeB: ip link set up dev bat0
NodeB: ip addr add 192.168.0.2/24 dev bat0
NodeB: ping 192.168.0.1

Sure can do that one as well. But finished a wifi setup right now. unfortunately still not working. I used the uci config files because I am more familiar with them. Here is what I have done:

Node A:

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
        option htmode 'HT20'
        option hwmode '11g'
        option country 'DE'
        option channel '1'

config wifi-iface 'wifinet1'
        option device 'radio0'
        option mode 'mesh'
        option encryption 'none'
        option mesh_id 'test'
        option mesh_fwding '0'
        option mesh_rssi_threshold '0'
        option network 'lan'

Node B:

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '36'
        option hwmode '11a'
        option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
        option htmode 'VHT80'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/10180000.wmac'
        option htmode 'HT20'
        option channel '1'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option encryption 'none'
        option mesh_rssi_threshold '0'
        option mode 'mesh'
        option mesh_fwding '0'
        option mesh_id 'test'

Layer 1 connectivity seams to work
Node A:

Station x:x:x:x:x:x (on wlan0)
	inactive time:	28 ms
	rx bytes:	70088889
	rx packets:	361713
	tx bytes:	61909059
	tx packets:	105642
	tx retries:	21371
	tx failed:	0
	rx drop misc:	62
	signal:  	-23 [-30, -29, -26] dBm
	signal avg:	-24 [-30, -28, -28] dBm
	Toffset:	35563537 us
	tx bitrate:	65.0 MBit/s MCS 6 short GI
	rx bitrate:	43.3 MBit/s MCS 4 short GI
	rx duration:	0 us
	expected throughput:	31.218Mbps
	mesh llid:	65068
	mesh plid:	41937
	mesh plink:	ESTAB
	mesh local PS mode:	ACTIVE
	mesh peer PS mode:	ACTIVE
	mesh non-peer PS mode:	ACTIVE
	authorized:	yes
	authenticated:	yes
	associated:	yes
	preamble:	long
	WMM/WME:	yes
	MFP:		no
	TDLS peer:	no
	DTIM period:	2
	beacon interval:100
	short slot time:yes
	connected time:	663 seconds

Node B:

Station x:x:x:x:x:x (on wlan1)
	inactive time:	0 ms
	rx bytes:	63623539
	rx packets:	125956
	tx bytes:	58818783
	tx packets:	259106
	tx retries:	60684
	tx failed:	194
	rx drop misc:	3340
	signal:  	-26 dBm
	signal avg:	-27 dBm
	Toffset:	18446744073673974193 us
	tx bitrate:	78.0 MBit/s MCS 12
	rx bitrate:	130.0 MBit/s MCS 14 short GI
	rx duration:	0 us
	expected throughput:	29.21Mbps
	mesh llid:	41937
	mesh plid:	65068
	mesh plink:	ESTAB
	mesh local PS mode:	ACTIVE
	mesh peer PS mode:	ACTIVE
	mesh non-peer PS mode:	ACTIVE
	authorized:	yes
	authenticated:	yes
	associated:	yes
	preamble:	long
	WMM/WME:	yes
	MFP:		no
	TDLS peer:	no
	DTIM period:	2
	beacon interval:100
	short slot time:yes
	connected time:	647 seconds

edit
I take back everything and and claim the opposite
i missed adding wlan0 to bat0

root@owrt:/etc/config# batctl -m bat0 interface add wlan0
root@owrt:/etc/config# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: eth0/x:x:x:x:x:x (bat0/x:x:x:x:x:x BATMAN_IV)]
IF             Neighbor              last-seen
        wlan0	  x:x:x:x:x:x    0.128s

But the question remains why it was not working via cable. Is there some trickery with VLANs involved?

I actually build my mesh firmware by adding the LibreMesh feed and adding some config options after to setup few things

Libremesh automatically configures vlan tunnel and mesh batman interfaces

I will see what happen after this if i disable the wifi

Will report back on that when im done

Is there a guide to do that?

yes,

Compiling LibreMesh from source code

https://libremesh.org/development.html

the chef builder not always worked well

Thanks! :+1:

1 Like

Ok, so built a mesh firmware then disabled wireless and connected them together via ethernet cable

batctl dont work as it should

devices can communicate and ping each other but that not over batman-adv

That I really did not expect. Would have thought I did something wrong.
I mean in any case batman "just" uses some layer 1 interface to do its layer 2 thing on top of it. So I feel like there must be a way of accomplishing this via lan port similar to the wifi interface.

@markbirss do you know someone else in the forum who may have a deeper understanding? Otherwise I would reach out to the batman guys via issue report.
And how ever this may turns out... Thanks a lot for your time and your help !

Maybe post a new topic specifically for batman-adv over ethernet also

I will also discuss this with a local friend

Okay
Will do
Thanks a lot

edit:
While digging around a second time to collect the essence of what we have done I stumbled across this one:

The network configuration in '/etc/config/network' allows to specify batman-adv as protocol and the batman-adv interface name. It is also possible to add other interfaces (like eth0) to the same mesh interface:

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

config interface 'bat0_hardif_eth0'
    option mtu '1532'
    option proto 'batadv'
    option mesh 'bat0'
    option ifname 'eth0'

That looks much more like something I would have expected. Would like to try this one first. Unfortunately I am not with my routers for two days so it will take a bit.

I have tried a similar setup at another place (spoiler - didn't work):
Obviously the versions are different but I am not aware of any major changes regarding batman. Does anyone may have a hint how to properly monitor what batman is doing on the link layer by batctl td or comparable tools?

Hardeware:

  1. Fritz 3370
  2. TD-W8970B

OpenWRT:

  1. OpenWrt SNAPSHOT r12896-5d7812495b
  2. OpenWrt 19.07.2 r10947-65030d81f3

Kernel:

  1. 4.19.108
  2. 4.14.171

Batman:

  1. batctl 2020.0-openwrt-1 [batman-adv: 2020.0-openwrt-1]
  2. batctl openwrt-2019.2-3 [batman-adv: openwrt-2019.2-5]

Network Config:

  1. (Fritz 3370)
config interface 'lan'               
        option type 'bridge'         
        option proto 'static'        
        option stp '1'               
        option netmask '255.255.255.0'
        option ipaddr 'x.x.x.x'    
        option ifname 'bat0 if-lan'   
        option delegate '0'           
        option gateway 'x.x.x.x'  
        option ip6assign '64'         
                                     
config interface 'bat0'               
        option proto 'batadv'          
        option routing_algo 'BATMAN_IV'
        option aggregated_ogms '1'     
        option ap_isolation '0'        
        option bonding '0'             
        option fragmentation '1'       
        option gw_bandwidth '10000/2000'
        option log_level '0'            
        option orig_interval '1000'     
        option bridge_loop_avoidance '1'
        option distributed_arp_table '1'
        option multicast_mode '1'       
        option multicast_fanout '16'    
        option network_coding '0'       
        option hop_penalty '30'         
        option isolation_mark '0x00000000/0x00000000'
                                                     
# add eth0 as hardif to bat0                                              
config interface 'bat0_hardif_eth0'                                       
        option proto 'batadv_hardif'               
        option master 'bat0'                       
        option mtu '1536'           
        option ifname 'eth0.1'                     
        option 'elp_interval' 500                  
        # change throughput_override to 0 to use automatic detection; also allows kbit suffix
        option 'throughput_override' '1mbit' 
  1. (TD-W8970B)
config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1 if-lan bat0'
        option proto 'dhcp'

config interface 'mesh'
        option ifname 'if-lan-mesh'
        option master 'bat0'
        option mtu '2304'
        option proto 'batadv_hardif'

config interface 'bat0'
        option proto 'batadv'
        option routing_algo 'BATMAN_V'
        option ap_isolation '1'
        option gw_mode 'client'
        option orig_interval '1000'

config interface 'bat0_hardif_eth0'
        option proto 'batadv_hardif'
        option master 'bat0'
        option mtu '1536'
        option ifname 'eth0.3'
        option 'elp_interval' 500
        # change throughput_override to 0 to use automatic detection; also allows kbit suffix
        option 'throughput_override' '1mbit'

batctl if

  1. eth0.1: active
  2. eth0.3: active

Using ip addr the interface masters are set like my uneducated mind would consider it correct.
Sadly batctl n still does not show anything.

I am pretty confident that I set the VLANs correctly but maybe some notices something. I will go on and create another post now asking for specific help.