Hi
Adding a simple 802.11s mesh capability to OpenWrt/LEDE based routers is straightforward and just requires some simple modifications to the /etc/config/wireless and network files.
Below are sample files for an AR150 modified to add meshing on the WAN interface.
In the wireless config file, a section has been added to create a Meshpoint interface called ‘wlan0-1’, and this interface is attached to the ‘wan’ network.
In the network config file, the ‘wan’ network has been set to type ‘bridge’ so that the ‘eth0’ and ‘wlan0-1’ interfaces are bridged together.
In practice, the effect of adding the mesh capability as shown is that if you set up several devices like this, then if one device is connected to an upstream network via its WAN Ethernet port e.g. for Internet access, then the upstream connection will be shared across all the devices. It is just as if all the Ethernet WAN ports of the devices were connected to a network switch on the upstream network.
To see details of other nodes on the mesh, use the command:
iw wlan0-1 station dump
To disable the mesh interface, in the mesh section of the wireless config file, set:
option disabled ‘1’
In the example shown, the wifi mesh interface is attached to the ‘wan’ network, but it could alternatively be attached to the ‘lan’ network bridge.
The effect of this would be as if the LAN ports of all the devices were connected to a network switch. Of course in this scenario, you would have to ensure that each device has a distinct static IP address assigned to its ‘lan’ network to avoid address contention.
For more complex mesh networking, batman-adv provides more elaborate facilities but requires some additional setting up and memory usage on the device.
Note that for any device with a single wifi radio, using a Mesh interface in addition to the AP interface shares the resources of the wifi subsystem and the wifi channel, so there are practical limits to how far you can scale up the network.
T
/etc/config/wireless
config wifi-device ‘radio0’
option type ‘mac80211’
option channel ‘11’
option path ‘platform/ar933x_wmac’
option htmode ‘HT20’
option hwmode ‘11ng’
option txpower ‘18’
config wifi-iface
option device ‘radio0’
option network ‘lan’
option mode ‘ap’
option ssid ‘GL-AR150-9fb’
option encryption ‘psk-mixed’
option key ‘goodlife’
option wds ‘1’
option ifname ‘wlan0’
Add this section
config wifi-iface
option device ‘radio0’
option ifname ‘wlan0-1’
option mode ‘mesh’
option mesh_id ‘mymesh’
option network ‘wan’
option encryption ‘none’
option mesh_fwding ‘1’
option disabled ‘0’
/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 ‘fde5:f328:d9ba::/48’
config interface ‘lan’
option ifname ‘eth1’
option force_link ‘1’
option type ‘bridge’
option proto ‘static’
option netmask ‘255.255.255.0’
option ip6assign ‘60’
option hostname ‘GL-AR150-9fa’
option ipaddr ‘192.168.8.1’
config interface ‘wan’
option type ‘bridge’ #### Add this line ###
option ifname ‘eth0’
option proto ‘dhcp’
option hostname ‘GL-AR150-9fa’
config interface ‘wan6’
option ifname ‘eth0’
option proto ‘dhcpv6’