316 Commits

Author SHA1 Message Date
Franco Fichtner
39d5ff1a26 interfaces: allow the unused function script to find these 2025-04-24 10:05:41 +02:00
Ad Schellevis
592a62b0df
wizard: reimplement system setup (#8378)
* wizard: reimplement system setup, for https://github.com/opnsense/core/issues/8352

This commit implements our replacement for the setup wizard. The questions are roughly the same as in the legacy version.
Some less relevant options have been removed (pppoe ondemand for example) and isc-dhcpd has been replaced with dnsmasq.

Only standard tools have been used, a memory model to validate the data and simple input forms in tabs.

The in memory model acts as a wrapper around a legacy configuration data and a couple of component models to apply the requested settings.

Some legacy settings using isset() have been altered to use their empty() equivalent.

* wizard: as we're changing to dnsmasq as default, we need to make sure the console setup configures the same (https://github.com/opnsense/core/issues/8352)

Fix some small php arnings in the process, but further than that just rewrite the dhcpd console handling to use dnsmasq instead of isc.
Eventually we will need to rewrite the console tools as well, but let's try to keep this compatible with minimal impact.

* wizard: change other occurrences of isset($config['dnsallowoverride']) for https://github.com/opnsense/core/issues/8352

* wizard: sort listtags() and some other minor review comments for https://github.com/opnsense/core/issues/8352
2025-03-03 15:26:16 +01:00
Franco Fichtner
988dbae92d interfaces: reload GUI in the background
Take our chances with SSH.  It looks like using 'early'
facility surfaced this problem that was not as trigger
happy before.  The administration page does the same.

PR: https://forum.opnsense.org/index.php?topic=43995.0
2024-12-10 13:58:29 +01:00
Franco Fichtner
669a602e3f interfaces: inline creation is no more #7446 2024-11-25 13:43:22 +01:00
Franco Fichtner
a0b86b43e2 interfaces: remove PPP edit in interfaces settings #7446
Time to ditch this.  Leave a thin dialog for the ports display
and where to access the actual PPP settings.

page-getserviceproviders now folds into page-interfaces-ppps-edit
and remove only once use functions to edit page as well.
2024-11-25 11:11:11 +01:00
Franco Fichtner
8684443b65 plugins: enforce defaults on devices 2024-09-24 12:40:11 +02:00
Franco Fichtner
af62c482e2 interfaces: add 'spoofmac' device option and enforce it
PR: https://forum.opnsense.org/index.php?topic=42798.0
2024-09-14 13:37:17 +02:00
Franco Fichtner
4de945bdae interfaces: routing configuration on changed interfaces only 2024-09-12 22:17:15 +02:00
Franco Fichtner
40db484e07 interfaces: minimize reload exposure on interface apply
Refine this after consulting @adschellevis on the main concern of the
code here.
2024-09-03 10:04:11 +02:00
Franco Fichtner
c1609c9055 interfaces: replace 'newwanip_map' from interface apply
This always bugged me: 'newwanip_map' is called when e.g. DHCP is
done but here we just do it async to start something.  This doesn't
make sense, because eventually it triggers twice.

What rc.reload_all and setports.php do is call 'local' and I think
that makes sense.
2024-09-03 08:18:12 +02:00
Franco Fichtner
3476d11a0a reporting: scrub rrd.inc use 2024-09-02 21:27:26 +02:00
Ad Schellevis
895e58ff25
Reporting / rrd - refactor existing code (#7836)
Add RRD package with a simple factory class and a basic construct to define different rrd output types we support.
This package contains the following:

* RRD/Types -- Output definitions, responsible for generating RRD structures and feeding data
* RRD/Stats -- Statistics gathering classes
* Factory -- binds types and statistics together. 

On my end on a simple test this is roughly 40% faster than running /var/db/rrd/updaterrd.sh, which makes caching of metadata (config access) less relevant.

The new script should be able to replace all existing rrd cruft and supports a debug mode to find discrepanties between defined outputs in types and collected data in stats.

```
Usage: updaterrd.php [-h] [-d]
            -d debug mode, output errors to stdout
```
2024-09-02 16:40:47 +02:00
Franco Fichtner
c17d021b4c interfaces: add proper validation for 6RD and 6to4
Also bring in 947e61b1a5e6fe5 done on stable and refine it further.
So it turns out these run on IPv4 but are immune to "IPv4 connectivity"
switch for better or worse.

PR: https://forum.opnsense.org/index.php?topic=42081.msg211015#msg211015
2024-09-02 09:04:30 +02:00
Franco Fichtner
090c6518d7 interfaces: fix issue with PPP port not being posted; closes #7823
Unify the situation for 'ppp_port' vs 'ports' use by using the latter
as is.  One of the issues of this page always was inconsistency after
all.  Then also zap the validation that causes the changes not to be
accepted.  In theory it's posted anyway but that has been the case for
PPPoE/L2TP/PPTP since the fork.
2024-08-29 09:29:53 +02:00
Franco Fichtner
c6a5678382 interfaces: convert to newwanip_map
One of the nice things is that we don't have to do the global
loop but get all of the information across at once even if
individual listeners will still loop over it if necessary.
2024-08-23 21:46:07 +02:00
Franco Fichtner
6e135903d3 interfaces: this probably still works 2024-08-20 08:08:03 +02:00
Franco Fichtner
23c9a95d1c interfaces: place some exceptions #7446
As discussed with @AdSchellevis make this a reality for
PPP/PPTP/L2TP, but leave PPPoE as is for now.  This
allows inline creation of PPPoE to remain for the time
being.

Inline removal, OTOH, is removed hereby since buggy.
2024-08-16 14:29:26 +02:00
Franco Fichtner
b2d9372b0f interfaces: lock down PPP modes #7446
This change reflects what PPP is actually capable off under
the hood and no functional changes intended.

You could still post a different type but since the goal is
to get rid of posting anything related to PPP this will make
it easier to judge if people actually used this.
2024-08-16 13:33:41 +02:00
Franco Fichtner
37efb1f029 interfaces: light scrubbing for interfaces page #7446
We want to avoid modifying ports for the PPP devices and
rearrange the type feed slightly.  Most of the PHP warnings
on this page relate to PPP trickery that will go away.

Next step will be only offering the matching IPv4/6 types.

Fix one valid warning while here.
2024-08-16 12:46:06 +02:00
Franco Fichtner
805120ea78 interfaces: decouple starting PPP from configured IP modes #7446
PR: https://forum.opnsense.org/index.php?topic=42008.0
2024-08-09 09:30:52 +02:00
Franco Fichtner
b955dbc251 interafces: track interface id #5630 2024-06-07 14:51:31 +02:00
Franco Fichtner
10f7043769 interfaces: present interface ID in hex
We have to revoke being able to set "random" here for now, but
it's not a huge issue since the fallback is now in the daemon.
The daemon also supports the full unsigned long long range but
does not allow hex input which means we are stuck with losing the
highest bit for now if we store in integer in PHP.

We could store a string, but then cannot verify it and it would
not be a hex value.  Meh.
2024-06-07 10:42:24 +02:00
Franco Fichtner
bb041b9085 interfaces: fixed the PPPoE hiccup in dhcp6c, remove this remark 2024-06-06 13:51:59 +02:00
Franco Fichtner
6f2e844698 interfaces: allow ifid specification for #5630
For some reason it convinces me further that we should fix the
ifid default case with a fallback in dhcp6c because users will
not necessarily make that connection and just raise a bug report.
2024-06-06 11:26:43 +02:00
Franco Fichtner
bc34a38c02 interfaces: bring optional prefix ID to advanced DHCPv6 WAN settings #5630 2024-06-04 21:51:36 +02:00
Franco Fichtner
9dad0b2123 interfaces: doing this prevents the router from being registered #5630
The situation is a bit complex involving rtsold, the accept_rtadv and
the system configuration for WAN and LAN.  Will see if we can find
another way to discourage the use of the SLAAC address.  I don't think
we really really need it.
2024-05-30 14:22:18 +02:00
Franco Fichtner
35dc38c2fb interfaces: optional prefix tracking for WAN #5630
While here restructure and reword some of the options.  Also
add a possibility to disable the SLAAC address which complements
this nicely and has been known to be problematic for some users.
2024-05-30 09:40:26 +02:00
Franco Fichtner
80284fb281 interfaces: for consistency 2024-05-07 11:29:10 +02:00
Franco Fichtner
e37514e6f6
interfaces: tweak wording in interface gateway selection (#7445) 2024-05-07 11:17:31 +02:00
Ad Schellevis
ff1991cdee Interfaces - change help text to reflect reality. closes https://github.com/opnsense/core/issues/7339
For dhcp type interfaces, gateways are being pushed by the server and we automatically assume these are "external". For static ones you can configure similar behavior, but only explicit. When selecting a gateway, both reply-to and source nat rules are affected.
When nothing is chosen (now default, earlier "auto-detect"), normal routing rules apply and nothing special happens.
2024-03-21 14:09:12 +01:00
Franco Fichtner
435e69719e
interfaces: refactor interface_bring_down() into interface_reset() and interface_suspend() #6852 (#7040)
Separate use cases to allow for clean non-removal of static addressing
(including CARP VIPs) for use in rc.linkup et al.  While interface_bring_down()
is more or less only being extended with $suspend the journey of this code
change was long and winding. Therefore remove the old ambiguous function
and introduce the new interface_reset() and interface_suspend() variant to
make more sense of the caller's requirements.

interfaces.php is a special case depending on interface enable state so we
pass the $suspend request down to interface_reset() to avoid an if-else
dance.
2023-11-28 11:51:15 +01:00
Stephan de Wit
f213bf2833
Gateways: Single: Migrate to MVC - part 2 (#6808)
Where the first stage primarily aims to keep the legacy handling of gateways intact, this stage does the conversion to MVC.

As part of the migration strategy, configured gateways will not be touched if the migration fails. This allows users to repair the gateways in the new situation.
2023-11-02 09:32:27 +01:00
Franco Fichtner
6946f27708 interfaces: use ifconfig -v xxx0_wlanX list chan for #6967
No change in behaviour yet, but funnily enough the channel list
build got easier and the previous code makes sense now...

Since we are dealing with a lot of duplicated channels now it
further points to restructuring this into a merged select for
mode, channel and width as this is how the driver operates.
2023-11-01 10:17:09 +01:00
Franco Fichtner
6f6284f32e interfaces: improve wireless channel parsing; closes #5765
Channels for "list chan" and "list txpower" may be in a side by side
2 column layout which makes the current parsing fail and miss half
the channels.  Replace the parsing with "sturdy" regex to collect all
the results and also make sure that all modes and fallback modes have
the actual channel information.  Also clean the templating in the
static PHP file a little in related areas.
2023-10-31 08:59:36 +01:00
Franco Fichtner
b8965c687e interfaces: restore gateway assignment for the time being 2023-10-18 12:01:42 +02:00
Ad Schellevis
1c890b8cce Gateways: Single: Migrate to MVC - Import first part of https://github.com/opnsense/core/pull/6808
This commit imports part of the changes from @swhite2 which will keep the legacy handling intact for the first stage of the migration. It should be backwards compatible with the previous (23.7.x) code.

Changes new in this commit which where not in the original PR:

1) dpinger_status() missed $gwitem which rendered gateways statusses down
2) Model version number set to 0.0.1 so we can use the migration later to step into 1.0.0
3) Gateways->gatewayIterator() do not yield MVC records ensuring we are still using legacy config data when being called.
2023-10-03 15:06:22 +02:00
Franco Fichtner
947543c7c6 interfaces: why is this called "alias" IP? 2023-09-30 13:40:00 +02:00
Csaba Kos
1f3311f5dd interfaces: allow multiple IP addresses in dhcp reject from; closes #6683 2023-09-30 13:34:28 +02:00
Franco Fichtner
2396e4b3ff interfaces: adjust wireless handling slightly for new return code 2023-09-20 09:29:49 +02:00
Franco Fichtner
db8b0c5a18 interfaces: meh, we still need to define these otherwise we don't have them 2023-08-29 15:19:01 +02:00
Franco Fichtner
4fa01e5531 interfaces: show identifier, PPP type modem ports and style updates 2023-08-17 10:25:26 +02:00
Franco Fichtner
fac8f85a51 interfaces: refactor interface_parent_devices() to take device name instead
This simplifies the call a little and allows us to do better recursion
away from config-based interfaces.  We could just pass the device as
the interface and it would work but then we pass it down twice and it's
not very readable.
2023-08-16 14:45:31 +02:00
Franco Fichtner
4eaaa0e8c1 interfaces: forgot to commit this apparently 2023-07-24 09:57:07 +02:00
Franco Fichtner
c3db32722d interfaces: remove null_service, empty service name works; closes #6568 2023-07-21 11:39:35 +02:00
Franco Fichtner
5f9b8c70fe unbound: cleanup old files 2023-06-29 09:20:28 +02:00
Steely Wing
91b4ee7968 interfaces: help tip for enable "Promiscuous mode" for VLAN interface; closes #6492 2023-06-29 09:16:39 +02:00
Franco Fichtner
d195cd2e8a interfaces: also set PCP value on IPv4 DHCP traffic
This requires to set up the VLAN priority field of the
DHCPv4 settings as well as removing the vlan-pcp option
which is redundant now.  This way we have a simpler
approach to finding the correct value while not borrowing
from IPv6 or parsing the advanced options for vlan-pcp.

Leaving the old vlan-pcp in place should not matter.
The last value is ours and this one should be used.

PR: https://forum.opnsense.org/index.php?topic=33376.0
2023-04-13 15:54:45 +02:00
Franco Fichtner
4b03f1c88d interfaces: lock gateway save button while the request is being processed #6406 2023-03-09 12:55:35 +01:00
Franco Fichtner
1469471017 interfaces: meh, missing default switch cases are silly 2022-12-21 11:02:11 +01:00
Franco Fichtner
3413a5c67a interfaces: PPPoE IPv6 mode; closes #6204 2022-12-21 10:03:56 +01:00