[SOLVED] Batman-adv over Ethernet

Hi all,

I am working towards a mesh network over Ethernet (and potentially more wifi access points). Sadly I had some issues setting up Batman-adv mesh over a wired connection. It just seams to do nothing. Furthermore this behavior was confirmed by @markbirss. You can find all the details here: Batman adv over powerline

Quick summary:
Hardware: Fritz 3370 and Archer C50 v1
OpenWRT version: 19.07.3.(self compiled)
Kernel version: 4.14.180
batman version: openwrt-2019.2-7
batctl version: openwrt-2019.2-4

naive setup in /etc/config/network gives:

root@owrt:~# batctl n
Error received: No such file or directory
BATMAN mesh bat0 disabled

batctl step by step approach:

root@owrt:~# batctl -m bat0 interface destroy
root@owrt:~# batctl -m bat0 interface create
root@owrt:~# batctl -m bat0 interface add -M eth0 # this one is mentioned by open mesh tutorial and seams to not work with OpenWRT batman
Error - interface does not exist: -M 
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
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

markbirss and me double checked by setting up a working configuration in my setup by adding wifi link and destroying a working configuration in his setup by disabling wifi link.

At the moment this behavior feels a bit buggy but maybe we are just missing something. More information is happily provided.

Ok, i have it working, it as simple as

Use a current working mesh setup and connect devices to each other via Lan port or switch

Here 2 Aruba AP-105 devices directly connected to each other

https://openwrt.org/toh/aruba/aruba_ap-105

  1. Confirm your current batman interfaces
    dummy is added by LibreMesh - dont remove
    batctl if

  1. Add eth0 to to batman interfaces
    batctl if add eth0


wait a good 30 seconds after adding to each node

  1. Remove the wifi batman interfaces from your output above (batctl if)
    These are my LibreMesh added interfaces dual radio
batctl if del wlan0-mesh_29
batctl if del wlan1-mesh_29

  1. Confirm eth0 interface had been added on nodes with
    batctl if

  1. Test performance to other wired node

batctl o
to see other batman node mac

batctl tp aa:f3:7f:ca:5b:fe

1 Like

Thanks a lot for the afford. Sadly I can not confirm the procedure.
I did each command site by site

root@c50:/etc/config# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: wlan1/x:x:x:x:x:x (bat0/x:x:x:x:x:x BATMAN_IV)]
IF             Neighbor              last-seen
        wlan1     x:x:x:x:x:x    2.300s
root@c50:/etc/config# batctl if
wlan1: active
root@c50:/etc/config# batctl if add eth0
root@c50:/etc/config# batctl if
eth0: active
wlan1: active
root@c50:/etc/config# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: wlan1/x:x:x:x:x:x (bat0/x:x:x:x:x:x BATMAN_IV)]
IF             Neighbor              last-seen
        wlan1     x:x:x:x:x:x    0.930s
root@c50:/etc/config# batctl if del wlan1
root@c50:/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
root@c50:/etc/config# batctl if
eth0: active
root@c50:/etc/config# batctl o
[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)]
   Originator        last-seen (#/255) Nexthop           [outgoingIF]
root@c50:/etc/config# 
root@Fritz3370:/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.668s
root@Fritz3370:/etc/config# batctl if add eth0
root@Fritz3370:/etc/config# batctl if
eth0: active
wlan0: active
root@Fritz3370:/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    2.040s
root@Fritz3370:/etc/config# batctl if del wlan0
root@Fritz3370:/etc/config# batctl if
eth0: active
root@Fritz3370:/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             

@markbirss could you please explain why there are two wifi devices (wlan0-mesh and wlan1-mesh)

And maybe someone can give a hint if LibreMesh is doing something special. Maybe the dummy0 interface?

Libremesh by default create mesh interface for each radio and dummy for batman

1 Like

All right. I have flashed the two routers with the LibreMesh firmware provided by @markbirss. Out of the box they are running and have batman link connectivity. All I am doing is on the Archer C50 device
(might be a longer read)

root@LiMe-f61f6a:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: eth0-2_29/a4:2b:b0:f6:1f:6b (bat0/ae:4a:d9:f3:3c:b8 BATMAN_IV)]
IF             Neighbor              last-seen
   wlan0-mesh_29	  24:65:11:ee:52:4a    0.700s
root@LiMe-f61f6a:~# batctl if
dummy0: active
eth0-2_29: active
wlan1-mesh_29: active
wlan0-mesh_29: active
root@LiMe-f61f6a:~# batctl p 24:65:11:ee:52:4a
PING 24:65:11:ee:52:4a (24:65:11:ee:52:4a) 20(48) bytes of data
20 bytes from 24:65:11:ee:52:4a icmp_seq=1 ttl=50 time=6.70 ms
^C--- 24:65:11:ee:52:4a ping statistics ---
1 packets transmitted, 1 received, 0% packet loss
rtt min/avg/max/mdev = 6.700/6.700/6.700/0.002 ms
root@LiMe-f61f6a:~# 

