gluon/package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig
Linus Lüssing b3a9221b07 gluon-l3roamd: site: make node_client_prefix6 optional+deprecated
The site.node_client_prefix6() is only used internally by the l3roamd
protocol. Therefore it is unnecessary to expose it to an administrator.

Instead, if node_client_prefix6 is unspecified in the site, generate an
IPv6 Unique Local Address prefix from the site domain_seed.

This updates the site documentation as well and marks this setting as
both optional and deprecated.

Note: If you had the node_client_prefix6 specified before and want to
use the new autogeneration from the domain_seed instead then this will
break compatibility and will need a gluon-scheduled-domain switch.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
2023-01-07 23:41:24 +01:00

25 lines
995 B
Lua
Executable File

#!/usr/bin/lua
local site = require 'gluon.site'
local l3 = require 'gluon.l3'
local uci = require('simple-uci').cursor()
local nodeip = uci:get('network', 'loopback', 'ip6addr'):match('^[^/]+')
local babelconf='/etc/gluon-babeld.conf'
local file = io.open(babelconf, "w")
file:write("ipv6-subtrees true\n")
file:write("reflect-kernel-metric true\n")
file:write("export-table 254\n")
file:write("import-table 254\n")
file:write("out ip " .. site.next_node.ip6() .. "/128 deny\n")
file:write("redistribute ip " .. site.next_node.ip6() .. "/128 deny\n")
file:write("redistribute ip " .. site.prefix6() .. " eq 128 allow\n")
file:write("redistribute ip " .. l3.node_client_prefix6() .. " eq 128 allow\n")
file:write("redistribute ip " .. site.node_prefix6() .. " eq 128 allow\n")
file:write("redistribute ip 2000::/3 allow\n")
file:write("redistribute local if br-wan deny\n")
file:write("redistribute local ip 0.0.0.0/0 deny\n")
file:write("install pref-src " .. nodeip .."\n")
file:close()