LibreMesh network config

Most of the LibreMesh configuration is handled by a unified configuration file placed on /etc/config/lime. This file is part of the UCI database which unifies also most of the OpenWRT/LEDE configuration files. The main configuration script of LibreMesh is named lime-config and can be invoked typing lime-config in the node’s root terminal.

In addition to /etc/config/lime there exist also /etc/config/lime-defaults. If a configuration option is not found in config/lime, the config/lime-defaults one will be used when running the lime-config command.

lime config file

The idea behind this structure is that the user only modifies /etc/config/lime but never /etc/config/lime-defaults.

Once the file is modified the command lime-config must be run. To enable the changes you might reboot the node (reboot command) or execute reload_config.

For a detailed view of the config file options see config.

The networking options of config/lime are defined in two different blocks.

Common network options

If there is not a specific network section for a specific network device, the options from the common section will be used.

Networking default options
config lime network
	option primary_interface eth0
	option main_ipv4_address '10.%N1.0.0/16'
	option main_ipv6_address '2a00:1508:0a%N1:%N200::/64'
	option bmx6_mtu '1398'
	list protocols adhoc
	list protocols lan
	list protocols anygw
	list protocols batadv:%N1
	list protocols bmx6:13
	list resolvers
	list resolvers 2001:470:20::2

In this example, all networks interfaces will be used with the following set of protocols:

  1. lan so client devices can connect and obtain a valid IP configuration via DHCP

  2. anygw so roaming will be enabled

  3. adhoc so if WiFi device, it will be used for meshing in Ad-Hoc mode

  4. batadv so the Layer2 network routing protocol will be enabled to find possible neighbour nodes (VLAN of the mesh cloud based on SSID)

  5. bmx6 so the Layer3 network routing protocol will be enabled to find possible neighbour nodes (VLAN 13)

Specific network options

But if we want to change the default behavior of one or more network devices we can define a specific configuration.

Ethernet specific options, multiple allowed
config net wan_network
	option linux_name 'eth0'
	list protocols 'wan'
	list protocols 'bmx6:13'
	list protocols 'batadv:%N1'

In this case the eth0 device will be used as WAN (so the DHCP client will be enabled) but also for meshing (enable routing protocols does not hurt!).

The option linux_name must coincide with the real interface name of the system, the command ip link can be used to list the network devices.

lime config file

If the LibreMesh module lime-hwd-openwrt-wan is installed (it is by default) and your node have two or more ethernet ports, LibreMesh might autoconfigure as WAN one of these network ethernet device.

In this case there will be a new specific configuration section like this one:

config net 'lm_hwd_openwrt_wan'
	option autogenerated 'true'

If we want to change the behavior of this specific network device we must set autogenerated to false.