12603 Commits

Author SHA1 Message Date
Franco Fichtner
d4f4b48b06 system: prefer address family earlier on boot
Looking for things that could go wrong with root.key in Unbound
this could be one of those.  Still, at this point we may not have
received DNS servers from the ISP since these are registered much
later (10-newwanip).

Great opportunity to ditch prefer_ipv4_or_ipv6() since we need it
for resolving which we set up alongside and in the right spot.
2022-03-11 11:18:04 +01:00
Franco Fichtner
6446a4ccfa interfaces: ifctl link for nameserver.sh
Not sure about nameserver.sh name and scope yet so try to
hide it under a link.  We can always change the name later
although having .sh suffix helps us lint the script more easily.
2022-03-11 10:50:04 +01:00
Franco Fichtner
321f3101d9 system: configd_ctl.py should be same as configctl
Historically both make sense but nothing calls configd_ctl.py
directly anymore so we can either leave it at that or merge
the code and behaviour into configctl.  (Or better yet set a
symlink to configctl).
2022-03-11 10:31:59 +01:00
Franco Fichtner
e6d2cbef47 interfaces: same for lagg here 2022-03-11 10:11:50 +01:00
Franco Fichtner
bc7a646aef interfaces: "_" prefix means only call internally
Also now we can grep for "interfaces_vlan_configure" to see both
and "interfaces" is the actual prefix to be used from interfaces.inc.

Later we should try to avoid calling "_" prefix functions from code
not in interfaces.inc.
2022-03-11 09:09:54 +01:00
Franco Fichtner
c474bb3e62 Revert "interfaces: issues with assigned gif/gre tunnels #5540"
This reverts commit a7b446f6d3e676cd5b94aa916ceefdf631facbfc.

Overly cautious:  the code still handles this by reloading a
GIF/GRE/bridge internally.
2022-03-11 08:48:56 +01:00
Franco Fichtner
a7b446f6d3 interfaces: issues with assigned gif/gre tunnels #5540
We still need this code because the current logic of resolving
dependencies is flawed.  At least we do not start GIF/GRE more
than twice now.
2022-03-11 08:14:07 +01:00
Franco Fichtner
3cdfbfac26 interfaces: fix typos and tweak after testing 2022-03-10 09:49:19 +01:00
Franco Fichtner
b9bca80d6d interfaces: clean up this portion
Cite the manual page on the MTU requirement of (additional) interfaces.
This isn't the first time we add to a bridge since we make sure that
both interfaces exist which can only happen at the end of the boot sequence.