I am not completely sure what it does yet but the Archer has quite an extensive setup

root@LiMe-f61f6a:~# ip link | grep eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
36: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
38: eth0-1_17@eth0.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1496 qdisc noqueue state UP qlen 1000
39: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
40: eth0-2_17@eth0.2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1496 qdisc noqueue state UP qlen 1000
42: eth0_17@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1496 qdisc noqueue state UP qlen 1000
44: eth0-2_29@eth0.2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bat0 state UP qlen 1000
root@LiMe-f61f6a:~# ip link | grep -E "^\d" | wc -l
19
root@LiMe-f61f6a:~# batctl if add eth0
Error - failed to add interface eth0: File exists

So I just went ahead an disabled the Wifi on the archer what obviously breaks the connection.

root@LiMe-f61f6a:~# batctl if 
dummy0: active
eth0-2_29: active
wlan1-mesh_29: active
root@LiMe-f61f6a:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: eth0-2_29/a4:2b:b0:f6:1f:6b (bat0/ae:4a:d9:f3:3c:b8 BATMAN_IV)]
IF             Neighbor              last-seen

Attaching a wired connection does not add any batman neighbors. So there was at least no batman configured on the lan switch.
Digging a bit deeper in /etc/config/network it looks to me like physical port of the device which by stock firmware was intended for wan is now a batman manged port (which might be what I need).
But to reproduce the behavior show by @markbirss I added the lan switch ports of both devices to batman.
(The Archer is much more complexe then the Fritz)

# Fritz3370
root@LiMe-986eaf:~# batctl if add eth0

# Archer C50
root@LiMe-f61f6a:~# batctl if add eth0-1_17
# Back on C50 only
root@LiMe-f61f6a:~# batctl if add eth0-1_17
root@LiMe-f61f6a:~# batctl if
dummy0: active
eth0-1_17: active
wlan1-mesh_29: active
eth0-2_29: active
root@LiMe-986eaf:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:12:ad:98:6e:af (bat0/da:61:39:ce:7b:1d BATMAN_IV)]
IF             Neighbor              last-seen
         eth0	  a4:2b:b0:f6:1f:6a    0.804s

but that connection did somehow not look verry stable. In my case it the batman neighbor dissaperead after a while from the C50. On the other hand it wasstill present on the Fritz but batctl p did not succeed. But maybe that was my fault. I really did not understand the steup yet.
In any case I still need to figure out a way to persist a working configure. More on it next time.

Here what I am suspecttong to be a ethernet based batman config (not tested yet):

config interface 'wan'           
        option ifname 'eth0.2'          
        option proto 'dhcp'               
                                    
config device 'wan_eth0_2_dev'          
        option name 'eth0.2'        
        option macaddr 'a4:2b:b0:f6:1f:6b'
                                 
config interface 'wan6'                   
        option ifname 'eth0.2' 
        option proto 'none'

config device 'lm_net_eth0_2_batadv_dev'
        option type '8021ad'
        option name 'eth0-2_29'
        option ifname 'eth0.2'
        option vid '29'                   
        option mtu '1532'
                       
config interface 'lm_net_eth0_2_batadv_if'
        option auto '1'    
        option ifname 'eth0-2_29'
        option proto 'batadv_hardif'
        option master 'bat0' 

Yes, that Archer C50 is naming the lan and wan port maybe incorrectly?

If you are running Linux on another device you can also quite simply create another batman-adv connection

I did this just earlier to see if i could see all my mesh nodes

@Nocte try the following

Reset your devices to LibreMesh stock
using the web interface (reset factory defaults)
or
ssh to your devices and run

firstboot -y
reboot

then connect a Ethernet cable from Fritzbox LAN to Archer WAN port

Then on your Archer C50

batctl if del eth0-2_29
batctl if add eth0.2

Fritzbox

batctl if add eth0

you can also remove the wlan mesh interfaces if you want but now your batman-adv Ethernet connections should be ok

Okay. Here is what I have done.

First doing the firstboot -y && reboot on booth devices and then:

C50

root@LiMe-f61f6a:~# batctl if
dummy0: active
eth0-2_29: active
wlan1-mesh_29: active
wlan0-mesh_29: active
root@LiMe-f61f6a:~# batctl if del eth0-2_29
root@LiMe-f61f6a:~# batctl if del eth0-2_29
root@LiMe-f61f6a:~# batctl if add eth0.2
root@LiMe-f61f6a:~# batctl if
dummy0: active
eth0.2: active
wlan1-mesh_29: active
wlan0-mesh_29: active

