gluon-packages/gluon/gluon-core/files/lib/gluon/upgrade/core/invariant/011-network

47 lines
884 B
Plaintext
Raw Normal View History

#!/usr/bin/lua
local uci = require('luci.model.uci').cursor()
local sysctl = require 'gluon.sysctl'
if not uci:get('network', 'interface', 'wan6') then
uci:section('network', 'interface', 'wan6',
{
ifname = 'br-wan',
proto = 'dhcpv6',
}
)
end
uci:set('network', 'wan', 'peerdns', '0')
uci:set('network', 'wan6', 'peerdns', '0')
uci:set('network', 'wan6', 'ip6table', '1')
uci:section('network', 'rule6', 'wan6_lookup',
{
mark = '0x01/0x01',
lookup = 1,
}
)
uci:section('network', 'route6', 'wan6_unreachable',
{
type = 'unreachable',
interface = 'loopback',
target = '::/0',
gateway = '::',
table = 1,
metric = 65535,
}
)
uci:save('network')
uci:commit('network')
sysctl.set('net.ipv6.conf.all.accept_ra', 0)
sysctl.set('net.ipv6.conf.default.accept_ra', 0)