Commit graph

251 commits

Author SHA1 Message Date
Vladislav Grigoryev
86599694ee luci-mod-network: support dhcp.dnsmasq.ipset
Allow to modify the ipset option in the dhcp.dnsmasq config.
This makes possible to populate IP sets with dnsmasq.

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
2021-10-01 03:56:59 +03:00
Florian Eckert
7db926f438
Merge pull request #5378 from vgaetera/dhcpv6-sourcefilter
luci-mod-network: support network.interface.sourcefilter
2021-09-27 18:27:10 +02:00
Jo-Philipp Wich
0b49ed45c6 luci-mod-network: fix disabling 11w MFP for WPA3
Fixes: #5394
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-09-27 10:05:13 +02:00
Jo-Philipp Wich
e0053fe79d luci-mod-network: fix name of network.device.isolate uci option
Fixes: #5383
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-09-23 17:33:43 +02:00
Vladislav Grigoryev
22296fb072 luci-mod-network: support network.interface.sourcefilter
Allow to modify the sourcefilter option in the network.interface config.
This is required for custom policy routing with IPv6 MWAN and/or NAT6.

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
2021-09-22 17:14:18 +03:00
Vladislav Grigoryev
0be0f06907 luci-mod-network: fix route and rule options
Allow adding routes with unspecified interface.
This is required for prohibit, blackhole and unreachable routes.

Allow adding routes with loopback interface.
This can work as a blackhole route.

Fix netmask to prefix conversion for the routes.
Identify the IP family by the UCI section type.

Avoid setting the routing table textvalue for the rules.
The rules should target none table unless specified otherwise.

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
2021-09-04 15:51:11 +03:00
Florian Eckert
9b7cf08c0e
Merge pull request #5008 from mpratt14/vlan-default
luci-mod-network: do not remove enable_vlan from config
2021-09-03 10:46:56 +02:00
Vladislav Grigoryev
b4f4799f9e luci-mod-network: network/routing support for pbr
Provide comprehensive routing configuration:
* Rename the "Network > Routes" page to "Network > Routing".
* Unify sorting for the "Status" and "Network" menus.
* Add the tabs "IPv4 Rules" and "IPv6 Rules" to the "Routing" page.
* Provide configuration for IPv4 and IPv6 routing rules.
* Consolidate routing configuration and terminology for IPv4 and IPv6.

Policy-based routing is an increasingly popular problem.
Netifd natively supports policy-based routing:
* Interface-specific options "ip4table" and "ip6table".
* Routing rules using the "rule" and "rule6" sections.
LuCI is missing configuration for routing rules.

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
2021-09-01 10:51:16 +03:00
Jo-Philipp Wich
71d79ec0c1
Merge pull request #5301 from vgaetera/fix-iface-ip6table 2021-08-31 12:45:39 +02:00
Sven Roederer
1b58decdab luci-mod-network: clarify device settings "Delete" button
Use proper label text "Unconfigure" for button which "Remove related device settings".

Ref: #5090, #5092
Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
2021-08-31 11:35:54 +02:00
Florian Eckert
8c35a940fe
Merge pull request #5296 from vgaetera/dhcp-labels
luci-mod-network: update dhcp and dns labels and descriptions
2021-08-31 09:45:43 +02:00
Vladislav Grigoryev
63132ff3be luci-mod-network: update dhcp and dns labels and descriptions
Update labels and descriptions for DHCP and DNS settings.
Add missing descriptions and clarify the existing ones.
Group settings by tab and avoid redundant abbreviations.
Consolidate terminology according to the dnsmasq documentation:
https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
Fix spelling according to the previously adopted policy:
88b9d84388

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
2021-08-30 17:03:46 +03:00
Vladislav Grigoryev
8b4015036d luci-mod-network: fix route6 source autocomplete
Fix the wrong value for the "source" option of the "route6" section.

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
2021-08-26 13:38:08 +03:00
Vladislav Grigoryev
3ebdf51f9b luci-mod-network: fix option ip6table in network/interfaces
Fix the incorrectly displayed value for the option "ip6table".

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
2021-08-26 05:01:23 +03:00
Fritz D. Ansel
2393289367 network: hide dnamsq (dhcp+dns) item
.. when no dnsmasq is installed, as it
tells only that there are no settings available

Signed-off-by: Fritz D. Ansel <fdansel@yandex.ru>
2021-08-11 09:25:51 +02:00
Vladislav Grigoryev
96ef7beb66 luci-mod-network: merge hosts with dns settings
The current location for "Network > Hostnames" is confusing.
It is provided by Dnsmasq and partly overlaps with static leases.

Merge "Hostnames" with "Network > DHCP and DNS" as an extra tab.
Also add a simple explanation of the use case.

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
[Fix typo in label description string]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-08-09 19:56:50 +02:00
Jo-Philipp Wich
fd2e755b6f luci-mod-network: fix legacy_rates option dependency
The recently introduced band option support changed the internal frequency
selector choice values, breaking the legacy rates option dependency.

