5369 Commits

Author SHA1 Message Date
Franco Fichtner
9e9be4351f system: add trad. Chinese
It's already over 30% but needs to be vetted first.  Language
pack that includes this is 23.7.7.
2023-10-19 11:49:10 +02:00
Stephan de Wit
eecc882825 openvpn: do not flush state table on linkdown
This has the effect of killing valid states possibly unrelated to
openvpn that are propagated via pfsync
2023-10-19 09:59:47 +02:00
Franco Fichtner
7c052881fa interfaces: numbering is hard 2023-10-18 15:06:29 +02:00
Franco Fichtner
4b932622dd system: use unified style for "return preg_match" idiom so the caller receives a boolean 2023-10-18 09:52:32 +02:00
Franco Fichtner
89ee4109bc interfaces: ignore ULAs for primary IPv6 detection #6939 2023-10-18 09:49:14 +02:00
Franco Fichtner
1e86114a05 system: change wait time to 1 second per round in console
Sync both prompts to 7 seconds.  It will reduce boot wait time
from 9 + 2.5 * 5 = 21.5 seconds to 7 + 7 = 14 seconds.
2023-10-17 11:10:00 +02:00
Franco Fichtner
a224ff4a2b dhcp: sort this a little better, loosely refs #6942 2023-10-17 08:15:46 +02:00
Franco Fichtner
e0e1401f87 interfaces: add no_dad to staticv6; closes #6913 2023-10-16 15:10:03 +02:00
Franco Fichtner
0785e337e9 wireguard: different approach to bootup handling
Since we used to allow IP configuration ands VIPs are
a possibility we can avoid checking for missing IPs
and simply delete the status hash file which will
force an eventual reconfiguration.

While here avoid wireguard_prepare() from creating spurious
devices when there is no need for it as it happens with
manual invoke through "pluginctl -d wgX".  wg-service-control
uses the same logic.
2023-10-16 13:40:10 +02:00
Franco Fichtner
f0f7f6de78 system: make our certs easier to find 2023-10-13 15:06:13 +02:00
Franco Fichtner
55204f9d77 src: style sweep 2023-10-13 08:42:08 +02:00
Ad Schellevis
1bec000c1e Interfaces/neighbor - implement new neighbor configuration for arp/ndp entries closes https://github.com/opnsense/core/issues/6917
This commit adds a new component linked in Interfaces/Neighbors which offers the ability to manually register static leases and provides application control from other modules such as dhcpd. To minimize the risk, we're reusing the existing interfaces_staticarp_configure() hooks while only adjusting how static arp entries are being attached to the interface (match on addresses assigned when triggering with an interface).

Entries registered via dhcp will be visible from the ui as well together with its origin.
The previous version didn't cleanup old static entries, this version triggers a cleanup when executed for all interfaces using all earlier modifications processed via the same function (interfaces_neighbors_configure()).
2023-10-12 16:23:57 +02:00
Franco Fichtner
02b6085023 interfaces: enable IPv6 early on trackers for #6855
This seems to be required nowadays to prevent missing link-local
address until an IPv6 is assigned, then it magically works anyway.
2023-10-10 13:42:23 +02:00
Franco Fichtner
abb24e1c86 system: rewrite trust integration for certctl use
Since OPNsense 22.1 we are using FreeBSD 13 and it comes with a
base trust store which is also maintained there.  In order to be
user-configurable there is also a tool called certctl which will
manage blocking and filling the OpenSSL trust store location
/etc/ssl/certs.  The idea is to make this implicit and faster.

This, however, pseudo-obsoletes the trust bundle handling which
we mainly operate through /etc/ssl/cert.pem.  By pseudo I mean
that ports will still want the real bundles and/or know/guess
this location at complile time.  curl has such overrides for
example.

ca_root_nss's bundle is also pulled in thorough certctl so we
are going to have to jump through a few hoops now in order to
add our certificates cleanly and "prevent" breakage of the
resulting trust store.