Connecting C50 wan port to Fritz3370 switch lan port.

Fritz3370

root@LiMe-66d719:~# batctl if
eth0: active
dummy0: active
wlan0-mesh_29: active
root@LiMe-66d719:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:44:04:66:d7:19 (bat0/5a:fd:de:4c:37:7b BATMAN_IV)]
IF             Neighbor              last-seen
   wlan0-mesh_29	  a4:2b:b0:f6:1f:69    0.168s
root@LiMe-66d719:~# batctl if del wlan0-mesh_29
root@LiMe-66d719:~# batctl if
eth0: active
dummy0: active
root@LiMe-66d719:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:44:04:66:d7:19 (bat0/5a:fd:de:4c:37:7b BATMAN_IV)]
IF             Neighbor              last-seen

# changed cable - maybe first one was broken, maybe it just needed a new link up

root@LiMe-66d719:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:44:04:66:d7:19 (bat0/5a:fd:de:4c:37:7b BATMAN_IV)]
IF             Neighbor              last-seen
         eth0	  a4:2b:b0:f6:1f:6b    0.708s
root@LiMe-66d719:~# batctl p a4:2b:b0:f6:1f:6b
PING a4:2b:b0:f6:1f:6b (a4:2b:b0:f6:1f:6b) 20(48) bytes of data
From a4:2b:b0:f6:1f:6b: Destination Host Unreachable (icmp_seq 1)
From a4:2b:b0:f6:1f:6b: Destination Host Unreachable (icmp_seq 2)
From a4:2b:b0:f6:1f:6b: Destination Host Unreachable (icmp_seq 3)
^C--- a4:2b:b0:f6:1f:6b ping statistics ---
3 packets transmitted, 0 received, 100% packet loss
rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms
root@LiMe-66d719:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:44:04:66:d7:19 (bat0/5a:fd:de:4c:37:7b BATMAN_IV)]
IF             Neighbor              last-seen
         eth0	  a4:2b:b0:f6:1f:6b    0.560s
root@LiMe-66d719:~# batctl o
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:44:04:66:d7:19 (bat0/5a:fd:de:4c:37:7b BATMAN_IV)]
   Originator        last-seen (#/255) Nexthop           [outgoingIF]

Something strange is happening here...

Back on Fritz3370

root@LiMe-f61f6a:~# batctl if
dummy0: active
eth0.2: active
wlan1-mesh_29: active
wlan0-mesh_29: active
eth0-2_29: active
root@LiMe-f61f6a:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:2b:b0:f6:1f:6a (bat0/0e:ca:fc:65:5c:7f BATMAN_IV)]
IF             Neighbor              last-seen
       eth0.2	  06:44:04:66:d7:19    0.550s
