104 Commits

Author SHA1 Message Date
soif
de07e8dcf1 ARP Table: hostname uses reverse DNS lookup as fallback 2022-09-12 12:30:33 +02:00
Ad Schellevis
e1d8b471d0 Interfaces/Other Types/VLAN - pass proto to vlan interface for 802.1ad (QinQ) interface types.
Currently this doesn't work (yet), likely needs https://reviews.freebsd.org/D35848 so vlanproto can be set after the interface creation phase (now it's only possible to set proto there).
If `ifconfig XXXX vlanproto 802.1ad` sets the property, we do need this code to make sure we set these on QinQ parent vlan tags. As a workaround we could pass proto in legacy_interface_create() as well to make this (only) work on boot, but looking at the upstream fix, this might be something easy to pull in the near future.

for https://github.com/opnsense/core/issues/5893
2022-09-03 15:31:25 +02:00
Ad Schellevis
d8bf03d2e9 Interfaces/Diagnostics/Packet Capture - replace legacy version with new mvc variant. closes ehttps://github.com/opnsense/core/issues/5981 2022-08-30 17:35:45 +02:00
Ad Schellevis
4070ad0e2e Interfaces/Diagnostics/Packet Capture - work in progress for https://github.com/opnsense/core/issues/5981
o host field logic validator
o add remove job action
o add view action (initial version)
2022-08-29 21:16:49 +02:00
Ad Schellevis
21232cc4bd Interfaces/Diagnostics/Packet Capture - boilerplace for https://github.com/opnsense/core/issues/5981
o add basic workflow (start/stop/list)
o basic configd actions + implementation in capture.py script
o grid without actions to show current capture jobs
2022-08-28 15:45:42 +02:00
Ad Schellevis
bf11949841 Interfaces/Diagnostics/Packet Capture - boilerplace for https://github.com/opnsense/core/issues/5981 2022-08-27 16:16:45 +02:00
Franco Fichtner
61dd38ce2e interfaces: null route for delegated prefix #3304
It's still debatable if ifctl is a tool to record data
for interfaces and act on it or if the latter part should
be handled by more authorative (interface) code.

Inspired by: https://github.com/opnsense/core/pull/5992
2022-08-25 10:04:27 +02:00
Franco Fichtner
a785c129a2 interfaces: web GUI locale sorts files differently #5862
Make suffix match explicit, give it lower priority and prevent
suffix match in plain inteface match afterwards to repair the
result return logic.
2022-08-23 09:31:18 +02:00
Franco Fichtner
76278022f8 interfaces: wait for DAD to complete #5933 2022-08-16 10:40:20 +02:00
Franco Fichtner
489ae2f3c6 interfaces: DHCP is our problem child #5933 2022-08-15 13:20:41 +02:00
Franco Fichtner
e6ef454fa8 interfaces: signal address flush through rc.newwanip #5933 2022-08-15 12:14:48 +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
6043b5b125 interfaces: make rc.newwanip the same as "dns reload"... #5933
... a.k.a. rc.resolv_conf_generate.  While here protect more
code with the IP change guard and clear the IP address if the
address lookup came up empty.
2022-08-11 13:53:04 +02:00
Franco Fichtner
bb4743a732 interfaces: stop DHCP from calling rc.newwanip when no changes are being done
This is a partial revert of 797c1864194 which has good intentions but rc.newwanip(v6)
isn't equipped with being called a lot of times yet.  We want to improve this for 23.1.
2022-08-02 09:04:12 +02:00
Franco Fichtner
f9ea49ae31 interfaces: manual cache invalidate for previous
Purge the file on all known dynamic spots that run a deconfigure
of some sort.  We probably need something for a forced reload as
well but for now let's see if this works in general.
2022-08-01 13:45:18 +02:00
Franco Fichtner
ef0d238ba1 interfaces: typo in script invoke 2022-07-28 21:09:04 +02:00
Franco Fichtner
e12b4ab36e interfaces: same issue when -i not given
This is only for command line use but we never know how that
might change in the future.
2022-07-27 09:22:56 +02:00
Franco Fichtner
c4be95a387 interfaces: implement ifctl -l awareness for :slaac magic
The default listing had an issue bringing in both the dhcp6c
and the slaac files.  Now act according to what we implemented
as a fallback approach for reading data files.
2022-07-27 08:59:15 +02:00
Franco Fichtner
39283ebf7c interfaces: ifctl experiment is complete #5862
Since "nameserver.sh" was a working title for when we just wanted
to make sense of the nameserver registration mess going on this
no longer fully applies for good reasons.

Change the name to ifctl.sh for leaving syntax parsing in place
and leave the symlink in sbin/ directory.  The same works nicely
for configctl.
2022-07-26 19:57:25 +02:00
Franco Fichtner
a5c02d8ade interfaces: migrate cleanup from interface_bring_down() #5862
Since we already kill routes in nameserver registrations we can
also take on the arp/pfctl magic moving the "router" file check
to its native utility.

It's debatable if we even need the pfctl or arp flush here.