Therefore now we write our CA content into separate files because
certctl only hashes the first certificate found in the file.
This is already a bit problematic for ca_root_nss having a
larage number of files in it...  And against all odds the
first certificate I wrote for our bundle is blacklisted by
FreeBSD which made certctl discard all OPNsense authorities
added from the GUI.

To avoid further issues with certclt as a broker here I have
added it in passthru() mode to see eventual errors clearly.

Now when certcl is done all the files are linked in the
/etc/ssl/certs directory but we actually have to build the
full bundle for compatibility with old ports requiring one
of the locations that ca_root_nss ETCSYMLINK option provides.

A shortcoming of certctl is the lack of a bundle mode for
compatibility's sake which is causing a number of problems in
the ports tree at the moment (which is why we do this work now
and take a closer look before this is rolled out in full in
FreeBSD ports).

The bundle is created by iterating over all files in /etc/ssl/certs
and putting them in the expected locations.  One caveat is that
this bloats the bundles to 1.5MB from previously 750KB.  The whole
process is a lot slower, especially certctl doing the rehash.

Long story short: this is going to cause issues in the long run,
but for now we know how it is supposed to work and are ready
for FreeBSD ports to drop support for bundles in individual ports.
But that being said we will probably drag the bundles on for
a few years anyway.
2023-10-10 08:53:46 +02:00
Franco Fichtner
f4a37d9455 interfaces: prevent sleep on pending development release
This can slow down reconfiguration of a system with many
VLAN children on a single interface down/up.  We likely
have to refactor rc.linkup to coalesce the interface
reload into a safer reload facility.
2023-10-09 19:16:39 +02:00
Franco Fichtner
6657404d93 interfaces: prevent array data from being passed 2023-10-09 12:12:03 +02:00
Franco Fichtner
4fff50b4aa interfaces: fix warning, variable not assigned 2023-10-09 11:55:11 +02:00
Franco Fichtner
fb336e334a interfaces: DAD sleep on $reload; closes #6913
This is called through rc.linkup exhibiting the issue.
Sidestep the complexity of the situation by fixing the
issue first making it testable and easy to ship in a
stable relese.

For anyone not liking this net.inet6.ip6.dad_count can
be set to "0" to disable the sleep behaviour.  This
needs to be extended one way or another.  More soon.
2023-10-09 11:47:53 +02:00
Ad Schellevis
70df688a9b VPN: WireGuard - hook wireguard empty devices during bootup, using wireguard_devices() plugin system. This should make sure services and components, such as the firewall, are able to use the device before being setup. closes https://github.com/opnsense/core/issues/6909
A minor modification was needed in wg-service-control.php to make sure a configure would be executed if wgX exists without configuration
2023-10-04 18:13:15 +02:00
Franco Fichtner
0942687097 system: fix monitor services disappearing after 1c890b8cce666 2023-10-04 07:26:02 +02:00
Franco Fichtner
1fe5395d6a system: refactor dpinger_status() 2023-10-03 21:46:51 +02:00
Franco Fichtner
c7320df459 system: fix former mishap, better to copy required values for later 2023-10-03 16:29:26 +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
Csaba Kos
1f3311f5dd interfaces: allow multiple IP addresses in dhcp reject from; closes #6683 2023-09-30 13:34:28 +02:00
Franco Fichtner
871182c4f2 wireguard: merge net/wireguard as of version 2.2 #6827
Omit the dependency on wireguard-kmod as we will be targeting the kernel
module with 24.1.  Some people may run into this but it's safer than
trying to rely on a package that won't be available going from 23.7 to
24.1.
2023-09-29 08:32:12 +02:00
Franco Fichtner
40955ddaee dhcp: looks like a refactor gone wrong #6853 2023-09-28 17:42:24 +02:00
Stephan de Wit
7a2f3f62d9 interfaces: drop PPP default route handling
the relevant route is configured later in the chain using getDefaultGW(),
no need to instruct mpd5 to set it for us.
2023-09-27 15:59:17 +02:00
Franco Fichtner
7e3c63a3ab firewall: do not reference automatic rule that is hardcoded 2023-09-27 14:01:49 +02:00
Franco Fichtner
d9fcc0bbbf firewall: wrong link to VIP page 2023-09-26 08:41:16 +02:00
Franco Fichtner
f63fd66472 interfaces: for consistency bootstrap the implicit 'none' value 2023-09-25 09:09:25 +02:00
Franco Fichtner
0bd1280a45 interfaces: prevent reading config.xml garbage
The no prefix is only applicable when 'dhcp6' IPv6 mode is set.