root@LiMe-f61f6a:~# batctl p 06:44:04:66:d7:19
PING 06:44:04:66:d7:19 (06:44:04:66:d7:19) 20(48) bytes of data
From 06:44:04:66:d7:19: Destination Host Unreachable (icmp_seq 1)
From 06:44:04:66:d7:19: Destination Host Unreachable (icmp_seq 2)
^C--- 06:44:04:66:d7:19 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss
rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms
root@LiMe-f61f6a:~# batctl o
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:2b:b0:f6:1f:6a (bat0/0e:ca:fc:65:5c:7f BATMAN_IV)]
   Originator        last-seen (#/255) Nexthop           [outgoingIF]

Well... Iam a bit out of ideas here. Checking the MAC addresses shown by batctl n I do see them on the corresponding router. Probably I messed something up with the interfaces I added to batman. Or maybe even so dummy0 does something I broke now.

Here the prof of the MACs existing
On C50:

root@LiMe-f61f6a:~# ip link | grep a4:2b:b0:f6:1f:6b -B 1
10: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bat0 state UP qlen 1000
    link/ether a4:2b:b0:f6:1f:6b brd ff:ff:ff:ff:ff:ff
11: eth0-2_17@eth0.2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1496 qdisc noqueue state UP qlen 1000
    link/ether a4:2b:b0:f6:1f:6b brd ff:ff:ff:ff:ff:ff
--
31: eth0-2_29@eth0.2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bat0 state UP qlen 1000
    link/ether a4:2b:b0:f6:1f:6b brd ff:ff:ff:ff:ff:ff

On Fritz:

root@LiMe-66d719:~# ip link | grep 06:44:04:66:d7:19 -B 1
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bat0 state UP qlen 1000
    link/ether 06:44:04:66:d7:19 brd ff:ff:ff:ff:ff:ff
--
9: eth0_17@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1496 qdisc noqueue state UP qlen 1000
    link/ether 06:44:04:66:d7:19 brd ff:ff:ff:ff:ff:ff

My next approach would be under understanding what LibreMesh does in /etc/config/network and rebuild it myself in a minimal manner. At lest we got prove that batman-adv is able to find another device via a wired connection.

Ok, when you still have dummy interfaces left you must use that mac address to reach your other nodes

The ones starting with aa as

They show up running

batctl o

After restarting the routers I recreated the setup by adding eth ports to batman and deleting the wireless interface from it. So yes, you are right that I can batctl p <dummy_mac> at first but in the end need to ping an ip somewhere else. For that I tested with the statically configured lan interface addresses on both devices.
Lan cable connecting both devices the whole time. Only replugging after adding eth to batman.

All on Fritz (c50 setup before):

oot@LiMe-66d719:/etc/config# ping 10.13.215.25
PING 10.13.215.25 (10.13.215.25): 56 data bytes
64 bytes from 10.13.215.25: seq=0 ttl=64 time=0.655 ms
64 bytes from 10.13.215.25: seq=1 ttl=64 time=0.471 ms
^C
--- 10.13.215.25 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.471/0.563/0.655 ms
root@LiMe-66d719:/etc/config# ping 10.13.31.106
PING 10.13.31.106 (10.13.31.106): 56 data bytes
64 bytes from 10.13.31.106: seq=2 ttl=64 time=3.309 ms
64 bytes from 10.13.31.106: seq=3 ttl=64 time=2.954 ms
64 bytes from 10.13.31.106: seq=4 ttl=64 time=1.523 ms
^C
--- 10.13.31.106 ping statistics ---
5 packets transmitted, 3 packets received, 40% packet loss
round-trip min/avg/max = 1.523/2.595/3.309 ms
root@LiMe-66d719:/etc/config# batctl if
dummy0: active
wlan0-mesh_29: active
root@LiMe-66d719:/etc/config# batctl if add eth0
root@LiMe-66d719:/etc/config# ping 10.13.31.106
PING 10.13.31.106 (10.13.31.106): 56 data bytes
64 bytes from 10.13.31.106: seq=0 ttl=64 time=4.726 ms
^C
--- 10.13.31.106 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 4.726/4.726/4.726 ms
root@LiMe-66d719:/etc/config# batctl if del wlan0-mesh_29
root@LiMe-66d719:/etc/config# batctl if
eth0: active
dummy0: active
root@LiMe-66d719:/etc/config# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:44:04:66:d7:19 (bat0/a2:86:44:72:4a:6a BATMAN_IV)]
IF             Neighbor              last-seen

# replug cable

root@LiMe-66d719:/etc/config# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:44:04:66:d7:19 (bat0/a2:86:44:72:4a:6a BATMAN_IV)]
IF             Neighbor              last-seen
         eth0	  a4:2b:b0:f6:1f:6b    0.032s
root@LiMe-66d719:/etc/config# ping 10.13.31.106
PING 10.13.31.106 (10.13.31.106): 56 data bytes
^C
--- 10.13.31.106 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
root@LiMe-66d719:/etc/config# batctl p aa:44:04:66:d7:19
PING aa:44:04:66:d7:19 (aa:44:04:66:d7:19) 20(48) bytes of data
From aa:44:04:66:d7:19: Destination Host Unreachable (icmp_seq 1)
From aa:44:04:66:d7:19: Destination Host Unreachable (icmp_seq 2)
^C--- aa:44:04:66:d7:19 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss
rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms
root@LiMe-66d719:/etc/config# batctl p a4:2b:b0:f6:1f:6b
PING a4:2b:b0:f6:1f:6b (a4:2b:b0:f6:1f:6b) 20(48) bytes of data
From a4:2b:b0:f6:1f:6b: Destination Host Unreachable (icmp_seq 1)
From a4:2b:b0:f6:1f:6b: Destination Host Unreachable (icmp_seq 2)
From a4:2b:b0:f6:1f:6b: Destination Host Unreachable (icmp_seq 3)
^C--- a4:2b:b0:f6:1f:6b ping statistics ---
3 packets transmitted, 0 received, 100% packet loss
rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms
root@LiMe-66d719:/etc/config# 

Use the aa address for the remote node not local node

Sure. I did both. pretty desperate... I know.

Ok, could be issue with support for the device.

Do you use Linux as a desktop ?

Yes, I do run arch on desktop which seams to have batman in AUR repo. But I would prefer laptop running Solus os which does not have batman in its repos. Can I just pull from Github and run make?

Get from here

https://www.open-mesh.org/projects/open-mesh/wiki/Download

All right. Progress.
Not quite there but still progress.

I did as @markbirss said - downloawding, compiling, installing

Lots of code ahead so I tried to do blocks an add some short description at the top of each.

# Fritz - adding eth0 to batman 
root@LiMe-66d719:/etc/config# batctl if
dummy0: active
wlan0-mesh_29: active
root@LiMe-66d719:/etc/config# batctl if add eth0
root@LiMe-66d719:/etc/config# batctl if
eth0: active
dummy0: active
wlan0-mesh_29: active
root@LiMe-66d719:/etc/config# ip a | grep eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bat0 state UP qlen 1000
6: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
8: eth0-1_17@eth0.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1496 qdisc noqueue state UP qlen 1000
    inet 10.13.215.25/32 brd 255.255.255.255 scope global eth0-1_17
9: eth0_17@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1496 qdisc noqueue state UP qlen 1000
    inet 10.13.215.25/32 brd 255.255.255.255 scope global eth0_17
root@LiMe-66d719:/etc/config# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/xx:xx:xx:xx:xx:xx:xx (bat0/82:ec:29:18:9a:bd BATMAN_IV)]
IF             Neighbor              last-seen

# Laptop - adding enp57s0u1u2 (wired interface) to batman
root@Lpatop ./batctl-2020.1 # ./batctl if add enp57s0u1u2
root@Lpatop ./batctl-2020.1 # ./batctl if
enp57s0u1u2: active
root@Lpatop ./batctl-2020.1 # ./batctl n
[B.A.T.M.A.N. adv 2020.1, MainIF/MAC: enp57s0u1u2/xx:xx:xx:xx:xx:xx:xx (bat0/26:d5:31:e9:57:70 BATMAN_IV)]
IF             Neighbor              last-seen
   enp57s0u1u2	  32:d4:b2:33:c4:9b    0.414s

# Fritz - shows no connectivity even if the laptop does
root@LiMe-66d719:/etc/config# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/xx:xx:xx:xx:xx:xx:xx (bat0/82:ec:29:18:9a:bd BATMAN_IV)]
IF             Neighbor              last-seen
root@LiMe-66d719:/etc/config# batctl o
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/xx:xx:xx:xx:xx:xx:xx (bat0/82:ec:29:18:9a:bd BATMAN_IV)]
   Originator        last-seen (#/255) Nexthop           [outgoingIF]

# Laptop - pinging from here
root@Lpatop ./batctl-2020.1 # ./batctl n
[B.A.T.M.A.N. adv 2020.1, MainIF/MAC: enp57s0u1u2/xx:xx:xx:xx:xx:xx:xx (bat0/26:d5:31:e9:57:70 BATMAN_IV)]
IF             Neighbor              last-seen
   enp57s0u1u2	  32:d4:b2:33:c4:9b   55.915s

# at this point i was thinking about the fritz and that it does have 4 lan ports and 1 modem/wan port 
# and that might mess something up so I tried using not eth0 but etho.1

# Fritz - delete eth0 from batman and add eth0.1 to it
root@LiMe-66d719:/etc/config# batctl if add eth0
root@LiMe-66d719:/etc/config# batctl if add eth0.1

# Laptop - check again (mac 2e:28:e6:14:cc:52 is old one from eth0)
root@Lpatop ./batctl-2020.1 # ./batctl n
[B.A.T.M.A.N. adv 2020.1, MainIF/MAC: enp57s0u1u2/xx:xx:xx:xx:xx:xx:xx (bat0/26:d5:31:e9:57:70 BATMAN_IV)]
IF             Neighbor              last-seen
   enp57s0u1u2	  xx:xx:xx:xx:xx:xx:xx    0.554s
   enp57s0u1u2	  2e:28:e6:14:cc:52  108.458s
root@Lpatop ./batctl-2020.1 # ./batctl p xx:xx:xx:xx:xx:xx:xx
PING xx:xx:xx:xx:xx:xx:xx (xx:xx:xx:xx:xx:xx:xx) 20(48) bytes of data
20 bytes from xx:xx:xx:xx:xx:xx:xx icmp_seq=1 ttl=50 time=0.51 ms
20 bytes from xx:xx:xx:xx:xx:xx:xx icmp_seq=2 ttl=50 time=0.70 ms
^C--- xx:xx:xx:xx:xx:xx:xx ping statistics ---
2 packets transmitted, 2 received, 0% packet loss
rtt min/avg/max/mdev = 0.506/0.601/0.696/0.095 ms
root@Lpatop ./batctl-2020.1 # ./batctl o
[B.A.T.M.A.N. adv 2020.1, MainIF/MAC: enp57s0u1u2/xx:xx:xx:xx:xx:xx:xx (bat0/26:d5:31:e9:57:70 BATMAN_IV)]
   Originator        last-seen (#/255) Nexthop           [outgoingIF]
 * xx:xx:xx:xx:xx:xx:xx    0.816s   (255) xx:xx:xx:xx:xx:xx:xx [enp57s0u1u2]
 * xx:xx:xx:xx:xx:xx:xx    0.080s   (255) xx:xx:xx:xx:xx:xx:xx [enp57s0u1u2]

# Fritz - check from there again but sadly at the moment I need to disconnect the cable because when adding eth0.1 to batman this route does not work anymore and just disconnecting that one on using wifi was quicker then figuring out how to flush or adding a route having precedence. 
root@LiMe-66d719:~# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/xx:xx:xx:xx:xx:xx:xx (bat0/xx:xx:xx:xx:xx:xx:xx BATMAN_IV)]
IF             Neighbor              last-seen
       eth0.1	  xx:xx:xx:xx:xx:xx:xx   13.344s
root@LiMe-66d719:~# batctl o
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/xx:xx:xx:xx:xx:xx:xx (bat0/xx:xx:xx:xx:xx:xx:xx BATMAN_IV)]
   Originator        last-seen (#/255) Nexthop           [outgoingIF]
 * xx:xx:xx:xx:xx:xx:xx   22.488s   (255) xx:xx:xx:xx:xx:xx:xx [    eth0.1]

Concluding thus far. One is able to get it to work on the batman layer. But there is still some work to be done regarding routing and persisting the setup.
Thanks a lot to @markbirss who as been a great help. Maybe you have some more hints how to go on from here?

ip layer is also simple

id do on my desktop

modprobe batman-adv
batctl meshif bat0 if add enx00133b56066d
ip link set dev enx00133b56066d master bat0
ip link set up dev bat0
ip addr add 10.13.0.3/16 dev bat0

then statically add remote node with internet connectivity

route add default gw 10.13.196.158 dev bat0

on my lan connected node (single port AP-105)

batctl if add eth0

internet node is a sim card device with wifi mesh

I tinkered around a bit more but it is not quite working for me.
Batctl pinging in both directions works fine. Batman is up and running. But as soon as I add a /16 subnet I loose the connection to the router. Actually if I am configuring the router via cable connection as soon as I add eth0 (yes, no eth0.x because it seams to work now - no know what I did wrong previously) to batman I lose connection and I need to connect via wifi and need to delete the route on my cable interface so that I can go on.
So I tried using a smaller subnet. With that I am able to still connect but not to do a layer 3 ping. In general layer 3 not seams to work with that setup.

The steps shown below are a bit arbitrary and mostly alternating between router and laptop. But I still think it illustrates what I was doing. In the end batctl ping still works but normal ping shows arp request on the batman interfaces but no response. Routes can be found at the end. I happily provide more insight but I need some guidance here.

root@LiMe-66d719:/etc/config# ip a show br-lan
5: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 24:65:11:ee:52:48 brd ff:ff:ff:ff:ff:ff
    inet 10.13.215.25/16 brd 10.13.255.255 scope global br-lan
       valid_lft forever preferred_lft forever

./batctl-2020.1 # ./batctl n
[B.A.T.M.A.N. adv 2020.1, MainIF/MAC: enp57s0u1u2/00:e5:4c:63:01:b7 (bat0/26:d5:31:e9:57:70 BATMAN_IV)]
IF             Neighbor              last-seen
   enp57s0u1u2	  62:34:af:82:4d:fd    0.576s

root@LiMe-66d719:/etc/config# batctl n
[B.A.T.M.A.N. adv openwrt-2019.2-7, MainIF/MAC: dummy0/aa:44:04:66:d7:19 (bat0/e6:d1:40:17:e6:7e BATMAN_IV)]
IF             Neighbor              last-seen
         eth0	  00:e5:4c:63:01:b7    0.456s

./batctl-2020.1 # ./batctl p 62:34:af:82:4d:fd
PING 62:34:af:82:4d:fd (62:34:af:82:4d:fd) 20(48) bytes of data
20 bytes from 62:34:af:82:4d:fd icmp_seq=1 ttl=50 time=0.46 ms
^C--- 62:34:af:82:4d:fd ping statistics ---
1 packets transmitted, 1 received, 0% packet loss
rtt min/avg/max/mdev = 0.463/0.463/0.463/0.000 ms

root@LiMe-66d719:/etc/config# batctl p 00:e5:4c:63:01:b7
PING 00:e5:4c:63:01:b7 (00:e5:4c:63:01:b7) 20(48) bytes of data
20 bytes from 00:e5:4c:63:01:b7 icmp_seq=1 ttl=50 time=0.54 ms
^C--- 00:e5:4c:63:01:b7 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss
rtt min/avg/max/mdev = 0.538/0.538/0.538/0.000 ms

./batctl-2020.1 # ./batctl td bat0
22:14:47.033243 ARP, Request who-has 10.13.0.1 tell 10.13.0.3 (26:d5:31:e9:57:70), length 28
22:14:48.057379 ARP, Request who-has 10.13.0.1 tell 10.13.16.16 (26:d5:31:e9:57:70), length 28
22:14:49.081266 ARP, Request who-has 10.13.0.1 tell 10.13.16.16 (26:d5:31:e9:57:70), length 28

# adding subnet ip addresses
./batctl-2020.1 # ip addr ad 10.13.5.1/24 dev bat0
root@LiMe-66d719:/etc/config# ip addr add 10.13.5.2/24 dev bat0

# try to ping laptop from router
root@LiMe-66d719:/etc/config# ping 10.13.5.1

root@LiMe-66d719:~# batctl td bat0 
19:33:45.601068 BLA ANNOUNCE, backbone LiMe_66d719_dummy0, bla group 1097, crc 08ea
19:33:50.265294 ARP, Request who-has 10.13.5.1 tell 10.13.5.2 (e6:d1:40:17:e6:7e), length 28
19:33:50.273707 ARP, Reply 10.13.5.1 is-at 26:d5:31:e9:57:70, length 28
19:33:51.297091 ARP, Request who-has 10.13.5.1 tell 10.13.5.2 (e6:d1:40:17:e6:7e), length 28
19:33:51.305559 ARP, Reply 10.13.5.1 is-at 26:d5:31:e9:57:70, length 28

./batctl-2020.1 # ./batctl td bat0
22:19:16.964258 IP unknown protocol: 2
22:19:16.977366 IP unknown protocol: 2

root@LiMe-66d719:~# ip a show br-lan
5: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 24:65:11:ee:52:48 brd ff:ff:ff:ff:ff:ff
    inet 10.13.215.25/16 brd 10.13.255.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fd0d:fe46:8ce8::19d7:6600/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::2665:11ff:feee:5248/64 scope link 
       valid_lft forever preferred_lft forever
root@LiMe-66d719:~# ip a show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bat0 state UP qlen 1000
    link/ether 62:34:af:82:4d:fd brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6034:afff:fe82:4dfd/64 scope link 
       valid_lft forever preferred_lft forever
root@LiMe-66d719:~# ip a show bat0
10: bat0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UNKNOWN qlen 1000
    link/ether e6:d1:40:17:e6:7e brd ff:ff:ff:ff:ff:ff
    inet 10.13.5.2/24 scope global bat0
       valid_lft forever preferred_lft forever
root@LiMe-66d719:~# ip a show dummy0
3: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bat0 state UNKNOWN qlen 1000
    link/ether aa:44:04:66:d7:19 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a844:4ff:fe66:d719/64 scope link 
       valid_lft forever preferred_lft forever

root@LiMe-66d719:~# ip r
10.13.0.0/16 dev br-lan scope link  src 10.13.215.25 
10.13.0.0/16 dev anygw scope link  src 10.13.0.1 
10.13.5.0/24 dev bat0 scope link  src 10.13.5.2 

root@smartclip /home/smart/tools/batctl-2020.1 # ip r
default via 192.168.1.1 dev enp57s0u1u2 proto static metric 20100 
10.13.5.0/24 dev bat0 proto kernel scope link src 10.13.5.1 
10.13.16.0/24 dev enp57s0u1u2 proto kernel scope link src 10.13.16.2 metric 100 
10.13.215.25 dev enp57s0u1u2 scope link 

Edit:
I tried to ping the other way around and this is what I see on the router:

root@LiMe-66d719:/etc/config# batctl td bat0
20:08:14.071029 IP 10.13.5.1 > 10.13.5.2: ICMP echo request, id 7673, seq 0, length 64
20:08:14.071612 ARP, Request who-has 10.13.5.1 tell 10.13.5.2 (e6:d1:40:17:e6:7e), length 28
20:08:14.077582 ARP, Reply 10.13.5.1 is-at 26:d5:31:e9:57:70, length 28
20:08:14.081787 BLA ANNOUNCE, backbone 62:34:af:82:4d:fd, bla group 6bcc, crc 0000
20:08:14.082334 BLA ANNOUNCE, backbone 62:34:af:82:4d:fd, bla group 6bcc, crc 08ea
20:08:15.071634 IP 10.13.5.1 > 10.13.5.2: ICMP echo request, id 7673, seq 1, length 64
20:08:15.073100 ARP, Request who-has 10.13.5.1 tell 10.13.5.2 (e6:d1:40:17:e6:7e), length 28
20:08:15.081596 ARP, Reply 10.13.5.1 is-at 26:d5:31:e9:57:70, length 28
20:08:16.073135 IP 10.13.5.1 > 10.13.5.2: ICMP echo request, id 7673, seq 2, length 64
20:08:16.096977 ARP, Request who-has 10.13.5.1 tell 10.13.5.2 (e6:d1:40:17:e6:7e), length 28
20:08:16.105640 ARP, Reply 10.13.5.1 is-at 26:d5:31:e9:57:70, length 28

I have got to report an update. I was able to send standard layer 3 ping over the batman interface but still not the desired outcome. In short I am able to ping an ip at the batman interface itself but not on the one which got the bat0 set as its master.
On the Firtzbox I basically disabled everything batman related and started from scratch until I got to this setup

# on the Fritz:

root@LiMe-66d719:~# ip a s bat0
29: bat0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN qlen 1000
    link/ether 56:ca:20:aa:16:d2 brd ff:ff:ff:ff:ff:ff
    inet 10.3.3.1/24 scope global bat0
       valid_lft forever preferred_lft forever
    inet6 fe80::54ca:20ff:feaa:16d2/64 scope link 
       valid_lft forever preferred_lft forever
root@LiMe-66d719:~# ip a s eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bat0 state UP qlen 1000
    link/ether 4e:2b:14:44:ab:06 brd ff:ff:ff:ff:ff:ff
    inet 10.3.3.3/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::4c2b:14ff:fe44:ab06/64 scope link 
       valid_lft forever preferred_lft forever

# on Laptop

@Laptop ./batman-adv-2020.1 $ ip a
3: enp57s0u1u2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bat0 state UP group default qlen 1000
    link/ether 00:e0:4c:68:01:b7 brd ff:ff:ff:ff:ff:ff
4: bat0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 26:d5:31:e9:57:70 brd ff:ff:ff:ff:ff:ff
    inet 10.3.3.2/24 scope global bat0
       valid_lft forever preferred_lft forever
    inet6 fe80::24d5:31ff:fee9:5770/64 scope link 
       valid_lft forever preferred_lft forever
@Laptop ./batman-adv-2020.1 $ ping 10.3.3.1
PING 10.3.3.1 (10.3.3.1): 56 data bytes
64 bytes from 10.3.3.1: icmp_seq=0 ttl=64 time=0,846 ms
64 bytes from 10.3.3.1: icmp_seq=1 ttl=64 time=1,111 ms
^C--- 10.3.3.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss

So since this is obviously somehow working I probably just to something wrong regarding the routing. Might anyone have a hint?

1 Like

All right every body. I did manage to achieve what I wanted (which obviously was possible from the start but not how to do it...) So I like to kind of document it here since it actually took me quite a while to kind of reverse engineer this. On the other hand site, if you know how it works it becomes quite obvious... So going from hardware to software

First important step is: you need a dedicated communication line for batman. this might be obvious from the wifi setups you can read up everywhere but what is the equivalent for lan? On most routers you have a multi port switch. You need to split of one of the ports off and handle that single port like the wifi mesh communication ssid only for the batman communication. Of course you are free to use multiple ports or the whole switch if you intent to connect multiple batman peers to that one switch. Lets call my single switch port eth0.2 (more on that later)

Secondly you need to get the interface master hierarchy (as shown by ip link show) right. Most likely you will have a br-lan interface already and want to have an additional bat0 interface. This bat0 will then use eth0.2 for its communication. Interfaces in brackets are the ones potentially already on your br-lan and thus the interfaces used by clients you want to forward via batman. That gives you:

  • (wlan0: master br-lan)
  • (eth0.1: master br-lan)
  • bat0: master br-lan
  • eth0.2: master bat0

Thirdly for a persistent setup in /etc/config/network you go about it as follows:

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option netmask 'x.x.x.x'
	option ipaddr 'x.x.x.x'
	option ifname 'eth0.1 bat0'

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 gw_mode 'off'
	#option gw_sel_class 20
	option log_level 0
	option orig_interval 1000
	option bridge_loop_avoidance 1
	option distributed_arp_table 1
	option multicast_mode 1
	option network_coding 0
	option hop_penalty 30
	option isolation_mark '0x00000000/0x00000000'

config interface 'bat_if'
	option mtu '2304'
	option proto 'batadv_hardif'
	option master 'bat0'
	option ifname 'eth0.2' # sadly this simple line did the trick for me

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

# splitting up the eth0.2 port via vlan config
config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '1 6t'
	option vid '2'

Shockingly simple when working...
In the end the whole issue was how to tell uci to take the dedicated eth0.2 port and use it as the batman communication channel meaning setting its master to bat0. All that "complicated" stuff is done in the config interface 'bat_if'.
Actually this behavior is kind of written down in the documentation for interface but since it is not a hundred percent consistent with the configuration of the wifi devices for batman (there you set the master relation by putting the wifi devices name in the hat of the config interface 'wifi_device') it greatly messed up my understanding for how this works.
Only thing left is to set up a second router and don't mix up the switch ports...

1 Like