[Solved] OpenWrt & Batman

Hi, I have succssfully configured Batman on 2 nodes using the manual on openwrt.org and on https://wiki.reseaulibre.ca/guides/openwrt+batman/
At the end I have

root@do-ext:~# brctl show
bridge name	bridge id		STP enabled	interfaces
br-lan		7fff.90f652ffc262	no		eth0
							eth0.1
							wlan0-1
root@do-ext:~# 
root@do-ext:~# batctl if
mesh0: active
root@do-ext:~#

on both routers... very happy but... how do I send traffic through this link now? I created an AP with same name on the extender but traffic is not going through the mesh interfaces...

Thanks!
R

https://openwrt.org/docs/guide-user/network/wifi/mesh/batman

You show brctl does not have mesh0 in the bridge I assume you'd want to include that iface, either that or set up routing through a new openwrt interface that uses mesh0 as it's physical interface

Hi thanks a lot, I finally found time to work again on this. So I did the last step but it's still not working. Here are my /etc/network/config

MainRouter

root@do-ext:~# cat /etc/config/network 

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

config globals 'globals'
	option ula_prefix 'fdcd:4ba6:1196::/48'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option _orig_ifname 'eth0.1 wlan0 wlan1'
	option _orig_bridge 'true'
	option ifname 'eth0 eth0.1'
	option ipaddr '10.16.3.1'
	option dns '1.1.1.1 1.0.0.1'

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

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0t 2 3 4 5'
	option vid '1'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0t 1'
	option vid '2'

config interface 'WAN'
	option _orig_ifname 'eth0.2'
	option _orig_bridge 'false'
	option proto 'static'
	option ipaddr '192.168.1.2'
	option netmask '255.255.255.0'
	option gateway '192.168.1.1'
	option ifname 'eth0.2'

config interface 'VPN'
	option proto 'none'
	option ifname 'tun0'

config route
	option interface 'lan'
	option target '10.19.1.0'
	option netmask '255.255.255.0'
	option gateway '10.16.3.253'

config interface 'nwi_mesh0'
	option ifname 'mesh0'
	option proto 'batadv'
	option mesh 'bat0'
	option mtu '2304'

config interface 'vlan1111'
	option type 'bridge'
	option stp '1'
	option proto 'none'
	option auto '1'
	option delegate '0'
	option ifname 'bat0.1111 eth0'

Repeater

root@do-repeater:~# cat /etc/config/network 

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

config globals 'globals'
	option ula_prefix 'fde1:0c17:18f9::/48'

config interface 'lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '10.16.4.1'
	option type 'bridge'
	option stp '1'
	option ifname 'eth0.1'

config device 'lan_dev'
	option name 'eth0.1'
	option macaddr '18:d6:c7:99:f4:b0'

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

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0 6t'

config interface 'nwi_mesh0'
	option ifname 'mesh0'
	option proto 'dhcp'

#config interface 'bat0'
#	option proto 'static'
#	option ipaddr '10.16.5.1'
#	option netmask '255.255.255.0'
#	option type 'bridge'

config interface 'vlan1111'
	option type 'bridge'
	option stp '1'
	option ifname 'bat0.1111'
	option proto 'none'
	option auto '1'
	option delegate '0'

root@do-repeater:~# 

and these are the output of batctl show

root@do-ext:~# brctl show
bridge name	bridge id		STP enabled	interfaces
br-lan		7fff.90f652ffc262	no		eth0
							eth0.1
							wlan0-1
br-vlan1111		7fff.96d31d27d02e	yes		bat0.1111
root@do-ext:~# 

Repeater

root@do-repeater:~# brctl show
bridge name	bridge id		STP enabled	interfaces
br-bat0		7fff.000000000000	no
br-lan		7fff.18d6c799f4b0	yes		eth0.1
							wlan1
root@do-repeater:~# 

At this point I have a wifi AP on repeater and when I connect to that AP I have no connectivity..

Any clue of why the output of batctl is different and what am I doing wrong?

Thanks!
R

Hi @dlakelan , thanks for your suggestion. I tried re-doing the repeater from scratch, but still it doesn't work... here are my configs:

Main router:

oot@do-ext:~# cat /etc/config/network 

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

config globals 'globals'
	option ula_prefix 'fdcd:4ba6:1196::/48'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option _orig_ifname 'eth0.1 wlan0 wlan1'
	option _orig_bridge 'true'
	option ipaddr '10.16.3.1'
	option dns '1.1.1.1 1.0.0.1'
	option ifname 'bat0 bat0.1111 bat0.3333 eth0 eth0.1'

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

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0t 2 3 4 5'
	option vid '1'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0t 1'
	option vid '2'

config interface 'WAN'
	option _orig_ifname 'eth0.2'
	option _orig_bridge 'false'
	option proto 'static'
	option ipaddr '192.168.1.2'
	option netmask '255.255.255.0'
	option gateway '192.168.1.1'
	option ifname 'eth0.2'

config interface 'VPN'
	option proto 'none'
	option ifname 'tun0'

config route
	option interface 'lan'
	option target '10.19.1.0'
	option netmask '255.255.255.0'
	option gateway '10.16.3.253'

config interface 'nwi_mesh0'
	option ifname 'mesh0'
	option proto 'batadv'
	option mesh 'bat0'
	option mtu '2304'

config interface 'vlan3333'
	option type 'bridge'
	option stp '1'
	option proto 'none'
	option auto '1'
	option delegate '0'
	option ifname 'bat0.3333 eth0.1'

root@do-ext:~# 

Extender

root@do-repeater:~# cat /etc/config/network 

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

config globals 'globals'
	option ula_prefix 'fd1c:859d:75a4::/48'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ipaddr '10.16.4.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ifname 'eth0.1'

config device 'lan_dev'
	option name 'eth0.1'
	option macaddr '18:d6:c7:99:f4:b0'

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

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0 6t'

config interface 'wwan'
	option proto 'dhcp'

config interface 'nwi_mesh0'
	option ifname 'mesh0'
	option proto 'batadv'
	option mesh 'bat0'
	option mtu '2304'

config interface 'vlan3333'
	option type 'bridge'
	option stp '1'
	option proto 'none'
	option auto '1'
	option delegate '0'
	option ifname 'bat0.3333'

root@do-repeater:~# 

and these are the output of batctl show:

Main router

root@do-ext:~# brctl show
bridge name	bridge id		STP enabled	interfaces
br-lan		7fff.90f652ffc262	no		eth0
							eth0.1
							wlan0-1
							bat0
							bat0.1111
br-vlan3333		7fff.dee7bf5d4c8e	yes		bat0.3333
root@do-ext:~# 

Extender

root@do-repeater:~# brctl show
bridge name	bridge id		STP enabled	interfaces
br-lan		7fff.18d6c799f4b0	no		eth0.1
br-vlan3333		7fff.1ad6c799f4b2	yes		wlan1-1
							bat0.3333
root@do-repeater:~# 

So it looks like now the bat interfaces are in the bridge (only with wlan1-1 on repeater, with lan&wlan on main router) but still when I try to connect to wlan1-1 (in AP mode) I don't receive an IP address from main router...

Any clue of what I am still missing, please?

Thanks a lot!!
R

When you run VLANs on an interface, do not put the base interface (eth0, bat0 etc) into any bridges.

You have to set up an IP address on the 3333 interface to get the router OS to respond to any attempt to ping it etc. Proto none is only for cases where you immediately bridge out to something else and do not want any interaction with the local OS.

Use batctl to confirm that an RF link exists.

1 Like

@mk24 is spot on with his recommendations.

I did notice that you've got some old cruft in your config.

You can safely remove these from your config as they were used some time ago to keep state information during LuCI-based edits. They are not used for config so are not causing you any problems, just distractions. See further https://github.com/openwrt/luci/issues/1655, resolved March, 2018

Thank you both, it works! Guess what? The mistake was in the only file I didn't share, /etc/config/wireless where the mesh interfaces were using different channels. I fixed also your suggestions anyway..

Thanks!!
R

1 Like

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