Fixes: #5234
Fixes: 0829d31290 ("luci-mod-network: support newer wireless.wifi-device.band option")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-08-09 19:43:56 +02:00
Jo-Philipp Wich
e5626ece12 luci-mod-network: fix 60GHz radio frequency configuration
Fix incorrect minimum 60GHz frequency value and ensure that a 60GHz band
choice option is available once corresponding channels are found on the
system.

Ref: http://lists.openwrt.org/pipermail/openwrt-devel/2021-July/035810.html
Suggested-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-09 21:39:45 +02:00
Jo-Philipp Wich
f57d20bfff luci-mod-network: dhcp.js: don't fail on not existing interface
Fixes: #5177
Fixes: 7e56289538 ("luci-mod-network: improve static DHCP lease validation")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-08 18:56:23 +02:00
Jo-Philipp Wich
9d15a4e70c luci-mod-network: fixes to DHCP lease validation
- validate current form value IP instead of stored uci one
 - ensure to not pass non-string values to the validator
 - remove leftover debug code
 - simplify obtaining formvalues

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-03 20:40:29 +02:00
Jo-Philipp Wich
7e56289538 luci-mod-network: improve static DHCP lease validation
- Ensure that MAC addresses are unique within the same pool
 - Ensure that IP addresses are globally unique
 - Ensure that IP addresses are within any DHCP pool range

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-03 18:54:14 +02:00
Jo-Philipp Wich
91f46d765b Revert "luci-mod-network: issue with breakdown of dnsmasq after duplication of static IP was fixed"
This reverts commit 463e910119.

This change causes the entire static lease to get deleted when attempting
to change the MAC address.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-03 07:20:37 +02:00
Jo-Philipp Wich
f1f566bfe2 luci-mod-network: fix saving bridge VLANs without member ports
Calling `uci.set()` with an empty array yields an invalid argument error,
make sure to pass `null` instead in this case.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-02 20:47:11 +02:00
Jo-Philipp Wich
2869c9cf32 luci-mod-network: work around jsmin bug
The jsmin minifier incorrectly transforms the expression `/\*/.test(...)`
into `/\* /.test(...)`, causing the VLAN filter dialog to not recognize
PVID settings in the configuration.

Work around the issue by using an equivalent `\x2a` escape sequence instead.

Ref: https://forum.openwrt.org/t/x/99222/28
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-02 20:43:31 +02:00
Jo-Philipp Wich
c4f4294615 luci-mod-network: enforce IPv4 mode for traceroute call
Recent busybox traceroute applet versions support both IPv4 and IPv6 and
default to IPv6 when running a route trace to an IPv6 enabled target
host. Pass the `-4` flag to enforce IPv4 mode in this case.

Fixes: #5155
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-30 17:23:55 +02:00
Florian Eckert
b88157e69a
Merge pull request #4965 from tano-systems/pr/20210406-disable-routes-support
luci-mod-network: Support for disabling routes
2021-06-21 12:44:36 +02:00
Jo-Philipp Wich
c48d8f4a2c treewide: fix typo in "Enable VLAN filtering" label
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-21 08:27:14 +02:00
Jo-Philipp Wich
e57f8663af luci-mod-network: parse ports without tag/pvid annotation as well
Fixes: 01eac366f6 ("luci-mod-network: fix tagging/pvid state parsing in bridge-vlan ports")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-17 17:44:21 +02:00
Jo-Philipp Wich
01eac366f6 luci-mod-network: fix tagging/pvid state parsing in bridge-vlan ports
The previous code naively looked for a `t` in the entire port spec,
wrongly matching untagged ports having a `t` in their name, such
as `eth0`.

