2014-07-05 21:25:14 +02:00
|
|
|
#!/usr/bin/lua
|
2014-01-25 02:09:35 +01:00
|
|
|
|
2014-07-05 21:25:14 +02:00
|
|
|
local uci = require('luci.model.uci').cursor()
|
|
|
|
local sysctl = require 'gluon.sysctl'
|
2014-01-25 02:09:35 +01:00
|
|
|
|
|
|
|
|
2014-07-11 16:36:32 +02:00
|
|
|
if not uci:get('network', 'interface', 'wan6') then
|
|
|
|
uci:section('network', 'interface', 'wan6',
|
|
|
|
{
|
|
|
|
ifname = 'br-wan',
|
|
|
|
proto = 'dhcpv6',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2014-07-05 21:25:14 +02:00
|
|
|
uci:set('network', 'wan', 'peerdns', '0')
|
2014-02-21 19:58:38 +01:00
|
|
|
|
2014-07-11 16:36:32 +02:00
|
|
|
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,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2014-07-05 21:25:14 +02:00
|
|
|
uci:save('network')
|
|
|
|
uci:commit('network')
|
|
|
|
|
|
|
|
|
|
|
|
sysctl.set('net.ipv6.conf.all.accept_ra', 0)
|
|
|
|
sysctl.set('net.ipv6.conf.default.accept_ra', 0)
|