Skip to content

lime-config

The command lime-config configures LibreMesh on top of OpenWrt.

lime-files

These files are merged from the low level lime-defaults to top level lime-node to produce the complete configuration in lime-autogen.

Modules

Modules are configured in this order hardware_detection, wireless, network, firewall, system, generic_config.

hardware_detection

Loads all packages starting with lime-hwd-*
lime-hwd-openwrt-wan configures the OpenWrt wan port as WAN. If disabled, or the package is not installed, the wan port is configured as LAN.

wireless

Scan the OpenWrt device to find existing radios.
Produce the UCI configuration for each radio, loading configs from lime-autogen in the order:

  • config lime 'wifi' (wifi general options)
  • config lime '5ghz' (band specific options)
  • config lime '2ghz' (band specific options)
  • config radioN (radio specific options)

network

scan

Scan the OpenWrt device to find existing ethernet devices.

general protocols

Configure all general protocols from lime-autogen.network.protocols

interface specific protocols

For each ethernet device if it is present a specific config net use it, else take the protocols list from the general protocols.
Configures all protocols on the ethernet device.

The file lime-defaults provides default configuration for large list of protocols.
Only the protocols for which the relative package lime-proto-<proto-name>is installed are configured. In the default configuration they are

  • ieee80211s included in the package lime-system
  • lan included in the package lime-system
  • anygw - provided by lime-proto-anygw
  • babeld - provided by lime-proto-babeld
  • batadv - provided by lime-proto-batadv

firewall

Provides a default configuration for: general settings, LAN zone, WAN zone.
Refers to OpenWrt firewall zones.

default

default firewall configuration: input: ACCEPToutput: ACCEPTforward: ACCEPT`

LAN zone

Provide default firewall configuration for the LAN zone, and referesh the list of lan interfaces:

Example of autogenerated configuration in a dualband router with 4 lan/1 wan ethernet ports.

config zone
	option name 'lan'
	list network 'lan'
	list network 'lm_net_br_lan_anygw_if'
	list network 'lm_net_wlan0_mesh_batadv_if'
	list network 'lm_net_wlan0_mesh_babeld_if'
	list network 'lm_net_wlan1_mesh_batadv_if'
	list network 'lm_net_wlan1_mesh_babeld_if'
	list network 'lm_net_lan1_babeld_if'
	list network 'lm_net_lan1_batadv_if'
	list network 'lm_net_lan2_batadv_if'
	list network 'lm_net_lan2_babeld_if'
	list network 'lm_net_wan_batadv_if'
	list network 'lm_net_wan_babeld_if'
	list network 'lm_net_lan3_batadv_if'
	list network 'lm_net_lan3_babeld_if'
	list network 'lm_net_lan4_batadv_if'
	list network 'lm_net_lan4_babeld_if'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	option mtu_fix '1'

mtu_fix: 1 - Enable maximum segment size (MSS) clamping also for LAN. Enabled by default only for WAN.
network: <list-of-lan-interfaces> - List of interfaces inside the bridge br-lan LAN interfaces are determined before during the configuration of the network protocol lan

WAN zone

Keeps the OpenWrt's default settings.

config zone
	option name 'wan'
	list network 'wan'
	list network 'wan6'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option mtu_fix '1'

system

Set hostname and root_password

generic_config

Reads and execute the sections generic_uci_config, copy_asset and run_asset. Apply custom UCI configuration or copy/execute shell scripts. See the page Generic Config for detailed options.

Commit changes

Changes are committed by the command lime-config and written in /etc/config/ files.

TIP

Be sure to do not loose the connection to your device after the configuration.
To apply the changes the safest way is to perform a reboot of the device.

lime-apply

On most cases one can skip the reboot running the command lime-apply which calls the OpenWrt reload_config.
Depending on the changed configurations a full restart of some services may be required, like wireless, network and firewall.

lime-config; lime-apply; wifi; \
/etc/init.d/network restart; \
/etc/init.d/firewall restart