PR: https://forum.opnsense.org/index.php?topic=35848.0
2023-09-24 20:54:31 +02:00
Franco Fichtner
7fcbb22094 dhcp: merge_ipv6_address() was too intrusive
Testing 3582242d0fe10 it appeared that link-local addresses were
rewritten as GUAs in the dhcpd configuration.  The static map part
does this right, but all the other callers are not.  Flip this
around as it was intended.  The DHCPv6 page will now throw an out
of range error when it previously adjusted the explit prefix anyway.

dhcpd config with link local seems fine too, but more testing is
always good.
2023-09-22 14:22:56 +02:00
Franco Fichtner
2d36853da4 interfaces: add interface return feature for use on bridges/assignment page 2023-09-22 09:49:00 +02:00
Daggolin
79355e3641
system: start gateway monitors after firewall rules are in place (#6874)
During bootup the gateway monitors were started before the firewall rules
were finished setting up. Under some circumstances this could lead to
incorrect data being reported by dpinger instances.
2023-09-21 14:38:23 +02:00
Alejandro Criado-Pérez
e25ef6774b
Corrected some typos (#6778) 2023-09-20 13:44:39 +02:00
Franco Fichtner
9c1342dac9 interfaces: missing default returns (although the same) 2023-09-20 09:20:55 +02:00
Franco Fichtner
29d5a1b129 interfaces: style update 2023-09-19 08:06:56 +02:00
Franco Fichtner
2a6845a6fb interfaces: tried keys before but list() is too dense 2023-09-18 10:52:40 +02:00
Franco Fichtner
db5c43d106 interfaces: allow clean MVC acces to primary address
POC for IPv4.  Acme-client is being naughtly.
2023-09-18 10:18:34 +02:00
Franco Fichtner
6a4d6a6f5a interfaces: sync up gre code with IPv6 changes in gif
And fix a typo in previous gif code and restructure slightly.
2023-09-18 09:47:22 +02:00
Franco Fichtner
a10c1b5a36 system: remove unused 2023-09-18 09:32:13 +02:00
Franco Fichtner
2f3dd72d77 interfaces: change "realifxyz" vars to more sensible names 2023-09-18 09:32:01 +02:00
Franco Fichtner
2340751540 interfaces: special treatment of IPv6 remote address cases
PR: https://forum.opnsense.org/index.php?topic=35876.0
2023-09-18 08:47:13 +02:00
Franco Fichtner
cbaf7cee1f interfaces: use interfaces_restart_by_device() where appropriate 2023-09-15 14:50:23 +02:00
Franco Fichtner
6ea9d216e2 interfaces: 0e2751d2d means default gateway switching no longer requires this #6852
The change is not immediate but the watcher will take care of it.
2023-09-15 14:23:21 +02:00
Franco Fichtner
22a2cc9836 system: clear a few legacy DynDNS leftovers 2023-09-15 13:21:49 +02:00
Franco Fichtner
496c1c787d openvpn: emit device name upon creation 2023-09-15 08:50:39 +02:00
Franco Fichtner
fa1efd0506 interfaces: signal wlan device creation success/failure 2023-09-15 08:46:20 +02:00
Franco Fichtner
a086f40b0a unbound: bring back 4a1bc9f8b5e to avoid dynamic reloads when possible; closes #6802 2023-09-14 14:00:29 +02:00
Franco Fichtner
2306449329 interfaces: fix typo 2023-09-13 13:00:47 +02:00