diff options
-rw-r--r-- | libs/core/root/etc/config/ucitrack | 3 | ||||
-rw-r--r-- | modules/admin-core/luasrc/tools/status.lua | 30 | ||||
-rw-r--r-- | modules/admin-full/luasrc/model/cbi/admin_network/ipv6.lua | 15 |
3 files changed, 45 insertions, 3 deletions
diff --git a/libs/core/root/etc/config/ucitrack b/libs/core/root/etc/config/ucitrack index 084bd679a0..04467f4fdf 100644 --- a/libs/core/root/etc/config/ucitrack +++ b/libs/core/root/etc/config/ucitrack @@ -48,3 +48,6 @@ config samba config tinyproxy option init tinyproxy + +config 6relayd + option init 6relayd diff --git a/modules/admin-core/luasrc/tools/status.lua b/modules/admin-core/luasrc/tools/status.lua index 3ececa8f13..becd7d4659 100644 --- a/modules/admin-core/luasrc/tools/status.lua +++ b/modules/admin-core/luasrc/tools/status.lua @@ -66,10 +66,34 @@ function dhcp_leases() end function dhcp6_leases() - if luci.sys.call("dnsmasq --version 2>/dev/null | grep -q ' DHCPv6 '") == 0 then + local nfs = require "nixio.fs" + local leasefile = "/tmp/hosts/6relayd" + local rv = {} + + if nfs.access(leasefile, "r") then + local fd = io.open(leasefile, "r") + if fd then + while true do + local ln = fd:read("*l") + if not ln then + break + else + local iface, duid, iaid, name, ts, id, length, ip = ln:match("^# (%S+) (%S+) (%S+) (%S+) (%d+) (%S+) (%S+) (.*)") + if ip then + rv[#rv+1] = { + expires = os.difftime(tonumber(ts) or 0, os.time()), + duid = duid, + ip6addr = ip, + hostname = (name ~= "-") and name + } + end + end + end + fd:close() + end + return rv + elseif luci.sys.call("dnsmasq --version 2>/dev/null | grep -q ' DHCPv6 '") == 0 then return dhcp_leases_common(6) - else - return nil end end diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ipv6.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ipv6.lua index ae9bc63386..ba91475dd4 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/ipv6.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ipv6.lua @@ -84,4 +84,19 @@ o:depends("rd", "server") o = s:option(Flag, "compat_ula", translate("ULA-preference compatibility"), translate("Work around IPv6 address-selection issues of some devices.")) +m:section(SimpleSection).template = "admin_network/lease_status" + +s = m:section(TypedSection, "lease", translate("Static Leases"), + translate("Static leases are used to assign fixed IPv6 Interface-IDs to clients. Interface-IDs are appended to available prefixes to form IPv6-addresses. " .. + " (e.g. a prefix of 2001:db80::/64 combined with Interface-ID 123456 will form the address 2001:db80::12:3456)") .. "<br />" .. + translate("Use the <em>Add</em> Button to add a new lease entry. The <em>DUID</em> " .. + "indentifies the host, the <em>Interface-ID</em> specifies the ID to use in addresses.")) + +s.addremove = true +s.anonymous = true +s.template = "cbi/tblsection" + +s:option(Value, "duid", translate("DUID")).optional = false +s:option(Value, "id", translate("Interface-ID")).optional = false + return m |