I've recently invested in a number of Carambola2-I modules (Carambola2-I initial setup) to attempt to set up a mesh network. As this is my first attempt, and I have no previous knowledge on the subject, I rely (mostly) on tutorials. At the moment I'm attempting to create a setup with two devices, but five more should be arriving shortly, and be added to the mesh thereafter.
I've managed to install the (at the time) latest version of OpenWrt on the devices (18.06.4) and BATMAN following the guide on the OpenWrt website (https://openwrt.org/docs/guide-user/network/wifi/mesh/batman?rev=1555021785). Using the batctl n command I have confirmed that the two nodes are able to see each other.
Now I'm down to (what I believe to be) the last step: routing (useful) traffic over the mesh network. If I connect to clients to one node, they both get assigned an IP address and are able to talk to (ping) each other. When I connect one client to one node, and the other to another, they both get assigned an IP address, but aren't able to communicate. I'm assuming I have to set up some kind of VLAN/bridge to route the traffic from the WiFi interface to the mesh, but have no idea how. I'm also figuring that, if one client connects to one node, and the other to another, they could technically get assigned the same IP address. I assume this means I should define one node as the DHCP server, and disable the functionality on all others. Should I set the nodes to be in a static range (and assign them all a static IP), and allow clients only a specific portion of IP addresses using one DHCP server?
AFAIK (I don't use BATMAN myself) its configuration has changed significantly after 18.06.x (to the better), so I'd suggest to use 19.07.0-rc1 or master instead of 18.06.x for your endeavour.
Thanks for your advice. I ran into that while attempting to get this far, but due to my lack of experience with OpenWrt and the numerous topics I've read where people have managed to brick their devices, I'd rather stick with the firmware release listed on the device's page (https://openwrt.org/toh/8devices/carambola2). This may of course just be me being too careful.
That said, that still leaves the question of how to set it up.
You will need to cut back to a single DHCP server and then bridge each of the “LAN” (or whatever you’ve called them) segments with the batman interface on each router.
Moving to 19.07 or master is highly recommend for any advanced networking.
As per your and @slh's advice, I've installed OpenWrt 19.07.0-rc1 on the devices, and set up batman-adv following the new configuration standards. It took a bit of work, seeing as the tutorial isn't 100% accurate (batman-adv installs batctl-tiny during installation, so if you want to use batctl (like I do to list all neighbors) you have to install that before installing batman-adv), but I've now got the "same" setup as I had previously: both nodes have their own WiFi network, and both are able to see each other over the mesh network (confirmed using batctl n).
Now, like said before, I should now disable the DHCP server on one of the two nodes (and all nodes to be set up in the future). Can I just remove the 'wan' and 'wan6' interfaces to achieve this, or should I go about it differently?
I'm assuming that most of it is right, but I have two questions: first of all, should I change eth1 to eth0 (because my lan interface is named eth0)? And secondly, what is the use/advantage/disadvantage of setting an IP address on the bridge? Shouldn't the DHCP server handle the IP addresses? And should I therefore remove the statements here?
Concepts here that would be helpful are that the mesh routes batman packets among the nodes. If you've got the batman nodes aware of each other, that part of the config should be working then. MTU might need some tweaking later on, but if you've got the nodes talking of each other, the next step is to route traffic.
The routing of traffic is done by adding the batman interface to the "right" bridge. Think of it as working like a wire that connects the bridges.
In the example, the device I used happened to use eth1 for its private subnet that was bridged. Your device seems to use eth0 for "lan", so that is what you would bridge. You could add the batman interface to your existing "lan" bridge directly, or pick a "convenient" VLAN so that you can easily extend to guest, IoT, ... , subnets later.
I prefer not to use VLAN 1 and 2, as they are often "special" in OpenWrt config. There is nothing "magic" about VLAN 1111. It was intended as an example number.
Thanks for your reply and investing your time in trying to help me, but I don't get how I should go about setting up the bridge. I noticed the lan interface in my config is already of type bridge. Should I just change ifname to 'eth0 bat0' (or 'eth0 bat0.100'), or should I add a new entry?
Also, how do I disable the DHCP server on the second node, and tell it to use the first one as a DHCP server? I'm assuming the first node should have a static IP address (192.168.1.1), and I should provide that to all the other ones, but I have no idea how.
@jeff Thanks again for all your help. I installed the latest release once again (19.07.0), and using your answers in this topic and other topics I managed to get the mesh setup working.
For future reference, I disabled the DHCP and DHCPv6 servers using commands: