Commit Graph

609 Commits

Author SHA1 Message Date
Paul Donald 98fefa8b5b luci-mod-network: convert tag strings i18n
follow-up to 8553ba3f6e

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-05-27 16:40:44 +03:00
Paul Donald 8553ba3f6e luci-mod-network: convert tag strings i18n
settags

closes #8603

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-05-27 16:25:08 +03:00
Paul Donald ad487f931f luci-mod-network: convert tag strings i18n
matchtags

closes #8603

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-05-27 16:25:02 +03:00
Paul Donald 2708c78089 luci-mod-network: correctness fixes
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-05-27 15:49:46 +03:00
Andy Chiang 0df858d63c luci-mod-network: keep steering_flows in config file
remove `o.default` to keep steering_flows in config file

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
2026-05-27 14:32:38 +03:00
Andy Chiang c1a2e28f9d luci-mod-network: dhcpv4 option uses '' instead of "disabled"
"disabled" is the default dhcpv4 option in odhcpd.
Which has the same effect as not defining it.
Using '' will prevent unnecessary parameters from being written to the flash.

Link https://github.com/openwrt/odhcpd/blob/master/README.md

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
2026-05-27 14:32:38 +03:00
Andy Chiang bfcfec76ae Revert "luci-mod-network: ra_preference option uses '' instead of "medium""
This reverts commit 6bcdc18d65.

Since the bug where a write operation is executed when the input
matches the default has been fixed in form.js, this workaround
is no longer needed and is being reverted.

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
2026-05-27 14:32:38 +03:00
Andy Chiang 6bcdc18d65 luci-mod-network: ra_preference option uses '' instead of "medium"
"medium" is the default ra_preference option in odhcpd.
Which has the same effect as not defining it.
Using '' will prevent unnecessary parameters from being written to the flash.

Link https://github.com/openwrt/odhcpd/blob/master/README.md

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
2026-05-19 12:15:11 +03:00
Andy Chiang 317ff9dd76 luci-mod-network: mptcp option uses '' instead of "off"
In the mptcp options, "off" is the default option, which has the same effect as not defining it.
Using '' will prevent unnecessary parameters from being written to the flash.

Link https://openwrt.org/docs/guide-user/network/mptcp

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
2026-05-16 11:09:45 +03:00
Paul Donald 6f461a225e luci-mod: use built-in format for wifi hostname
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-04-20 14:46:13 +02:00
weicheng04 1655946120 luci-mod-network: fix uci.remove() deleting entire radio section on wifi join
In handleJoinConfirm(), when the scanned BSS has no VHT/HT info,
uci.remove('wireless', radioDev.getName(), 'htmode') is called
intending to remove only the htmode option. However, uci.remove()
only accepts (conf, sid) and silently ignores the third parameter,
causing the entire wifi-device section to be deleted from the
rpcd session delta.

This makes the radio disappear from the Wireless Overview page
until the session delta is cleared.

Fix by using uci.unset() which correctly handles three parameters
(conf, sid, opt) to remove a single option.

Signed-off-by: Weicheng Xiao <weicheng.xiao@outlook.com>
2026-04-10 15:51:11 +02:00
Paul Donald a6b7ad4652 luci-mod-network: check kernel for mptcp to display MPTCP options
https://www.kernel.org/doc/html/v6.12/networking/mptcp-sysctl.html

There may be user instances where mptcp was not compiled
into the kernel or is an unloaded module, so gate the options
behind the feature check.

Closes #8522

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-04-04 19:12:54 +02:00
Ramon Van Gorkom a4f0c52fbf luci-mod-network: show option also for sae
For sae the cipher overrule is not exposed.
There can be cases where this is needed.
See e.g. https://github.com/openwrt/openwrt/issues/22200

Signed-off-by: Ramon Van Gorkom <Ramon00c00@gmail.com>
2026-03-30 14:53:29 +02:00
Paul Donald 761c2cda5f luci-mod-network: tighten MAC check regex
dnsmasq behaviour changed slightly and MACs separated
by hyphen are no longer accepted. Accept only colon
separator when validating. Also enforce hex doublets,
i.e. 00 instead of 0.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-23 19:10:01 +01:00
Paul Donald 1d7fa8163c luci-mod-network: align STP defaults with netifd
Closes #8443

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-19 21:29:19 +01:00
Vishnu Verma fc28ca58da luci-mod-network: fix field names for private key file and password
Fixed field names to be compatible with wpa_supplicant ucode script

Signed-off-by: Vishnu Verma <vermavishnuverma@gmail.com>
2026-03-16 22:19:18 +01:00
Christian Marangi 068150ba5f luci-mod-network: escape WiFi SSID on Scanning AP modal
After the ES2016 rework, a very old bug was reverted where the WiFi SSID was
treated as raw HTML and directly appended to DOM.

This might result in XSS vulnerability with specially crafted SSID from the
Access Point around.

This is only triggered on opening the modal as the normal wireless.js view
doesn't scan the Access Point.

To fix this and make it more clear that SSID must be always escaped, move the
SSID handling to a dedicated variable and use the document.createTextNode()
to escape it similar to how it's done in similar place like the
channel_analysis.js

Fixes: cdce600aae ("luci-mod-network: give wireless.js ES2016 treatment and refactor")
Reported-by: Sasha Romijn <sct@mxsasha.eu>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-03-13 19:15:53 +01:00
Paul Donald 69596756a7 luci-mod-network: allow interface names to max of 15 chars
The Kernel receives the name suffix, so evaluate length on
the user provided name and disconnect the formatted name
code length check.

Closes #8390

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-05 18:50:31 +01:00
Paul Donald 2b63b19363 luci-mod-network: drop unused dnsmasq ipset option
Closes #8365

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-02 19:11:21 +01:00
Paul Donald 9e21e74888 luci-mod-network: MPTCP
See openwrt/openwrt@c8d5abd62b

Available since 24.10

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-02-20 02:58:46 +01:00
Paul Donald 95b01600e3 luci-mod: js linting fixes / ES6 treatment
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-02-16 01:42:57 +01:00
Paul Donald 4f433cc918 luci-mod-network: enable row filtering for interfaces overview
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-02-03 06:42:16 +01:00
Youfu Zhang bc2d7b5b1a luci-mod-network: fix placeholder for roaming identifiers
OpenWrt commit 3cc56a5 chaged the default value of `mobility_domain` and
`r1_key_holder` options. This commit removes the stale hard-coded `4f57`
from luci to avoid ambiguity.

Closes: openwrt/luci#8267
Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
2026-01-29 19:22:13 +01:00
Carlo Szelinsky 8e493db75a luci-base: poe and PSE details & configuration
Adds PoE/PSE configuration support for modern linux (PSE-PD).
This change is based on the PSE-PD backport (from 6.17)
and netifd|ubus changes.

* Add getPSE() [receive all status information]
and hasPSE() [has the device PSE hardware?]

* Changes ACL permissions to query network.device status information

* Add two new PoE icons (PoE active with link up + link down) for
the port status page

* Changes port status to show PoE information, next to link information
and data transfer.

* Add a new tab for PoE/PSE to the device configuration,
which will only be displayed if the device supports PSE

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
2026-01-26 03:40:38 +01:00
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