To be continued...
2022-07-26 19:53:56 +02:00
Franco Fichtner
e9298024c1 interfaces: DHCP router to ifctl #5862 2022-07-25 12:03:23 +02:00
Franco Fichtner
2e2e59c1d8 interfaces: move to :slaac suffix use, fixing in ifctl #5862
This breaks the new feature in the interim since the router file
read is not yet supposed to read :slaac counterpart since the router
file is still read manually.  Refactor to follow.
2022-07-25 09:57:41 +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
Maurice Walker
d582435b4b interfaces: add support for SLAAC WAN interfaces w/o DHCPv6 #5862; closes #5883
New script to be invoked by rtsold when Router Advertisements with
RDNSS / DNSSL information are received. Uses ifctl to create the
/tmp/$if_routerv6 file and creates the /tmp/$if_defaultgwv6 file
directly. Fixes the issue that these files don't get created when
the M and O flags in RAs are not set. Also, passes RDNSS / DNSSL
info from RAs to ifctl.
2022-07-22 09:20:12 +02:00
Josh Soref
20a3c3da38
Spelling (#5885) 2022-07-18 13:59:03 +02:00
Franco Fichtner
20ae548f62 interfaces: more PPP changes for ifctl ##5565 2022-03-22 08:02:33 +01:00
Franco Fichtner
96039560ad interfaces: detach newwanip call as discussed 2022-03-18 08:28:04 +01:00
Ad Schellevis
797c186419 dhclient-script: prevent the removal of default routes as rc.newwanip is responsible for calculating the correct active default.
Ideally rc.newwanip should be as lightweight as possible, with 8c49c7bfdd in place normal execution doesn't take much time, but it likely doesn't make sense to hook gif|gre interfaces either when nothing has changed.

closes https://github.com/opnsense/core/issues/5624
2022-03-16 20:44:37 +01:00
Franco Fichtner
b07d403b9f interfaces: ifctl now lists available files for -i use 2022-03-14 08:56:57 +01:00
Franco Fichtner
c39ef68e58 interfaces: add ifctl -r and -p for router and prefix files
We add this here to ensure consistency between the functionalities
of these interface helper files.  Not all instances have been
converted, but they can be as time permits.  Tested on IPv6.

While here settle on "prefix" for pdinfo as a thing since we
renamed it already anyway.
2022-03-11 15:39:45 +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
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
b8bdb8deb7 interfaces: add proper argument parsing, simplify invokes #5565 2022-02-25 10:49:51 +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
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
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
92352ec4fa Reporting: Traffic - use async resolver to reverse lookup addresses. closes https://github.com/opnsense/core/issues/5536 2022-02-20 20:14:46 +01:00
Franco Fichtner
481c6f943f interfaces: PATH is not complete in dhclient-script
PR: https://forum.opnsense.org/index.php?topic=26995.0
2022-02-16 16:21:01 +01:00
Franco Fichtner
02dc1ebd93 interfaces: prevent DHCP from installing nameservers when not allowed
This was refactored previously and all the logic should live outside
dhclient-script but it seems it's only loosely handled over there.
For now put a check back in the old way and rework this later correctly
from the system.inc point of view: we do want to register nameserver
and searchdomain in the cache files, but should not add a route if
those are not required.  It would be helpful to show them in the overview
regardless (as for DNS servers) but with a hint that they are not being
used.

PR: https://forum.opnsense.org/index.php?topic=26765.0
2022-02-05 08:16:43 +01:00
Franco Fichtner
61720fe233 scripts: tabs vs. spaces 2022-01-11 11:22:03 +01:00
Franco Fichtner
d1f942af64 intefaces: simplify this one as well #5367 2021-11-29 10:57:45 +01:00
Franco Fichtner
6704426c19 interfaces: repair getenv() breakage in ea6b5bda52409 the right way #5367
Moral of the story: don't try to call backend scripts to grab env
variables that you could easily read using the acual nameserver
script sort of like dhclient-script is doing it.

ALLOWOVERRIDE is silly as we guard against that in get_nameservers().
2021-11-29 10:57:40 +01:00
Franco Fichtner
b28fa22d69 interfaces: nameserver can use same file format as others #5367
Also decouple searchdomain write from nameserver write in dhclient-script
and clear files properly.
2021-11-28 13:52:52 +01:00
Franco Fichtner
c6c7e9854d interfaces: searchdomain can use same file format as others #5367
Other directory was slightly confusing, other name even more so.
2021-11-28 13:42:38 +01:00
Franco Fichtner
99a0f1a164 interfaces: move nameserver files to /tmp #5367 2021-11-28 13:37:41 +01:00
Franco Fichtner
cc0b1b3be9 interfaces: move searchdomain files to /tmp #5367 2021-11-28 13:25:37 +01:00
Franco Fichtner
49210b3da8 interfaces: rc.newwanip(v6) changes related to #5367
o Only operate the /var/db IP files via rc.newwanip(v6)
o Consistenly flush a cache IP on a triggered reload
o Remove IPv6 address removal workaround from https://redmine.pfsense.org/issues/2627
o Assume that IP is properly checked making $cacheip != $ip a valid assumption when $cacheip is empty
o Remove creation from dhclient script
2021-11-27 13:54:06 +01:00
Franco Fichtner
aa6ffc501d interfaces: these ip files under /tmp are not being used #5367 2021-11-27 13:21:57 +01:00
Franco Fichtner
63f92e9d4c interfaces: remove code that appears uncessary
States are not bound to routers and -i combo doesn't seem to
work very well either.
2021-11-26 12:35:52 +01:00