[SOLVED] Batman-adv over Ethernet

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

does this have real world applications?

I was kind of hoping to use a ethernet to bridge 2 mesh ap with around 100meter distance.

i tried to test 3 aps.


test #1 main mesh ap is connected to lan.
mesh 1 and mesh 2 are around 10meters away from main mesh.
mesh 1 and 2 are about 1 meter apart.
all ap have wifi ssid in ap mode for clients to connect.
verified that all ap are connected to each other via mesh.
all 3 wifi ap ssids have internet connection.
Normal Mesh.

test#2


turned off both mesh 1 and mesh 2
connected an ethernet cable to mesh 1 and mesh 2
mesh 1 and mesh 2 still has batman-adv mesh turned on.
same results as test #1
no loops no errors.

It sure does. You might have noticed that i did reference my first question regarding batman over powerline which would give you nice mesh wifi around the house without having to care about thick walls or putting cable everywhere. And Secondly it is some benefit to mesh over different physical interface then your clients connect to. My devices utilize only 2.4 GHz or 5 GHz.

Contrarily to what you describe in your second post where all devices are rather close to each other I am intending to build up a wifi mesh in a pretty desolated area going from inside one building into another.

Not sure if you are trying to say that there is no need for meshing over lan?
Well if you are fine with bridging the respective interfaces or set up routing that sure should work I think. In my case I am happy to have a lan and a guest network split up by vlan over batman. One main router does all the dhcp, dns and uplink stuff. And the others just join in as client and request an ip from the lan network. But on layer 2 they are fully disconnected.

At least in theory. Pleas tell me if I am missing something?

ah so you wanted vlan in batman.

my needs are just plain mesh network no vlans.
here is my dilemma.


my mesh 3 and mesh 4 has a physical utp link with both lan ports.

  1. would the wifi clients connected to mesh 4 use the utp link or the mesh link?
  2. how would mesh 5 use the connection? would it use the utp link or the mesh link on mesh 4 to mesh 3?

If I understand correctly at the moment between mesh3 and mesh4 you have a wifi batman link and a second lan link (no batman) and want to move the batman part to the wire? To figure out what batman does just set it up as you intend to and use batmanctl n and batctl o to verify which nodes are recognized as well as batctl p and layer 3 ping. I would figure you could bridge interfaces in some manner that packets might be forwarded as you like. But the more consistent approach would be using batman for everything to create one big virtual switch.

If you like to discuss this one in more depth I recommend opening a new discussion for that.

if traffic just goes to the wire (without batman) then its ok no need to do batman on ethernet.

not sure how batman-adv handles this.
only article i can look up is this: https://www.open-mesh.org/projects/batman-adv/wiki/Bridge-loop-avoidance
the scenario is 2 mesh nodes are connected to the lan network at the same time.
my scenario is kind of different. 2 nodes are connected with lan to each other but not connected to the lan.

That part is a bit confusing^^

But if you are really just saying that you have a working mesh setup over wifi and additionally put a not batman manged cable link between two of the nodes then I think batman should handle that nicely. If you are concerned about how the routing behaves you could configure a separate interface (not managed or bridged to batman) for the respective switch ports on both devices with a different subnet. That might be desirable since there must be a reason why you add a cable connection between two nodes which are already linked by wifi + batman.

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