472 Commits

Author SHA1 Message Date
Franco Fichtner
7fa6fbbc5d system: wording on previous 2023-01-20 14:43:02 +01:00
Franco Fichtner
a230326d7f system: prevent removing host routes in edge case; closes #6244 2023-01-20 14:24:46 +01:00
Franco Fichtner
b2d9eb2e36 system: fix undefined var edge case 2023-01-20 14:24:46 +01:00
Franco Fichtner
e01c506cc4 system: do the same here
The async case yields to the GUI page rendering so do not
modify it.
2022-12-14 08:57:00 +01:00
Franco Fichtner
c1347533c1 system: typo 2022-11-14 14:45:23 +01:00
Franco Fichtner
39f8a1b6b1 system: simplify slightly #5989
In theory we should be able to move the host routes for 6rd and 6to4
easily without repercussion, unless some part of the system tries to
reload the interface without calling system_routing_configure().
2022-11-11 15:54:43 +02:00
Franco Fichtner
a61afc7f46 system: inline system_staticroute_configure() #5989
Only used once.
2022-11-11 12:04:32 +02:00
Franco Fichtner
9c647131eb system: prevent directly-connected host routes last minute #5989
They are not necessary.
2022-11-11 11:41:58 +02:00
Franco Fichtner
f93c287472 system: collect all host routes in a single run #5989
If this works we can use it to also generate the host routes during
the routing table reconfiguration.
2022-11-11 10:46:21 +02:00
Franco Fichtner
1472df66fb src: strip LOG_NOTICE from log_msg() #6115
It's the default and very likely not going to change.
2022-11-06 08:50:01 +01:00
Franco Fichtner
92157332e0 inc: replace a bit of log_error #6115 2022-11-04 11:57:07 +01:00
Franco Fichtner
a7fd4381a2 system: log_msg for routing #6115 2022-11-04 10:42:36 +01:00
Franco Fichtner
2b3c783208 system: use service_log() #6099 2022-10-20 17:46:18 +02:00
Franco Fichtner
26ccc7839f system: remove _defaultgw(v6) file handling; closes #5900
Try to avoid touching default routes in dhclient-script which we
already partially do now.  PPPoE linkdown certainly doesn't need
to handle the file as well to remove the default route then.
2022-10-06 09:29:12 +02:00
Franco Fichtner
58f81a2064 firmware: clear license file if no subscription key is set
Tweak the external wording and position.  Seems convenient to
append to version, but ideally we add dynamic elements to the
bottom.
2022-09-29 08:39:50 +02:00
Franco Fichtner
42caf521af system: 'host' shall not be empty 2022-09-07 08:21:45 +02:00
Franco Fichtner
041e92a320 system: resolv.conf search is FQDN #5862 2022-08-23 08:30:47 +02:00
Franco Fichtner
20a60050ee system: run monitor reload inside system_routing_configure() #5956
Some call flows require this, others don't and on 22.7 we seem to miss
one that did.  Instead of adding more monitor reloads in the possible
spots move the ones that are shared into the general routing reload since
the two are almost always clustered together.

Also use the $interface argument to figure out which monitors require
reloading.  This will avoid quite a few spurious reloads on larger
setups.

Boot is a little special, but easy enough to ensure we don't call monitor
reload twice.
2022-08-19 11:03:31 +02:00
Franco Fichtner
d2e7cbade5 system: improve debugging capability of dns static routes
We are progressing steadly here, but now we need more visibility
of the sources of DNS routes to summarize servers and sources.

Also try not to deduplicate routes prematurely so that dynamic
hosts get priority over config-based ones like the override
setting actually implies as currently the last one won.
2022-08-18 08:44:44 +02:00
Franco Fichtner
29e6e12d7c system: deal with ifctl internals for now #5933
Later we want ifctl to add the scope to the link-local gateway
by default which will remove a more code, but for now we are
bound to undo the internal magic.

Interface name stops with first ":" or last "_".  For the exclude
check use the correct array index, not the array itself.
2022-08-17 07:37:56 +02:00
Franco Fichtner
72b04f0904 interfaces: fix interface name split for ifctl; closes #5929
Weird stuff such as "wififoo_wlan0" is now properly handled.
2022-08-12 12:07:42 +02:00
Franco Fichtner
e76f15c357 system: refactor logic and populate hosts file a bit more
Already noticed that "ipsec" devices were throwing wrenches into
the engine here so try to match exactly on the pseudo-interface
names given by the GUI.
2022-08-03 09:06:20 +02:00
Franco Fichtner
7aaa6a263b system: do not reload unbound/dnsmasq "hosts" by default
Number of people noted spurious restarts of Unbound and this seems
to be the cause.  However, the real cause of hammering rc.newwanip
is in 797c18641944 and to avoid other side effects like the GIF/GRE
stuff we should consider reverting part of it.
2022-08-02 08:22:26 +02:00
Franco Fichtner
6ec65f7407 system: treat files with newlines #5900 2022-07-28 10:08:06 +02:00
Franco Fichtner
d7b3d61510 system: ensure that _defaultgw files are written #5900
Ok so this might have been an issue in the past WRT DHCP client
and default route hanling which is now done another way but maybe
it shouldn't have.  For now just see how this works in practice
and then decide later if more needs to be done or not.
2022-07-28 10:00:05 +02:00
Franco Fichtner
90db8f4d0f interfaces: widen and improve ifctl use
We do want to eventually lean on exclusive ifctl use in order to
be able to improve logic in ifctl or make adjustments really easy in
the future without missing a spot (e.g. adding scope to link-local
routers).
2022-07-22 10:54:55 +02:00
Ad Schellevis
4e9baba4d0 System: Routes: Configuration - disable flag not removing static route. closes https://github.com/opnsense/core/issues/5887
looks like a regression in 52d3e7c676, after which delete doesn't seem to execute a valid route command.
2022-07-18 20:25:56 +02:00
Franco Fichtner
a1b63db4b0 system: Italian is now a release language 2022-07-11 14:14:26 +02:00
Franco Fichtner
bec615f6f7 system: possible undefined read 2022-06-15 07:50:54 +02:00
Franco Fichtner
aa64571116 system: more comments on get_nameservers() 2022-03-29 09:19:12 +02:00
Franco Fichtner
383561b6f1 system: simplify previous a bit
We can set gateway to null as it is ignored when setting host
route.  Also adhere to logic for interface selection in both
DNS modes, but only exclude from configuration list for dynamic
ones.

