Merge 86802acefd
into 48d00abe4f
This commit is contained in:
commit
49f4ed3541
@ -23,8 +23,7 @@ uci:section('network', 'device', 'local_node_dev', {
|
||||
local ip4, ip6
|
||||
|
||||
if next_node.ip4 then
|
||||
local plen = site.prefix4():match('/%d+$')
|
||||
ip4 = next_node.ip4 .. plen
|
||||
ip4 = next_node.ip4 .. '/32'
|
||||
end
|
||||
|
||||
if next_node.ip6 then
|
||||
|
@ -7,6 +7,7 @@
|
||||
local site = require 'gluon.site'
|
||||
local util = require 'gluon.util'
|
||||
local uci = require('simple-uci').cursor()
|
||||
local next_node = site.next_node({})
|
||||
|
||||
|
||||
uci:section('network', 'interface', 'client', {
|
||||
@ -23,13 +24,35 @@ uci:section('network', 'interface', 'client', {
|
||||
|
||||
uci:delete('network', 'client_lan')
|
||||
|
||||
uci:section('network', 'route', 'br_client_route', {
|
||||
interface = 'client',
|
||||
target = site.prefix4(),
|
||||
})
|
||||
|
||||
uci:section('network', 'rule', 'local_node_rule', {
|
||||
src = next_node.ip4 .. '/32',
|
||||
lookup = 2,
|
||||
})
|
||||
uci:set('network', 'local_node_rule', 'in', 'loopback')
|
||||
|
||||
uci:delete('network', 'local_node_route')
|
||||
uci:section('network', 'route', 'local_node_route', {
|
||||
interface = 'local_node',
|
||||
target = site.prefix4(),
|
||||
table = 2,
|
||||
})
|
||||
|
||||
uci:section('network', 'rule6', 'local_node_rule6', {
|
||||
src = next_node.ip6 .. '/128',
|
||||
lookup = 2,
|
||||
})
|
||||
uci:set('network', 'local_node_rule6', 'in', 'loopback')
|
||||
|
||||
uci:delete('network', 'local_node_route6')
|
||||
uci:section('network', 'route6', 'local_node_route6', {
|
||||
interface = 'client',
|
||||
interface = 'local_node',
|
||||
target = site.prefix6(),
|
||||
gateway = '::',
|
||||
table = 2,
|
||||
})
|
||||
|
||||
uci:save('network')
|
||||
|
Loading…
Reference in New Issue
Block a user