When preparing the migration from macvlan to veth for local-node, MAC address conflicts occurred as some ports of br-client had the same address as local-node. Reverting the roles of both interfaces fixes this. By default, br-client is left as an interface without addresses and firewall rules that drop everything, so the bridge is used to connect its ports only. gluon-mesh-batman-adv-core changes this to the usual set of addresses and firewall rules.
47 lines
861 B
Lua
Executable File
47 lines
861 B
Lua
Executable File
#!/usr/bin/lua
|
|
|
|
local site = require 'gluon.site_config'
|
|
local sysconfig = require 'gluon.sysconfig'
|
|
|
|
local uci = require('simple-uci').cursor()
|
|
|
|
|
|
uci:delete('network', 'local_node_dev')
|
|
uci:section('network', 'device', 'local_node_dev', {
|
|
name = 'local-node',
|
|
ifname = 'br-client',
|
|
type = 'macvlan',
|
|
macaddr = site.next_node.mac,
|
|
})
|
|
|
|
|
|
local ip4, ip6
|
|
|
|
if site.next_node.ip4 then
|
|
local plen = site.prefix4:match('/%d+$')
|
|
ip4 = site.next_node.ip4 .. plen
|
|
end
|
|
|
|
if site.next_node.ip6 then
|
|
ip6 = site.next_node.ip6 .. '/128'
|
|
end
|
|
|
|
uci:delete('network', 'local_node')
|
|
uci:section('network', 'interface', 'local_node', {
|
|
ifname = 'local-node',
|
|
proto = 'static',
|
|
ipaddr = ip4,
|
|
ip6addr = ip6,
|
|
})
|
|
|
|
uci:save('network')
|
|
|
|
|
|
uci:delete('dhcp', 'local_node')
|
|
uci:section('dhcp', 'dhcp', 'local_node', {
|
|
interface = 'local_node',
|
|
ignore = true,
|
|
})
|
|
|
|
uci:save('dhcp')
|