OpenWRT Mesh 802.11s

WiFi Routers

My routers are:

  • TP-Link Archer C7 v5
  • TP-Link Archer C50 v4
  • TP-Link TL-WDR4300 v1
Routers Location

The Problem

Things was kinda working. But something started to buging me out. When I was taking a call, walking around the house, sometimes the WiFi connection switched to another one of my routers, droping the call, wich had to be reconnected.

Mesh Network x Common Network
My Poor Wallet

OpenWRT for the Rescue

As I already have OpenWRT running on my WiFi routers, I decided to investigate if it was possible to configure a mesh network, and thus prevent my calls from dropping when I needed to walk around the house.

I found that we can easily install the necessary software, and turn OpenWRT into a mesh power plant!

Why use OpenWrt?

People install OpenWrt because they believe it works better than the stock firmware from their vendor. They find it is more stable, offers more features, is more secure and has better support.

I also want to use mesh in my network!

Very well. Good choice! From here on out, it’s the technical part. I will show you how I managed to achieve my goal and stabilize my calls and my IoT devices access to the internet.

Let’s get our hands dirty!

Before moving forward, make sure you connect a network cable between your computer and your WiFi router, as during the setup process, the WiFi network may become unavailable.

Preparing OpenWRT for Mesh

First Router

I’ve started the setup by the TP-Link Archer C7 v5, which has ATH10 (5GHz) and ATH9 (2.4GHz) based radio chips. I don’t used to use 2.4GHz WiFi networks on this router, so this last one is disabled for now in my setup.

TP-Link Archer C7
ATH10 Non CT Modules Installed

Wireless Mesh

Now we have to add the mesh interface definition to radio0 (5GHz) device:

  • Be sure to use single quotes.
WiFi 5GHz Mesh Interface Setup
  • The mesh network configuration must be identical on all your routers. Only the “radioX” part can be varied in order to accommodate the interfaces according to the operating frequency.

Mesh Device

Now we need to configure /etc/config/network to allow wmesh5g wifi interface to use batman-adv mesh protocol. To do so, edit the network file, and add at the bottom:

  • We also need to add “bat0” device to the existing bridge ports definition.
/etc/config/network
  • The maximum transmission unit (MTU) size should be anything between 1500 (usual size for Ethernet connections) and 2304 (usual size for WLAN connections). However, because batman-adv adds its own header to packets traveling through the wireless mesh network, it is suggested to set a minimum of 1528 instead. I’ve used 1560.

Mesh Interfaces

If the setup was done correctly, we can see the bat0 and wlan0 interfaces.

Mesh 5GHz Device
Mesh Initial Neighbour
Missing Luci Protocol Extensions

Let’s check some logs!

For now, just reinitialize WiFi:

Mesh Device Initialized
Checking Mesh Devices

Second Router

Now we’re going to setup the TP-Link N750 (WDR-4300). This router uses an ATH9 based radio chipset. I’ve also don’t used to use 2.4GHz WiFi networks on this router, so this last one is disabled for now in my setup.

TP-Link WDR4300

Drivers

The configuration is practically the same, only changing details regarding the drivers.

ATH9 Modules
ATH9 hwcrypt disabled

Packages

Check the installed wpad version:

Wireless Mesh

Now we have to add the mesh interface definition to “radio1” device (remember the phy1). The setup files are almost the same:

  • Be sure to use single quotes.

Mesh Device

Now we need to configure /etc/config/network to allow wmesh5g mesh device to use batman-adv mesh protocol. To do so, edit the network file, and add at the bottom:

  • We also need to bridge “bat0” with “br-lan”.
/etc/config/network
  • Remember that you must be connected by cable, not wifi!

Mesh Interfaces

If the setup was done correctly, we will see the bat0 and wlan1 interfaces.

Mesh 5GHz Device

Time to check the logs!

Reinitialize WiFi:

Mesh Handshake Messages
Mesh Neighbours
Mesh Mac Ping to the First Router
Mesh Mac Ping to the Second Router
  • BTW: You can’t mac ping yourself on an mesh network.

Great! Our Mesh setup is fully working!

Now let’s collect some additional data:

Mpath Dump
Station Dump

Third Router

Now we’re going to setup the TP-Archer C50. This router uses an MT76 based radio chips. I’ve also don’t used to use 2.4GHz WiFi networks on this router, so this last one is disabled for now in my setup.

TP-Link Archer C50
MT76 WiFi Modules Loaded
  • In this router, phy1 is related to 5GHz radio device.

Packages

Check the installed wpad version:

Wireless Mesh

Now we have to add the mesh interface definition to “radio1” device (remember the phy1). The setup files are almost the same:

  • Be sure to use single quotes.

Mesh Device

Now we need to configure /etc/config/network to allow wmesh5g mesh device to use batman-adv mesh protocol. To do so, edit the network file, and add at the bottom:

  • We also need to bridge “bat0” with “br-lan”.
/etc/config/network
  • Remember that you must be connected by cable, not wifi!

Mesh Interfaces

If the setup was done correctly, we will see the bat0 and wlan1 interfaces.

Mesh 5GHz Device

Check the Logs

Reinitialize WiFi:

Mesh Handshake Messages
Mesh Neighbours

Cheking All Together

Mesh Peer Communication

That’s it! Now we have 3 Mesh routers communicating with each other! Yeah!

Configure the Mesh Aware Wireless Network

For this last part, we will configure a wireless network that uses the mesh protocol internally, so that we can move freely between the APs without any connection drops.

Adding LAN to Mesh Point
  • Create a new wireless network
  • Edit an existing wireless network
Wireless Network Setup
  • Be sure to select the 5GHz device! In my scenario, the first router uses wlan0, and the others uses wlan1.
Wireless Security Options

Now you have a single mesh aware wireless network! Go and check it out!

Final Words

Mesh networks have an extensive world of options. What has been presented here is just a simple setup, but good enough for home use. To learn more, see the 2 links provided at the beginning of this article.

Luci Mesh Protocol Extensions

I will cover this out on a further update to this post. Sorry for any inconvenience.

Bonus Tip

If you are new to OpenWRT, just installed it on you router and doesn’t now how to access it for the first time, do the following.

Luci first access

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andre Rocha

Andre Rocha

7 Followers

I'm just a SysAdmin with some experience in OpenSource, DevOps and Datacenter Services, who likes to share knowledge.