Rework the logic to be more strict when parsing the port member
specification to avoid this issue.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-17 17:33:49 +02:00
Jo-Philipp Wich
f689d0d208 luci-mod-network: refactor device configuration
Since all netifd device types inherit generic device settings, we can
simplify various aspects of the device configuration ui and drop unused
code while we're at it.

 - Remove setIfActive() helper, superseded by commit
   f3f74bd0fe ("luci-base: form.js: consider aliased options in AbstractValue.remove()")

 - Remove most dependency constraints to make all generic device settings
   available for all device types

 - Add MTU value validation to disallow exceeding parent device MTU for
   VLAN interfaces

 - Dynamically update placeholder values when changing base or parent
   device options

 - Undo VLAN network config hack since all options are available now.
   Reverts commit
   3c6b59504a ("luci-mod-interfaces: simplify configuring MAC address of 802.1q devices")

 - Do not suggest inactive wireless networks as existing device or base
   device choices

 - Disallow specifying names of already existing network devices when
   creating new device settings

 - Fix a number of multicast dependency specifications

 - Drop now unused functions

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-17 12:40:43 +02:00
Jo-Philipp Wich
36350e9867 luci-mod-network: change port status layout in vlan filter config
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-17 09:45:48 +02:00
Jo-Philipp Wich
f6f1eacb01 luci-mod-network: only consider bridge vlans belonging to the current device
In case multiple bridges with bridge vlans are declared, LuCI did not
correctly filter the VLANs to show only the ones belonging to the
bridge being configured currently.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-17 09:22:16 +02:00
Jo-Philipp Wich
4286c84825 luci-mod-network: wireless.js: recognize HE* htmodes
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3856#comment9797
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-14 09:06:20 +02:00
Jo-Philipp Wich
cbf2cc396a luci-mod-network: small styling fixes for vlan filter matrix
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-13 21:48:11 +02:00
Rafał Miłecki
fa51d04459 luci-mod-network: migrate more device options
Include mtu and igmp_snooping while migrating.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-06-12 23:01:28 +02:00
Jo-Philipp Wich
bb3269945c luci-mod-network: reset bridge VLANs on cancelling modal dialog
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-12 22:54:51 +02:00
Jo-Philipp Wich
7a781d9cd8 luci-mod-network: fix vlan filter matrix overflow after redraw
Ensure that the overflow styles are reapplied after a redraw. This also
simplifies the code as a side-effect.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-12 22:08:13 +02:00
Jo-Philipp Wich
8c71b1d01e luci-mod-network: add port status to bridge vlan filter matrix
Also ensure that port devices are ordered numerically.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-11 10:19:06 +02:00
Jo-Philipp Wich
ded6e53bcd luci-mod-network: fix horizontal scrolling in the bridge vlan filter matrix
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-09 21:55:43 +02:00
Jo-Philipp Wich
fb82e03635
Merge pull request #5110 from jow-/wireless-band-option
luci-mod-network: support newer wireless.wifi-device.band option
2021-06-09 19:26:04 +02:00
Jo-Philipp Wich
e13d82a202 luci-mod-network: interfaces.js: fix ifname migration in device sections
The migration code attempted to add new device sections instead of moving
the ifname option to a ports list within the existing ones.

Fixes: #5108
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-09 11:01:36 +02:00
Jo-Philipp Wich
608f89429b luci-mod-network: interfaces: show bridge port device icons again
Restore the display of bridge port device icons in the interface overviews.
This feature has been lost after migrating the network config from legacy
bridge declarations to device bridge declarations.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-09 10:22:38 +02:00
Jo-Philipp Wich
0829d31290 luci-mod-network: support newer wireless.wifi-device.band option
OpenWrt switched from "option hwmode" to "option band" in order to select
the frequency band to use for the radio phy.

Extend the channel selector to recognize and use an existing "option band"
to select the appropriate channel list. When operating upon a wireless
configuration still using "option hwmode", then translate it to a band
value internally and translate it back to "option hwmode" on save.

This should provide forward- and backwards compatibility with both current
OpenWrt master and older versions still using hwmode.

Fixes: #5106
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-09 10:03:54 +02:00
Jo-Philipp Wich
88b9d84388 treewide: consolidate {IPv4,IPv6,MAC} {address,gateway} spellings
- Turn IPv4-Address into IPv4 address
 - Turn IPv4-Gateway into IPv4 gateway
 - Turn IPv6-Address into IPv6 address
 - Turn IPv6-Gateway into IPv6 gateway
 - Turn MAC-Address into MAC address

Also remove related duplicate translation entries.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-07 12:48:08 +02:00
Jo-Philipp Wich
b5832d134e treewide: fix "promiscious" typo
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-07 11:53:04 +02:00
Jo-Philipp Wich
9bd27b0bb8
Merge pull request #5095 from jow-/dhcpv6-rework
luci-mod-network: interfaces: restructure DHCPv6 and IPv6 RA options
2021-06-05 19:13:05 +02:00
David Bauer
516c58e133
Merge pull request #5070 from blocktrron/pr-luci-wifi6
luci-mod-network: add 802.11ax HE support
2021-06-05 19:04:11 +02:00
Jo-Philipp Wich
a6c0ad00b2 luci-mod-network: allow device declarations and device configs to coexist
It is legal to have two device sections referring to the same netdev if one
section is a declaration (a section setting option type) and the other is
a configuration (a section not specifying a type but matching an existing
netdev).

Support this case in LuCI since it might be required for some complex
device setups.

Additionally, fix the device type determination for device configuration
sections without type, those should be treated as ethernet (a.k.a.
simple device) configuration instead of falling back to the underlying
netdev device type.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-05 18:41:39 +02:00
David Bauer
f35e877dc6 luci-mod-network: add 802.11ax HE support
This commit adds the ability to configure HE-modes for radios
(HE20 / HE40 / HE80 / HE160) as well as HE rate information in the
assiciation view.

Tested-on: Ubiquiti UniFi 6 Lite / LR

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-05 16:24:19 +02:00
Jo-Philipp Wich
3c6b59504a luci-mod-interfaces: simplify configuring MAC address of 802.1q devices
Treat not explicitly configured, preexisting VLAN interfaces as simple
network devices when adding configuration for them, since it is more
likely that people want to set general device properties such as MAC
address instead of reconfiguring ingress/egress QoS mapping, which is
the only editable property of preexisting VLAN device config dialogs.

Ref: https://github.com/openwrt/luci/issues/5102
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-05 16:17:37 +02:00