WIFI Mesh with Batman-ADV

Hi Guys,

I've been trying to setup a wifi Mesh with Batman-ADV with VLANS by following marks YT Video:

However internet from the client works only when the ETH cable between router and AP is connected. if I disconnect it it will stop working.

This is my Server config:

root@OpenWrt:~# cat /etc/config/network

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

config globals 'globals'
	option ula_prefix 'fdf6:b886:4fed::/48'

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

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option vid '10'
	option description 'local 192.168.10.0'
	option ports '0t 2t 3 4'

config switch_vlan
	option device 'switch0'
	option vlan '4'
	option vid '20'
	option description 'iot 192.168.20.0'
	option ports '0t 2t 5'

config switch_vlan
	option device 'switch0'
	option vlan '5'
	option vid '40'
	option description 'camera 10.10.40.0'
	option ports '0t 2t'

config switch_vlan
	option device 'switch0'
	option vlan '6'
	option vid '99'
	option description 'guest 10.10.99.0'
	option ports '0t 2t'

config switch_vlan
	option device 'switch0'
	option vlan '7'
	option vid '111'
	option description 'modem'
	option ports '0t 1'

config interface '10local'
	option proto 'static'
	option device 'br-vlan10'
	option ipaddr '192.168.10.1'
	option netmask '255.255.255.0'
	option defaultroute '0'

config interface '20iot'
	option proto 'static'
	option device 'br-vlan20'
	option ipaddr '192.168.20.1'
	option netmask '255.255.255.0'
	option force_link '0'
	option defaultroute '0'

config device
	option type 'bridge'
	option name 'br-vlan10'
	option bridge_empty '1'
	list ports 'bat0.10'
	list ports 'eth0'
	list ports 'eth0.10'

config device
	option type 'bridge'
	option name 'br-vlan20'
	option bridge_empty '1'
	list ports 'eth0.20'
	list ports 'bat.20'

config interface 'WAN'
	option proto 'dhcp'
	option device 'eth0.111'
	option peerdns '0'
	list dns '1.1.1.1'
	list dns '1.0.0.1'

config device
	option type 'bridge'
	option name 'br-vlan40'
	list ports 'eth0.40'
	list ports 'bat.40'

config device
	option type 'bridge'
	option name 'br-vlan99'
	list ports 'eth0.99'
	list ports 'bat.99'

config interface '40cameras'
	option proto 'static'
	option device 'br-vlan40'
	option ipaddr '10.10.40.1'
	option netmask '255.255.255.0'
	option force_link '0'
	option defaultroute '0'

config interface '99guest'
	option proto 'static'
	option device 'br-vlan99'
	option ipaddr '10.10.99.1'
	option netmask '255.255.255.0'
	option defaultroute '0'

config interface 'bat0'
	option proto 'batadv'
	option routing_algo 'BATMAN_IV'
	option bridge_loop_avoidance '1'
	option gw_mode 'server'
	option hop_penalty '30'
	option defaultroute '0'

config interface 'batmesh'
	option proto 'batadv_hardif'
	option master 'bat0'
	option defaultroute '0'
root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'pci0000:00/0000:00:00.0'
	option band '5g'
	option htmode 'VHT80'
	option cell_density '0'
	option channel '36'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network '10local'
	option mode 'ap'
	option ssid 'rete1'
	option encryption 'psk2'
	option key 'XXXXX'
	option ieee80211r '1'
	option mobility_domain 'F001'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'platform/ahb/18100000.wmac'
	option channel '1'
	option band '2g'
	option htmode 'HT20'
	option cell_density '0'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option mode 'ap'
	option ssid 'reteIOT'
	option encryption 'psk2'
	option key 'XXXXXX'
	option network '20iot'
	option ieee80211r '1'
	option mobility_domain 'F002'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-iface 'wifinet2'
	option device 'radio0'
	option mode 'ap'
	option ssid 'reteIOT'
	option encryption 'psk2'
	option network '20iot'
	option key 'XXXXXX'
	option ieee80211r '1'
	option mobility_domain 'F002'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-iface 'wifinet3'
	option device 'radio0'
	option mode 'ap'
	option ssid 'retecam2'
	option encryption 'psk2'
	option key 'XXXXX'
	option network '40cameras'
	option ieee80211r '1'
	option mobility_domain 'F003'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-iface 'wifinet4'
	option device 'radio0'
	option mode 'ap'
	option ssid '99guest'
	option encryption 'psk2'
	option key 'XXXXXXX'
	option network '99guest'
	option ieee80211r '1'
	option mobility_domain 'F099'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-iface 'wifinet5'
	option device 'radio1'
	option mode 'ap'
	option ssid 'retecam2'
	option encryption 'psk2'
	option key 'XXXXXXXXX'
	option network '40cameras'
	option ieee80211r '1'
	option mobility_domain 'F003'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-iface 'wifinet7'
	option device 'radio0'
	option mode 'mesh'
	option encryption 'sae'
	option mesh_id 'retemesh'
	option mesh_fwding '0'
	option mesh_rssi_threshold '0'
	option key 'XXXXXXXXX'
	option network 'batmesh'

