This is a site.conf-breaking change in regard to the wireless config. Make sure to read http://gluon.readthedocs.org/en/latest/user/site.html and update your site.conf accordingly! Support for 802.11s mesh interfaces has been added. Gluon now supports three interface types: ap, ibss and mesh. All of them are now optional and may be configured independently in site.conf. A sample site.conf may look like this: wifi24 = { channel = 1, htmode = 'HT40+', ap = { ssid = 'luebeck.freifunk.net', }, ibss = { ssid = '02:d1:11:37:fc:38', bssid = '02:d1:11:37:fc:38', mcast_rate = 12000, }, mesh = { id = 'ffhl-mesh', mcast_rate = 12000, }, },
49 lines
972 B
Lua
Executable File
49 lines
972 B
Lua
Executable File
#!/usr/bin/lua
|
|
|
|
local site = require 'gluon.site_config'
|
|
|
|
local uci = require('luci.model.uci').cursor()
|
|
|
|
|
|
local function configure_mtu(radio, config, mtu)
|
|
if config.ibss then
|
|
local network = 'ibss_' .. radio
|
|
|
|
if config.ibss.vlan then
|
|
uci:set('network', network, 'mtu', mtu + 4)
|
|
uci:set('network', network .. '_vlan', 'mtu', mtu)
|
|
else
|
|
uci:set('network', network, 'mtu', mtu)
|
|
end
|
|
end
|
|
|
|
if config.mesh then
|
|
uci:set('network', 'mesh_' .. radio, 'mtu', mtu)
|
|
end
|
|
end
|
|
|
|
|
|
local radios = {}
|
|
|
|
uci:foreach('wireless', 'wifi-device',
|
|
function(s)
|
|
table.insert(radios, s['.name'])
|
|
end
|
|
)
|
|
|
|
local mtu = 1528
|
|
|
|
for _, radio in ipairs(radios) do
|
|
local hwmode = uci:get('wireless', radio, 'hwmode')
|
|
|
|
if hwmode == '11g' or hwmode == '11ng' then
|
|
configure_mtu(radio, site.wifi24, mtu)
|
|
elseif hwmode == '11a' or hwmode == '11na' then
|
|
configure_mtu(radio, site.wifi5, mtu)
|
|
end
|
|
end
|
|
|
|
|
|
uci:save('network')
|
|
uci:commit('network')
|