gluon-core: restructure WAN configuration
This commit is contained in:
parent
d8f0c531c9
commit
3762f52c69
@ -1,19 +1,9 @@
|
|||||||
#!/usr/bin/lua
|
#!/usr/bin/lua
|
||||||
|
|
||||||
local sysconfig = require 'gluon.sysconfig'
|
|
||||||
local uci = require('luci.model.uci').cursor()
|
local uci = require('luci.model.uci').cursor()
|
||||||
|
|
||||||
|
|
||||||
uci:delete('network', 'lan')
|
uci:delete('network', 'lan')
|
||||||
uci:delete('network', 'wan')
|
uci:delete('network', 'wan')
|
||||||
|
|
||||||
uci:section('network', 'interface', 'wan',
|
|
||||||
{
|
|
||||||
ifname = sysconfig.wan_ifname,
|
|
||||||
type = 'bridge',
|
|
||||||
proto = 'dhcp',
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
uci:save('network')
|
uci:save('network')
|
||||||
uci:commit('network')
|
uci:commit('network')
|
||||||
|
@ -2,22 +2,34 @@
|
|||||||
|
|
||||||
local uci = require('luci.model.uci').cursor()
|
local uci = require('luci.model.uci').cursor()
|
||||||
local sysctl = require 'gluon.sysctl'
|
local sysctl = require 'gluon.sysctl'
|
||||||
|
local sysconfig = require 'gluon.sysconfig'
|
||||||
|
|
||||||
|
|
||||||
if not uci:get('network', 'interface', 'wan6') then
|
uci:section('network', 'interface', 'wan',
|
||||||
uci:section('network', 'interface', 'wan6',
|
{
|
||||||
{
|
ifname = sysconfig.wan_ifname,
|
||||||
ifname = 'br-wan',
|
type = 'bridge',
|
||||||
proto = 'dhcpv6',
|
peerdns = 0,
|
||||||
}
|
auto = 1,
|
||||||
)
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if not uci:get('network', 'wan', 'proto') then
|
||||||
|
uci:set('network', 'wan', 'proto', 'dhcp')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
uci:set('network', 'wan', 'peerdns', '0')
|
uci:section('network', 'interface', 'wan6',
|
||||||
|
{
|
||||||
|
ifname = 'br-wan',
|
||||||
|
peerdns = 0,
|
||||||
|
ip6table = 1,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
uci:set('network', 'wan6', 'peerdns', '0')
|
if not uci:get('network', 'wan6', 'proto') then
|
||||||
uci:set('network', 'wan6', 'ip6table', '1')
|
uci:set('network', 'wan6', 'proto', 'dhcpv6')
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
uci:section('network', 'rule6', 'wan6_lookup',
|
uci:section('network', 'rule6', 'wan6_lookup',
|
||||||
|
Loading…
Reference in New Issue
Block a user