285 Commits

Author SHA1 Message Date
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
Franco Fichtner
d4db4023e6 interfaces: use get_interface_list() to identify hardware
Media settings probe is suboptimal for hardware detection and
interfaces_hardware() already uses the function to decide where
to enforce hardware settings.

PR: https://forum.opnsense.org/index.php?topic=30923.0
2022-11-22 16:42:43 +01:00
Ad Schellevis
0ae0c2fc93 Interfaces - migrate existing ppp settings on save, closes https://github.com/opnsense/core/issues/6121 2022-11-06 10:19:09 +01:00
Franco Fichtner
b1d45ab523 ui: replace log_error or remove it #6115 2022-11-04 11:53:17 +01:00
Franco Fichtner
6f91dc4683 interfaces: finish wireless/wlan rework #5987
* Devices are now configured inline or directly via pluginctl
* Try to use "wlan" underneath as shorter and upstream term
2022-08-29 07:46:31 +02:00
Franco Fichtner
b06423d342 interfaces: get_real_interface() requires internal key #5987 2022-08-26 10:01:54 +02:00
Franco Fichtner
4758c7cecf interfaces: remove interface_get_wireless_clone() #5987
Use the hardcoded _wlan0 append when we have the base interface already.
This only happens to "count" the number of existing clones.

We also get the opportunity to clean up get_real_interface() which was
a bit ironic calling interface_get_wireless_clone() three times and then
the other wireless code ignoring get_real_interface() in favour of
interface_get_wireless_clone().
2022-08-24 15:23:07 +02:00
Franco Fichtner
feb7a4615d interfaces: remove is_interface_wireless() #5987
Make the presence of <wireless/> node authoritative except
for the assignment page where we need to set this node in
the first place.

Now pivot away from a handrolled regex of devices names to
trust the output of the sysctl net.wlan.devices which is also
the prefix for our clones.
2022-08-24 14:10:28 +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
e005e0371e interfaces: revert back to orginal state #5953
interface_bring_down() takes care of this now.
2022-08-15 11:45:30 +02:00
Ad Schellevis
7bbfd981ac Interfaces : tunnel types and assigments (https://github.com/opnsense/core/issues/5953), only de-configure when an address was previously set. 2022-08-14 13:56:14 +02:00
Ad Schellevis
33d818f4cd Interfaces : tunnel types and assigments, suggestion for https://github.com/opnsense/core/issues/5953
When the interface exists and is either a ipv4  or ipv6 tunnel, prevent address removal on apply in "Interfaces: [XXX]"
2022-08-13 11:29:02 +02:00
Franco Fichtner
475cb8ec7f interfaces: deal with problematic <wireless/> handling #5939
The wireless code "integration" is horrible even by moderate standards
in our code base.  In the future the best way would be to ditch all of
it and rebuild (parts) required by users.
2022-08-11 11:16:40 +02:00
Josh Soref
20a3c3da38
Spelling (#5885) 2022-07-18 13:59:03 +02:00
Franco Fichtner
2006ead955 interfaces: small updates on previous 2022-06-28 13:40:14 +02:00
Manuel Faux
06fa8c7d2e
Wireless: Add WPA Enterprise Configuration for Infrastructure Mode (#4566)
* Wireless: Add EAP support for infrastructure mode

Add configuration for WPA2 Enterprise authentication for Wireless
infrastructure mode:

* EAP modes TLS, TTLS and PEAP
* Phase 2 modes MD5 and MSCHAPv2
* CA certificate for server verification
* Certificate for client authentication

* Wireless: dynamically show/hide relevant properties

For wireless interface configuration show/hide only currently
relevant settings to facilitate configuration.

* Show WEP settings only when WEP is enabled
* Show WPA settings only when WPA is enabled
* Show EAP settings only when EAP is enabled
* Show IEEE 802.1X settings only when relevant
* Hide AP-only/Adhoc-only settings when infrastructure mode
  is selected
2022-06-28 13:12:25 +02:00
Franco Fichtner
91b840d5d2 interfaces: inconsistencies in wireless handling #5825 2022-06-24 13:17:02 +02:00
Franco Fichtner
249afc5877 interfaces: revert futile parts of b34ba9a61f655 #5630 2022-04-27 08:38:06 +02:00
Franco Fichtner
b34ba9a61f interfaces: optional prefix tracking for WAN #5630 2022-04-04 09:12:50 +02:00
Franco Fichtner
2637e6ebca interfaces: use consistent "vlan" or "qinq" prefix, start a 0 #5560
Since we also change the vlan names here for new devices to eventually
avoid overlong vlan interface names (#3222) we need to make sure the
rest of the system knows the new prefixes.

Some related style changes in code and text.
2022-03-23 08:54:02 +01:00
Franco Fichtner
98a049a904 src: translation style issues 2022-01-03 10:29:56 +01:00
Franco Fichtner
8578bd35a6 interfaces: split get_parent_interface() into its use cases
* Make it only react to PPP related lookups, no generic fallback
* Move the VLAN portion to a simplified dedicated function
* As a placeholder we shall see if bridges and LAGGs benefit from it
2021-12-06 14:37:10 +01:00
Ad Schellevis
e6f9b9a388 Interfaces - remove validation preventing an interface to be enabled when aliases are already assigned (introduced in 62a4abc92c), there doesn't seem to be a valid reason for requiring no aliases 2021-11-23 19:20:08 +01:00
Franco Fichtner
1a100934b9 interfaces: ignore media settings if interface is not there 2021-11-22 13:02:39 +01:00
Franco Fichtner
4d38eea089 interfaces: avoid recursion by giving proper interface name
Tested both VLAN configuration spots and other callers already
look sane.
2021-11-22 11:37:34 +01:00
NOYB
14f3cb5214
Prevent Browser Auto Fill Username/Password (#5311) 2021-11-22 09:03:18 +01:00
Franco Fichtner
f68816a8c2 src: fix a couple of stray whitespace issues 2021-11-09 13:33:11 +01:00
Franco Fichtner
29bd7f49c5 interface: small cleanup for #5334 2021-11-04 10:08:24 +01:00
Ad Schellevis
0d77358c1d interfaces: VLAN spoofmac taints siblings and parent interface. closes https://github.com/opnsense/core/issues/5297
o move media detection to generic legacy_interfaces_details() parser
o hide options when not applicable (only auto-select means non physical it seems).
2021-10-24 10:39:07 +02:00
Ad Schellevis
3a75948e25 interfaces: VLAN spoofmac taints siblings and parent interface
o refactor spoofmac to apply on the actual interface at hand
o add permanent promisc setting

for https://github.com/opnsense/core/issues/5297
2021-10-23 22:35:33 +02:00
Franco Fichtner
354835abe7 interfaces: tiny cleanup 2021-07-13 12:26:35 +02:00
Ad Schellevis
a98d776fa4 Interfaces / Hardware settings - Overwite global settings, closes https://github.com/opnsense/core/issues/5050 2021-06-16 16:18:50 +02:00