Commit Graph

585 Commits

Author SHA1 Message Date
Paul Donald 4de4296642 luci-mod-network: add PIO flag management
odhcpd specific flag. PD-P only works with dhcpv6_pd and dhcpv6.

Also move some DHCPv6 specific settings to a new DHCPv6 tab.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-01-11 23:35:42 +01:00
Paul Donald 44c934efec luci-mod-network: fill set tag fields with available tags
Add predefined tags that the user sets

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-01-06 04:08:55 +01:00
Paul Donald 3c8ff55120 luci-mod-network: add tags tab
For use with dnsmasq tags

Note that a MAC tab is possible but the same functionality
is present in the leases tab which handles MACs and tags.
A MAC tab has a 1:1 tag:MAC relationship, whereas the leases
has a many:many relationship.

The dnsmasq init file needs updating to use 'tag' in
place of 'networkid', which is an older legacy format still
understood by dnsmasq, but all documentation uses 'tag'.

tag names shall not match:
- network devices/interfaces
- service names

Three dnsmasq reserved tag names are:
- known
- !known
- known-othernet

Tag names can be prepended with '!' to invert their usage.

Closes #7178

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-12-31 18:37:15 +01:00
David Härdeman 7a18a0ef42 luci-mod-network: show leases first in DHCP tab
Fiddling with the dnsmasq/odhcpd specific settings is (at least in my
experience) a much less common operation than wanting to see/change
leases and their configuration, so reorder the tabs to show leases first
and dnsmasq/odhcpd tabs second/third.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-12-31 00:52:36 +00:00
Liangbin Lian 74d2192e83 luci-mod-network: show "dhcpv4" option for dnsmasq
For odhcpd, an empty "dhcpv4" is equivalent to "disabled",
but for dnsmasq, an empty "dhcpv4" is equivalent to "enabled",
so an empty "dhcpv4" is ambiguous.

Fixes https://github.com/openwrt/openwrt/issues/21220

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-12-23 13:22:01 +01:00
David Härdeman effe3ea281 luci-mod-network: update dhcpv6_pd_min_len values
odhcpd will allow a greater range of PD prefix lengths, so update the UI
to reflect this.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-12-19 13:18:43 +01:00
Paul Donald c937c7fa27 luci-mod-network: reveal ra_preference as router priority
router preference sounds ambiguous, so we name it priority which
has an unambiguous meaning.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-12-13 18:57:21 +01:00
Paul Donald ef4a1c9cea luci-mod-network: remove debugger statement
follow-up to 7df4840b1c

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-12-13 13:36:59 +01:00
David Härdeman ac136290da luci-mod-network: update odhcpd configuration
Update two cfg parameters that have changed names/behaviour in recent
versions of odhcpd.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-12-13 13:15:15 +01:00
Paul Donald 7df4840b1c luci-mod-network: ES6 refactor for diagnostics
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-12-12 16:40:04 +01:00
Richard Yu 122a5ba73e luci-mod-network: diagnostics: add realtime command output
The diagnostics page is using `fs.exec()` to execute command, which blocks
until command exit. Users have to wait for a while to see the result.

When doing IPv6 traceroute, this may cause XHR timeout, if target host
is unreachable. (See issue #7210)

This commit uses new `responseProgress` callback and `stderr` option
added in luci.js and fs.js to update command output.

Signed-off-by: Richard Yu <yurichard3839@gmail.com>
Link: https://github.com/openwrt/luci/pull/7920
2025-12-12 16:40:04 +01:00
David Härdeman 790d58e4e6 luci-mod-network,-status: expose DUID/IAID for DHCPv4
We already show the DUID in one table (in the overview), this makes the
tables under the "DHCP > Leases" tab consistent with the overview, and
exposes the DUID/IAID in both.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-12-03 13:36:29 +01:00
David Härdeman 70d89764e3 luci-mod-network,-status: expose the lease interface
This adds support to LuCI for showing the interface which a given lease
corresponds to (assuming that odhcpd is providing the DHCPv4/6 services,
which the code also checks for).

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-12-03 13:36:29 +01:00
David Härdeman 62848505e6 luci-mod-network: fix table headings
Shorten the lease time description (the header of the tables already
says it contains DHCP leases, so "Remaining Time" is enough), make it
clear that we have DHCPv4/6 leases and not DHCP/DHCPv6 leases.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-12-02 22:58:12 +01:00
David Härdeman 61e81c1b53 luci-mod-network: add IPv6-only preferred option
This adds support for the IPv6-only preferred (RFC8925) option to LuCI.

The option is supported by odhcpd since commit
338ca8abb950e4e0448a13d50d6d6567a167d016

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-11-30 16:58:42 +01:00
Rany Hany ec39df25b5 luci-mod-network: bump reassociation_deadline default to 20000
With OpenWRT commit [1], the default for reassociation_deadline
is now 20000. Update LuCI to reflect that change.

[1]: https://github.com/openwrt/openwrt/commit/a7790ce41099549cf6c97765561ac716d102ae5e

Signed-off-by: Rany Hany <rany_hany@riseup.net>
2025-11-28 23:04:10 +01:00
try496 e6318e8305 luci-mod-network: add translation string for log level
add translation string for log level

Signed-off-by: He Ping <pinghejk@gmail.com>
2025-11-27 00:31:02 +01:00
Paul Donald 805b2db670 luci-mod-network: Implement WiFi QR Codes
This implements T:, R:, S: and H: parameters standardized within WiFi QR codes.

This leaves the SAE-PK related options unimplemented. A future UI will likely
handle SAE-PK options differently than in hostapd_bss_options.

Current parameters are based on:
https://www.wi-fi.org/system/files/WPA3%20Specification%20v3.5.pdf#page=33

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-11-25 00:43:33 +01:00
Marko Zajc 2a2f2d4dbd luci-mod-network: Add flag for address_as_local
'Addresses' option entries in the general tab of DHCP and DNS settings are
sometimes (I'm not sure about the exact conditions) passed to upstream resolver,
bypassing local resolution.

A workaround for a small list of domains is to add them to 'Resolve these
locally' option, but this is very tedious to do, and dnsmasq limits it to 1024
characters.

openwrt/openwrt#18610 adds behaviour to add addresses to the local resolution
list automatically, and this commit adds a flag to LuCI to control that.

Signed-off-by: Marko Zajc <marko@zajc.tel>
2025-11-18 16:34:39 +01:00
Paul Donald 360c7b0758 luc-mod-network: wireless; make mesh functionality findable when absent
Also make it as unobtrusive as possible. Some users do not care about it.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-11-09 15:41:51 +01:00
Paul Donald c935260b30 luci-mod-network: hint that property belongs to mesh
Hint also units with dBm.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-11-03 22:44:40 +01:00
Paul Donald fd96244e79 luci-mod-network: dynamically find mode and bssid positions
Dynamically find the mode and bssid position assignments in case their position
should change later.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-11-03 22:38:53 +01:00
Paul Donald 13f9f6f010 luci-mod-network: implement checks for mesh capabilities
802.11s i.e. mesh mode value is now gated behind a check for the capability.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-11-03 22:38:53 +01:00
Paul Donald f9a5309095 luci-mod-network: predicate the display of dnsmasq and odhcpd tabs
First check the features are installed. Further, verify that some sections
exist which some GUI functions depend on.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-29 21:37:54 +01:00
Paul Donald 74d2aad3da luci-mod-network: Add force send of DHCP options (for dnsmasq) to interfaces
Closes #8031

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-29 02:35:14 +01:00
Paul Donald 5193e7bcaf luci-mod-network: DNS; ES6 treatment
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-28 21:01:29 +01:00
Paul Donald 2901c18c71 luci-mod-network: DHCP; refactor generateDnsmasqInstanceEntry
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-28 21:01:29 +01:00
Paul Donald c8310a6821 luci-mod-network: DHCP; ES6 treatment
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-28 21:01:29 +01:00
Paul Donald dfb5663ed0 luci-mod-network: DHCP; make MAC validation work
Previously it was bound to IP properties when we want to verify whether the MAC
is in use elsewhere.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-28 21:01:29 +01:00
Paul Donald 16aab4d463 luci-mod-network: DHCP; convert Relay from to widgets.IPSelect
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-28 21:01:29 +01:00
Paul Donald 8210c3a8d7 luci-mod-network: add listen_address for dnsmasq in DHCP and DNS tabs
This limits dnsmasq to listen on specific IPs, when an interface might have
multiple IPs.

Closes #6959

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-28 21:01:29 +01:00
Tianling Shen 4b17392e5f luci-mod-network: move max_{preferred,valid}_lifetime to IPv6-RA tab
These options are RA configuration so they should be put under the
IPv6-RA tab instead of the "generic" IPv6 tab.
Also make them depend on RA server/hybrid mode as these values are
pointless without RA server enabled.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-10-28 18:20:53 +01:00
Paul Donald a010a1bfcd luci-mod-network: Allow the 'dns' entry under the DHCP tab to take IPv4+6
This option is used by odhcpd. It can take IPv4/6 entries, although IPv4 DNS
servers don't always make sense in an IPv6 environment, they might in a dual
stack environment. Entering an IPv4 here results in its distribution via IPv6.

This option becomes more useful for both families when odhcpd handles IPv4+6.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-28 18:16:42 +01:00
David Härdeman e4e707a93b luci-mod-network: add odhcpd cfg in DHCP server setup
The "Set up DHCP Server" button is meant to setup the basics for a DHCP server
on the given interface.  Add odhcpd setting "dhcpv4" as well. It is a no-op in
case odhcpd isn't setup to take care of DHCPv4 as well, but it makes it easier
to support either dnsmasq or odhpcd as the DHCPv4 server.

One might argue that the button should also set dhcpv6=server and ra=server, so
that it doesn't only setup a DHCPv4 server, but also prepares a DHCPv6 server,
but that's for another PR :)

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-26 04:11:06 +01:00
David Härdeman b5e94d3c8a luci-mod-network: stricter feature check for odhcpd
Only show the DHCPv4 option if support is compiled in.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-25 15:31:08 +02:00
David Härdeman 3a5240e852 luci-mod-network: sort options in general/IPv4 tabs
No actual code changes.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-25 15:31:08 +02:00
David Härdeman f763df82e2 luci-mod-network: rename advanced tab
Move the remaining three options to the general tab, mark two of them as
dnsmasq-only.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-25 15:31:08 +02:00
David Härdeman addf4e2947 luci-mod-network: move IPv4 options to the new tab
And mark one option as being dnsmasq-only.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-25 15:31:08 +02:00
David Härdeman 3feda7487c luci-mod-network: mark the ignore flag as dnsmasq-only
And also hide the flag if dnsmasq isn't installed.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-25 15:31:08 +02:00
David Härdeman 563d90cfb9 luci-mod-network: add an "IPv4 Settings" tab to interfaces
And add one option to disable/enable odhcpd's DHCPv4 support.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-25 15:31:08 +02:00
Paul Donald ddb569074e luci-mod-network: prevent double key for menu JSON
follow-up to 7e1b545bfa

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2025-10-25 02:19:50 +02:00
David Härdeman 431787af0c rpcd-mod-luci,luci-mod-network: suggest DUID%IAID values
Change the getDUIDHints RPC method to return "DUID%IAID" hints (if the IAID is
known, which it is with odhcpd). Use the complete hints in luci-mod-network.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-24 20:23:34 +02:00
David Härdeman 5c1d12a079 luci-mod-network: add initial support for multi-DUIDs
And also add support/validation for DUID%IAID values.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-24 20:23:34 +02:00
David Härdeman b5ee911ee5 luci-mod-network: consistent language in static cfg
I've tried to make this more consistent by using "for" to describe values
that are assigned to the host by the DHCP server and "of" to describe values
that are provided by the host to the DHCP server.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-24 20:23:34 +02:00
David Härdeman 46daebe715 luci-mod-network: simplify multi-MAC help text
Simplify the help text a bit, make it more consistent, capitalize "MAC", remove
references to dnsmasq.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-24 20:23:34 +02:00
David Härdeman 6b92594605 luci-mod-network: change IPv6 suffix to token
The term "token" is widely used, e.g. in the relevant internet draft [1],
ip-token(8), systemd-network(5), NetworkManager [2], etc.

[1] https://datatracker.ietf.org/doc/html/draft-chown-6man-tokenised-ipv6-identifiers-02
[2] https://networkmanager.dev/docs/api/1.32.10/settings-ipv6.html

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-24 20:23:34 +02:00
David Härdeman 0a8a41f4cf luci-mod-network,-status: update DHCPv6 lease headers
Make it clearer that a single DHCPv6 lease can encompass several IPv6
addresses, e.g.  when GUA and ULA prefixes are available.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-24 20:23:34 +02:00
David Härdeman 985d454eaf luci-mod-network: create separate tabs in dhcp.js
Create three main tabs ("dnsmasq", "odhcpd", "Leases") in dhcp.js and
sort the previous tabs under these main tabs.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-24 15:57:43 +02:00
David Härdeman dfb4e3233a luci-mod-network: split PXE into dnsmasq/odhcpd functions in dhcp.js
This makes it clearer which daemon each part belongs to. But more
importantly, it lays the ground for the next patch.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-24 15:57:43 +02:00
David Härdeman 000ba488d8 luci-mod-network: add a odhcpd tab to dhcp.js
Add a separate tab with the global odhcpd settings.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-10-24 15:57:43 +02:00