How to bridge nonmesh to mesh netwok

Hello all

I have successfully created a Batman mesh network according to this tutorial:

https://openwrt.org/docs/guide-user/network/wifi/mesh/batman?rev=1555021785

The network is basically like this:

L1-M1-----M2-L2

Where M1 and M2 are mesh nodes/routers, while L1 and L2 are non-mesh laptops.

The question is how can I make it possible for L1 and L2 to communicate with each other over the mesh network.
The tutorial suggests to bridge the ethx and bat0 interfaces as shown below:

config interface 'vlan1111'
        option type 'bridge'
        option stp '1'
        option ifname 'eth1.1111 bat0.1111'
        option proto 'static'
        option ipaddr '192.168.11.11'
        option netmask '255.255.255.0'
        option delegate '0'

In my case I guess what I need to do is to bridge eth0.1 and bat0.
But this is however not possible as eth0.1 is already a member of another bridge 'br-lan' as shown in the configuration below.

So, how can I correctly configure a bridge between the LAN and mesh in order to achieve non-mesh communication?

Kind regards

Em

root@OpenWrt:~# 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 'fd4b:c72f:2fd3::/48'

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

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr 'c4:71:00:00:b9:ea'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr 'c4:71:00:00:b9:eb'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

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

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

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 3 4 6t'

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

config interface 'wwan'
        option proto 'dhcp'
root@OpenWrt:/etc/config# cat wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/10300000.wmac'
        option channel '3'
        option country 'US'
        option legacy_rates '1'
        option disabled '0'

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

config wifi-iface 'wmesh0'
        option device 'radio0'
        option ifname 'mesh0'
        option network 'nwi_mesh0'
        option mode 'mesh'
        option mesh_fwding '0'
        option mesh_id 'DEFmesh'
        #option encryption 'psk2+ccmp'
        #option key 'meshpassord'

Just add bat0 to your br-lan, or maybe bat0.1 would be better, in case you want to run other networks over the batman mesh.

Hi dlakelan

Thanks for your tips. It worked!

Now I can for example, from M1, successfully batctl ping L2_Mac (L2's Mac address).
But how can I ping L2 from L1, using the traditional way, i,e ping L1_ip ?
Or is there any other way I can test the communication between L1 and L2 through the mesh?

Kind regards

Em

Once M1 and M2 both have their bat0.1 or whatever VLAN interface bridged into their br-lan, then L2 should be able to say ping L1_ip and it will work.

Hi all

I have extensively conducted new connectivity tests of my simple mesh network,
and it appears that "cross subnet ping" is not working.

The network is the same, consisting of

L1-M1-----M2-L2

where M1 and M2 are mesh nodes/routers, while L1 and L2 are non-mesh laptops.

The configuration for M1 and M2 is basically the same and as shown above.
The only difference is the IP address, i.e.

M1

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

M2

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

The resulting network consists of the following nodes:

Overview of nodes
Node IP MAC
L1 192.168.100.212 18-db-f2-59-e7-27
M1 192.168.100.1 c4:71:54:48:b9:ea
M2 192.168.104.1 6a:72:51:84:3a:95
L2 192.168.104.217 84:a9:00:00:9c:31

I have extensively conducted all possible connectivity tests using ping and batctl ping. The result is listed below. Furthermore, to make sure that no mistake is made, the whole test was executed in 2 rounds, with the same result.

From the test result, the following can be summarized:

  1. L1 and M1 can ping each other. Likewise for L2 and M2
  2. M1 cannot batctl ping L1. Likewise, M2 cannot batctl ping L2
  3. L1 cannot ping L2 nor M2. Likewise, L2 cannot ping L1 nor M1. In general, cross subnet ping is not possible
  4. M1 can batctl ping both M2 and L2. Likewise, M2 can batctl ping both M1 and L1.

The most important result is in point 3, i.e. "cross subnet pinging" is not possible. On the contrary, it is possible to perform cross subnet ping using batctl ping as shown in point 4.

So the question is what do I need to change to be able to make point 3 work?
Is it valid to configure 2 different IP/subnet for M1 and M2 as I have done?

Hope some experts can give a helping hand

Kind regards

Em

Test results

Ping from L1 to:

  1. M1. Command: ping 192.168.100.1. Result: success
  2. M2. Command: ping 192.168.104.1. Result: failed (Destination Net Unreachable)
  3. L2. Command: ping 192.168.104.217. Result: failed (Destination Net Unreachable)

Ping from M1 to:

  1. L1. Command: ping 192.168.100.212. Result: success
  2. L1. Command: batctl ping 18:db:f2:59:e7:27. Result: failed (Destination Host Unreachable)
  3. M2. Command: ping 192.168.104.1. Result: failed (Network unreachable)
  4. M2. Command: batctl ping 68:72:51:85:3a:95. Result: success
  5. L2. Command: ping 192.168.104.217. Result: failed (Network unreachable)
  6. L2. Command: batctl ping 84:a9:00:00:9c:31. Result: success

Ping from M2 to:

  1. L1. Command: ping 192.168.100.212. Result: failed (Network unreachable)
  2. L1. Command: batctl ping 18:db:f2:59:e7:27. Result: success
  3. M1. Command: ping 192.168.100.1. Result: failed (Network unreachable)
  4. M1. Command: batctl ping c4:71:54:48:b9:ea. Result: success
  5. L2. Command: ping 192.168.104.217. Result: success
  6. L2. Command: batctl ping 84:a9:00:00:9c:31. Result: failed (Destination Host Unreachable)

Ping from L2 to:

  1. L1. Command: ping 192.168.104.217. Result: failed (Destination Net Unreachable)
  2. M1. Command: ping 192.168.100.1. Result: failed (Destination Net Unreachable)
  3. M2. Command: ping 192.168.104.1. Result: success

You are using a layer 2 mesh with bridging, but the network on M1 side is different subnet than on M2 side. Make everything be in 192.168.100.0/24 subnet. voila.

Aha. your are completely right dlakelan.

Based on initial tests, it seems like things work now. Thanks for your help.

I also got another question, hope you can help too. Suppose M1 is connected to the internet on the WAN port, how do I configure this port to be the default route or the gateway for the whole network?

Many thanks in advance.

Kind regards

Em

Just disregard the question above as I have found the solution :slight_smile:

Hey @emi,

I am in the same position as you have been more than two years ago. Do you still have the solution for configuring the WAN port to be the default gateway for the whole network?

Kind regards
Peter