and this is my client config

root@OpenWrt:~# cat /etc/config/network

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

config globals 'globals'
	option ula_prefix 'fdf6:b886:4fed::/48'

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

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option vid '10'
	option description 'local 192.168.10.0'
	option ports '0t 2t 3 4 5'

config switch_vlan
	option device 'switch0'
	option vlan '4'
	option vid '20'
	option description 'iot 192.168.20.0'
	option ports '0t 2t'

config switch_vlan
	option device 'switch0'
	option vlan '5'
	option vid '40'
	option description 'camera 10.10.40.0'
	option ports '0t 2t'

config switch_vlan
	option device 'switch0'
	option vlan '6'
	option vid '99'
	option description 'guest 10.10.99.0'
	option ports '0t 2t'

config interface '10local'
	option proto 'dhcp'
	option device 'br-vlan10'
	option defaultroute '0'

config interface '20iot'
	option proto 'dhcp'
	option device 'br-vlan20'
	option defaultroute '0'

config device
	option type 'bridge'
	option name 'br-vlan10'
	option bridge_empty '1'
	list ports 'bat0.10'
	list ports 'eth0'
	list ports 'eth0.10'

config device
	option type 'bridge'
	option name 'br-vlan20'
	option bridge_empty '1'
	list ports 'eth0.20'
	list ports 'bat.20'

config device
	option type 'bridge'
	option name 'br-vlan40'
	list ports 'eth0.40'
	list ports 'bat.40'

config device
	option type 'bridge'
	option name 'br-vlan99'
	list ports 'eth0.99'
	list ports 'bat.99'

config interface '40cameras'
	option proto 'dhcp'
	option device 'br-vlan40'
	option defaultroute '0'

config interface '99guest'
	option proto 'dhcp'
	option device 'br-vlan99'
	option defaultroute '0'

config interface 'bat0'
	option proto 'batadv'
	option routing_algo 'BATMAN_IV'
	option bridge_loop_avoidance '1'
	option gw_mode 'off'
	option hop_penalty '30'
	option defaultroute '0'

config interface 'batmesh'
	option proto 'batadv_hardif'
	option master 'bat0'
	option defaultroute '0'

root@OpenWrt:~#  cat /etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'pci0000:00/0000:00:00.0'
	option band '5g'
	option htmode 'VHT80'
	option cell_density '0'
	option channel '36'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network '10local'
	option mode 'ap'
	option ssid 'rete1'
	option encryption 'psk2'
	option key 'XXXXXXXXXX'
	option ieee80211r '1'
	option mobility_domain 'F001'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'platform/ahb/18100000.wmac'
	option channel '1'
	option band '2g'
	option htmode 'HT20'
	option cell_density '0'
	option disabled '1'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option mode 'ap'
	option ssid 'reteIOT'
	option encryption 'psk2'
	option key 'XXXXXXXXX'
	option network '20iot'
	option ieee80211r '1'
	option mobility_domain 'F002'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'
	option disabled '1'

config wifi-iface 'wifinet2'
	option device 'radio0'
	option mode 'ap'
	option ssid 'reteIOT'
	option encryption 'psk2'
	option network '20iot'
	option key 'XXXXXXXXXX'
	option ieee80211r '1'
	option mobility_domain 'F002'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-iface 'wifinet3'
	option device 'radio0'
	option mode 'ap'
	option ssid 'retecam2'
	option encryption 'psk2'
	option key 'XXXXXXXXX'
	option network '40cameras'
	option ieee80211r '1'
	option mobility_domain 'F003'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-iface 'wifinet4'
	option device 'radio0'
	option mode 'ap'
	option ssid '99guest'
	option encryption 'psk2'
	option key 'XXXXXXXXXX'
	option network '99guest'
	option ieee80211r '1'
	option mobility_domain 'F099'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'
	option disabled '1'

config wifi-iface 'wifinet5'
	option device 'radio1'
	option mode 'ap'
	option ssid 'retecam2'
	option encryption 'psk2'
	option key 'XXXXXXXXX'
	option network '40cameras'
	option ieee80211r '1'
	option mobility_domain 'F003'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'
	option disabled '1'

config wifi-iface 'wifinet7'
	option device 'radio0'
	option mode 'mesh'
	option encryption 'sae'
	option mesh_id 'retemesh'
	option mesh_fwding '0'
	option mesh_rssi_threshold '0'
	option key 'XXXXXXXXXXXXXX'
	option network 'batmesh'

Your batman interface is named bat0 not bat, so to include it in bridges use bat0.10 etc.

Don't have a plain eth0 anywhere in the config.

Also when testing have only the mesh interface on its radio-- all APs on the other radio. Support of combined operation varies by hardware.

2 Likes

Have you installed batctl-full? It is very useful for figuring out what is going in. Does batctl if show all interfaces that batadv should be configured upton? Does batctl n show any neighbours and on which interfaces?
I recommend reading the batman-adv wiki pages. They very well written and detailed and should contain all information you need: https://www.open-mesh.org/projects/batman-adv/wiki/Doc-overview