For the time being we don't need static/dymanic annotation
as the system doesn't care by design and we don't filter it
anywhere else.  Might be something for the status page, but
that's a larger change to level expectations vs. dyamic
connectivity properties.

A couple of style issues here and there as well.
2022-03-28 11:59:31 +02:00
Stephan de Wit
8d3584be16 get_nameservers(): also return manual dns entries to simplify code elsewhere 2022-03-28 09:25:25 +02:00
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
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
56ed6eb633 system: simplify this code #5565 2022-02-24 11:13:19 +01:00
Franco Fichtner
dd4512aa3e system: support qat and multiple selection #5559 2022-02-22 09:14:22 +01:00
Franco Fichtner
789b777d46 system: try to boot without kernel message mute relics
They don't seem to work in some cases and aren't used a lot.
2022-02-15 09:48:48 +01:00
Franco Fichtner
fc51b1541a system: technically correct but reads strange #5493 2022-02-03 07:56:13 +01:00
Franco Fichtner
f6551c982d system: complete the log message #5493 2022-02-03 07:54:42 +01:00
Franco Fichtner
7fa1f8b8be system: only log on automatic far gateway detect #5493 2022-02-03 07:52:09 +01:00
Franco Fichtner
00a86f74db interfaces: shorten list() action where we can 2022-02-02 22:58:39 +01:00
Franco Fichtner
9486473b2f system: minimal approach to #5493
A little worried runtime configuration might not
be available making a set route not work.
2022-02-02 10:29:03 +01:00
Franco Fichtner
9cf2b221d8 system: detect far gateway situation for #5493
The far gateway flag has some benefits for configuration runs
and validation purposes on the GUI but in the end after lots
of reworks we are able to reliably get a network from the interface
to put the default route on so that we can detect if we are in
need of a far gateway or not.  This is required for automatic
gateways on DHCP that hand out these situations while the
gateway code should not be in charge of flipping on the fargw
bit as it does pertain to runtime interface configuration.

Leave the fargw configuration flag in place for now to let people
test this, maybe backport it earlier and look at fargw more
closely in the remaining use case(s).
2022-02-02 10:12:24 +01:00
Franco Fichtner
7d52700da2 system: forgot to scrub required => false 2022-02-01 12:42:12 +01:00
Franco Fichtner
41ab7fb9f5 system: several improvements to tunables; closes #5504
o Merge defaults and requirements.
o Get rid of get_default_sysctl_value().
o Manually set 'type' for e.g. boot enviroment tunables.
o Cache sysctl map once per boot.
o Edit system defaults for easier override.

While sysctls might change when (un)loading kernel modules the
risk of missing something vital is not given.  We could always
flush the cache file in that case later.
2022-02-01 12:23:00 +01:00
Ad Schellevis
52d3e7c676 system: routes: configuration - changing interface gateway will be ignored as the delete/add combination adds the new gateway in it's delete action.
Looks like a very old regression in ab1cadea90 replacing "route change" to the combo we use today.

Eventually we should parse the routing table (https://github.com/opnsense/core/issues/5304) and persist the requested state, but short term it probably makes more sense to fix the "route delete" action, so we can close https://github.com/opnsense/core/issues/5520
2022-01-28 21:02:23 +01:00
Pierre Fèvre
981373b4cd system: allow additional search domain; closes #5102 2022-01-17 17:35:05 +01:00
Ad Schellevis
62f1a9d811 Refactor web application security measures, closes https://github.com/opnsense/core/issues/5481 2022-01-17 17:15:14 +01:00
Franco Fichtner
21fe4db493 system: shared forwarding to #5467 2022-01-17 15:46:35 +01:00
Franco Fichtner
aa2625998d system: cache obfuscated version info from syslog-ng binary #5371
It changes with each build since it has a rebuild date but most
of the time it is not being reinstalled.  Besides this helps testing
and is relatively portable since we don't rely on the actual content.
2022-01-17 13:45:37 +01:00