Speed up the reading of ifconfig values by only obtaining it once.
2022-03-10 09:34:05 +01:00
Franco Fichtner
68454bd30c src: style sweep 2022-03-10 08:38:04 +01:00
Franco Fichtner
e00a9a2031 dhcp: use opnsense-log -n for prefix reads 2022-03-10 08:32:17 +01:00
Franco Fichtner
32fe53a228 system: try to hide "latest.log" magic in this utility 2022-03-09 11:00:19 +01:00
Ad Schellevis
71a8da452c DHCPDv6: stream read log and leases files for "dhcpd update prefixes" action, see https://forum.opnsense.org/index.php?topic=27319.msg132541#msg132541 2022-03-04 19:42:48 +01:00
Ad Schellevis
c5c1ed9121 Filter - rules: constrain default carp allow rules to those defined in rfc5798, closes https://github.com/opnsense/core/issues/5613 2022-03-03 16:07:15 +01:00
Franco Fichtner
f064082abc ipsec: fix mobile switch logic
PR: https://forum.opnsense.org/index.php?topic=27291.0
2022-03-03 08:11:10 +01:00
Franco Fichtner
901523cb01 interfaces: special gif handling for MTU is long gone
According to history at one point around 2011 FreeBSD removed
a special feature from GIF being able to attach to a bridge
with a lower MTU but althoug those times are long gone and
efforts to retain a patch in project history have made this
silly code stick around for over a decade when the better half
of this decade this didn't work and also nobody reported it.
2022-03-02 14:41:29 +01:00
Franco Fichtner
6dc225f564 src: style sweep 2022-03-02 14:27:26 +01:00
Ad Schellevis
99aacf7326
Interfaces: Other Types: VLAN - Add stacked VLAN support (IEEE 802.1ad / QinQ) (#5607)
* Interfaces: Other Types: VLAN - Add stacked VLAN support (IEEE 802.1ad / QinQ) for https://github.com/opnsense/core/issues/5560

This commit adds QinQ to the new VLAN MVC implementation.

o Implement new interface nameing, vlan_XXX for vlans and qinq_XXX for QinQ interfaces, to keep the names static its much easier to cope with changes.
o For backwards compatibilty keep existing interface naming for old entries.
o interfaces_vlan_configure() is only called during bootup and should enforce proper ordering in device creation (vlans first stacked later)
o interface_vlan_configure() remove pcp tricker around 0 as the model will enforce zero's anyway
o lock vlan when being used in QinQ interfaces
2022-03-02 13:55:23 +01:00
Franco Fichtner
21643101eb interfaces: annotate device dependency issue #5540
The scope for this is larger (VLAN/QinQ/LAGG) so here we just try
to raise awareness for future refactor if other device types.
2022-03-02 11:00:06 +01:00
Franco Fichtner
1bec5fad0f firmware: update work in progress for upgrade handling
We can now safely check packages kernel and base set version from
opnsense-update.  The basic idea is still that a packages set marker
is included now so we can refrain from updating packages once we
are crossing over a major version barrier using said packages set.
2022-03-02 09:30:03 +01:00
Ad Schellevis
8100e506bf Services -> Intrusion Detection -> Administration - Alerts: use standard bootgrid header and extend on initial load. Without the header, the row count will be off (which seems to be difficult to fix in bootgrid). see https://forum.opnsense.org/index.php?topic=23847.msg132089#msg132089 2022-03-01 11:05:23 +01:00
Franco Fichtner
cdd35ab6cb Firmware: make the connectivity audit more robust
Change the ping to size 1500 to emulate a typical download
scenario.  Sometimes small pings will respond but not the
larger fetch.

Secondly, do a separate IPv4 and IPv6 update of the repository
depending on whether we got a corresponding address from the
host.  It should clear up the question if IPv4 or IPv6 or both
is broken/defunct/disabled.
2022-03-01 08:52:08 +01:00
Franco Fichtner
9eaa897ed1 firmware: emit changelog URL for testing 2022-03-01 08:47:38 +01:00
Ad Schellevis
f18ae14f98 VPN / IPsec - change "My Certificate Authority" to "Remote Certificate Authority" in phase 1 as this points to the right end of the tunnel. discussed in https://github.com/opnsense/core/issues/5241 2022-02-28 09:29:46 +01:00
Franco Fichtner
47fd2ea202 system: remove comment for code no longer in place 2022-02-28 08:21:48 +01:00
Ad Schellevis
c3bae88bf5 VPN / IPsec - cleanup non existing ca files. closes https://github.com/opnsense/core/issues/5600
Although in theory this might remove manual added files, we don't officially support manual overwrites here and expect the user to add certificates in our store.
While here cleanup a bit of ipsec_configure_do() for readability
2022-02-25 22:33:14 +01:00
Franco Fichtner
684dd040d1 interfaces: for naming consistency use v6 suffix for PD hint
We may want to add more files to nameserver.sh later.
2022-02-25 10:56:26 +01:00
Franco Fichtner
b8bdb8deb7 interfaces: add proper argument parsing, simplify invokes #5565 2022-02-25 10:49:51 +01:00
Franco Fichtner
bf484cbcf2 firmware: check repository and plugin state in health audit
More often than not this is useful to know.
2022-02-25 08:24:49 +01:00
Ad Schellevis
87f0302e79 VPN / IPsec - mobile property passing in phase 2, make sure we can add a mobile phase 2 again, at some point we should remove the phase 2 mobile attribute for being a copy of its parent. for https://github.com/opnsense/core/issues/5598 2022-02-24 15:36:07 +01:00
Franco Fichtner
652ae0881c interfaces: add nameserver script to contain the situation #5565
Routes only get added in system_resolvconf_generate() now where
the DNS override is properly checked.  The nameservers are added
through the new script for convenience and removed from there as
well.  As a bonus we still scrub the routes from the nameserver
file removal to avoid creating "state" about what was done elsewhere.

This is still subject to a lot of funky races for overlapping host
routes either by ISP, manual DNS, gateway monitors or static routes.
2022-02-24 15:00:05 +01:00
Franco Fichtner
51bdcb64ac system: import ZFS pools before mounting ZFS datasets
PR: https://forum.opnsense.org/index.php?topic=26918.0
2022-02-24 12:25:31 +01:00
Franco Fichtner
1eedeb9d34 system: write config.xml sample value like GUI #5565 2022-02-24 11:18:50 +01:00
Franco Fichtner
56ed6eb633 system: simplify this code #5565 2022-02-24 11:13:19 +01:00
Franco Fichtner
0390f486c5 dhcp: splitting hairs on implementation
Try to grab all info from interfaces_primary_address() that we can
and extract subnet later as a single value.
2022-02-24 09:20:06 +01:00
Franco Fichtner
3e528e8431 console: improve kernel messaging during port assignment
We removed other console mute situations and we might as well also
remove the one that is during early boot for the simple fact that
it's probably going to be unmuted anyway.
2022-02-24 08:52:50 +01:00
Ad Schellevis
0b09bee3e5 VPN: OpenVPN: Servers - when using topology mode determination of the gateway isn't reliable. With 0ad3ec432f we tried to calculate the next address, which unfortunately is our local address in quite some cases.
ovpns1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
	description: OpenVPN
	options=80000<LINKSTATE>
	inet 10.0.8.1 --> 10.0.8.2 netmask 0xffffff00

Calculation using 10.0.8.1/24 will result in 10.0.8.1, but should have been 10.0.8.2

This patch seems to add the least amount of magic, if the correct gateway would be captured in the environment variables that would be preferable, unfortunately that doesn't seem to be the case.

Example environment output:

xormask_1=
daemon_start_time=1645634011
daemon_pid=569
tun_mtu=1500
proto_1=udp4
daemon=1
dev_type=tun
script_context=init
PWD=/usr/local/www
xormasklen_1=0
daemon_log_redirect=0
ifconfig_local=10.0.8.1
local_port_1=1194
dev=ovpns1
link_mtu=1621
remote_port_1=1194
script_type=up
ifconfig_netmask=255.255.255.0
xormethod_1=0
config=/var/etc/openvpn/server1.conf
verb=3
2022-02-23 17:55:32 +01:00
Ad Schellevis
f110c988d4 MVC - refactor and extend HostnameField and add some options to validate partial hostnames and root zones. also needed for https://github.com/opnsense/plugins/issues/2849
o HostWildcardAllowed - allow the use of "*" (any host)
o FqdnWildcardAllowed - allow the use of wilcard fqdn's (*.my.top.level)
o ZoneRootAllowed - allow the use of "@" (zone root)
2022-02-23 13:56:44 +01:00
Ad Schellevis
463696a23d Interfaces: Other Types: VLAN - refactor to MVC framework in preparation for https://github.com/opnsense/core/issues/5560
o wrap vlan set pcp in new function legacy_vlan_pcp()
o add legacy_vlan_remove_tag() to detach our vlan
o use legacy_vlan_remove_tag() + legacy_vlan_tag() to update vlan interfaces, in which case configuration remains as it was which would make future modifications which don't rely on "logical" names easier.
2022-02-23 11:54:44 +01:00
kulikov-a
5959a23c79
firewall / logging - exclude localhost stateless traffic(#5595) 2022-02-23 10:37:11 +01:00
Ad Schellevis
99c70a538a Firewall: Aliases - when using port type aliases the "enable" flag was ignored. closes https://github.com/opnsense/core/issues/5594
missed the rule part preventing empty port tables from being used in previous commit
2022-02-23 10:34:49 +01:00
Franco Fichtner
61445fc13d src: style issue with $((...)) use 2022-02-23 10:23:28 +01:00
Ad Schellevis
88837ed4b9 Firewall: Aliases - when using port type aliases the "enable" flag was ignored. closes https://github.com/opnsense/core/issues/5594 2022-02-22 18:55:17 +01:00
Franco Fichtner
8c7873e3ec interfaces: fix issue with empty description 2022-02-22 20:10:36 +01:00
Franco Fichtner
3900d7a5fc interfaces: style sweep 2022-02-22 20:10:31 +01:00
Ad Schellevis
88c27bfe4c Interfaces: Other Types: VLAN - refactor to MVC framework detaching configuration using configd while. In preparation for https://github.com/opnsense/core/issues/5560 2022-02-22 15:58:25 +01:00
Ad Schellevis
892ab932a6 interfaces - legacy_interfaces_details() add vlan parsing 2022-02-22 15:58:25 +01:00
Franco Fichtner
cd3758682c system: the all group disappeared in 2015 via a66c7889c7f
This code wasn't doing anything.
2022-02-22 12:52:01 +01:00
Franco Fichtner
dd4512aa3e system: support qat and multiple selection #5559 2022-02-22 09:14:22 +01:00
Franco Fichtner
db686a857b system: aesni is now a kernel-builtin #5559
Remove modules that are no longer available.
2022-02-22 08:47:09 +01:00