Skip to content
Snippets Groups Projects
Commit 39d0c8f4 authored by Nils Schneider's avatar Nils Schneider
Browse files

mesh-batman-adv: mesh_on_lan

This adds mesh_on_lan functionality.

A new optional site.conf option, mesh_on_lan, has been added. If set to
'true', all LAN ports will be used for meshing instead of being part of
the client bridge.
parent 3f80b658
No related branches found
No related tags found
No related merge requests found
...@@ -119,6 +119,9 @@ fastd_mesh_vpn ...@@ -119,6 +119,9 @@ fastd_mesh_vpn
mesh_on_wan : optional mesh_on_wan : optional
Enables the mesh on the WAN port (``true`` or ``false``). Enables the mesh on the WAN port (``true`` or ``false``).
mesh_on_lan : optional
Enables the mesh on the LAN port (``true`` or ``false``).
autoupdater : package autoupdater : package
Configuration for the autoupdater feature of Gluon. Configuration for the autoupdater feature of Gluon.
:: ::
......
...@@ -13,3 +13,4 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do ...@@ -13,3 +13,4 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do
end end
need_boolean('mesh_on_wan', false) need_boolean('mesh_on_wan', false)
need_boolean('mesh_on_lan', false)
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
local sysconfig = require 'gluon.sysconfig' local sysconfig = require 'gluon.sysconfig'
local sysctl = require 'gluon.sysctl' local sysctl = require 'gluon.sysctl'
local site = require 'gluon.site_config'
local uci = require('luci.model.uci').cursor() local uci = require('luci.model.uci').cursor()
...@@ -20,7 +21,7 @@ uci:commit('batman-adv') ...@@ -20,7 +21,7 @@ uci:commit('batman-adv')
if not uci:get('network', 'client') then if not uci:get('network', 'client') then
local ifname local ifname
if sysconfig.lan_ifname then if sysconfig.lan_ifname and not site.mesh_on_lan then
ifname = sysconfig.lan_ifname .. ' bat0' ifname = sysconfig.lan_ifname .. ' bat0'
else else
ifname = 'bat0' ifname = 'bat0'
......
#!/usr/bin/lua
local site = require 'gluon.site_config'
local uci = require 'luci.model.uci'
local util = require 'gluon.util'
local sysconfig = require 'gluon.sysconfig'
local c = uci.cursor()
if sysconfig.lan_ifname then
if not c:get('network', 'mesh_lan') then
c:section('network', 'interface', 'mesh_lan',
{ ifname = sysconfig.lan_ifname
, proto = 'batadv'
, mesh = 'bat0'
, macaddr = util.generate_mac(1, 1)
, auto = site.mesh_on_lan and 1 or 0
})
end
end
c:save('network')
c:commit('network')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment