gluon/package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/320-gluon-mesh-batman-adv-client-bridge
Matthias Schiffer 12c324917b treewide: move sysctl settings to /etc/sysctl.d
net.ipv6.conf.br-client.forwarding is moved from gluon-client-bridge to
gluon-mesh-batman-adv, as the setting is not useful with non-bridged
protocols.
2018-04-23 12:28:09 +02:00

53 lines
1.3 KiB
Lua
Executable File

#!/usr/bin/lua
-- This script must be ordered after 300-gluon-client-bridge-network, as
-- it overrides parts of network.client
local site = require 'gluon.site'
local sysconfig = require 'gluon.sysconfig'
local util = require 'gluon.util'
local uci = require('simple-uci').cursor()
uci:section('network', 'interface', 'client', {
ipv6 = true,
proto = 'dhcpv6',
reqprefix = 'no',
peerdns = not site.dns.servers(),
sourcefilter = false,
keep_ra_dnslifetime = true,
robustness = 9,
query_interval = 2000,
query_response_interval = 500,
})
uci:delete('network', 'client_lan')
uci:delete('network', 'local_node_route')
uci:section('network', 'route', 'local_node_route', {
interface = 'client',
target = site.prefix4(),
})
uci:delete('network', 'local_node_route6')
uci:section('network', 'route6', 'local_node_route6', {
interface = 'client',
target = site.prefix6(),
gateway = '::',
})
uci:save('network')
local networks = uci:get_list('firewall', 'mesh', 'network')
util.add_to_set(networks, 'client')
uci:set_list('firewall', 'mesh', 'network', networks)
local networks = uci:get_list('firewall', 'drop', 'network')
util.remove_from_set(networks, 'client')
uci:set_list('firewall', 'drop', 'network', networks)
uci:delete('firewall', 'local_node_dns')
uci:save('firewall')