Skip to content

Commit

Permalink
Interfaces - change help text to reflect reality. closes #7339
Browse files Browse the repository at this point in the history
For dhcp type interfaces, gateways are being pushed by the server and we automatically assume these are "external". For static ones you can configure similar behavior, but only explicit. When selecting a gateway, both reply-to and source nat rules are affected.
When nothing is chosen (now default, earlier "auto-detect"), normal routing rules apply and nothing special happens.
  • Loading branch information
AdSchellevis committed Mar 21, 2024
1 parent fd35aee commit ff1991c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/www/interfaces.php
Expand Up @@ -2060,7 +2060,7 @@ function toggle_wirelesscfg() {
<td><a id="help_for_gateway" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext('IPv4 Upstream Gateway') ?></td>
<td>
<select name="gateway" class="selectpicker" data-style="btn-default" data-size="10" id="gateway">
<option value="none"><?= gettext('Auto-detect') ?></option>
<option value="none"><?= gettext('Default') ?></option>
<?php
foreach ((new \OPNsense\Routing\Gateways())->gatewayIterator() as $gateway):
if ($gateway['interface'] == $if && is_ipaddrv4($gateway['gateway'])):
Expand All @@ -2074,8 +2074,8 @@ function toggle_wirelesscfg() {
?>
</select>
<div class="hidden" data-for="help_for_gateway">
<?= gettext('If this interface is a multi-WAN interface, select an existing gateway from the list. For single WAN interfaces a gateway must be ' .
'created but set to auto-detect. For a LAN a gateway is not necessary to be set up.') ?>
<?= gettext('Select a gateway from the list to reply the incoming packets to the proper next hop on their way back and apply source NAT when configured. ' .
'Usually LAN type connections leave this to default.');?>
</div>
</td>
</tr>
Expand Down Expand Up @@ -2575,7 +2575,7 @@ function toggle_wirelesscfg() {
<td><a id="help_for_gatewayv6" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv6 Upstream Gateway"); ?></td>
<td>
<select name="gatewayv6" class="selectpicker" data-size="10" data-style="btn-default" id="gatewayv6">
<option value="none"><?= gettext('Auto-detect') ?></option>
<option value="none"><?= gettext('Default') ?></option>
<?php
foreach ((new \OPNsense\Routing\Gateways())->gatewayIterator() as $gateway):
if ($gateway['interface'] == $if && is_ipaddrv6($gateway['gateway'])):
Expand All @@ -2589,8 +2589,8 @@ function toggle_wirelesscfg() {
?>
</select>
<div class="hidden" data-for="help_for_gatewayv6">
<?= gettext('If this interface is a multi-WAN interface, select an existing gateway from the list. For single WAN interfaces a gateway must be ' .
'created but set to auto-detect. For a LAN a gateway is not necessary to be set up.') ?>
<?= gettext('Select a gateway from the list to reply the incoming packets to the proper next hop on their way back. ' .
'Usually LAN type connections leave this to default.');?>
</div>
</td>
</tr>
Expand Down

6 comments on commit ff1991c

@fichtner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we’ve gone from “none” to “auto-detect” to “default”. The static case “default” still implies something else but wording really eludes the implemented behaviour. For static the wording “none” was pretty good actually. But not for anything else. And all just because outbound NAT generation is tied to this at the same time. 🤷‍♂️

@AdSchellevis
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fichtner I'm ok with none as well, auto-detect doesn't make any sense as no logic is being applied here, but I kind of assumed that was a leftover from the past (below version 22.1):

<option value="none"><?= gettext('Auto-detect') ?></option>

<option value="none"><?= gettext('Auto-detect') ?></option>

@fichtner
Copy link
Member

@fichtner fichtner commented on ff1991c Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-detect attempted to refer to the way the gateway is chosen. “None” indicated none but that wasn’t the case. As I said double meaning for one setting is problematic.

@AdSchellevis
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably lost, but the gateway setting on the interface has no role in gateway selection and is only visible for static items. The multi purpose (reply-to, source nat) is annoying, but also not solvable. But again, I don't mind if you rename it to None

@fichtner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does at the very least affect default route creation. Leaving the gateway unselected will still use it when created. Hence “auto-detect”. But then there is 3 separate uses for this one setting. ;)

@AdSchellevis
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's discuss this when you're around, according to our own documentation it does not affect default route creation for static entries (https://docs.opnsense.org/manual/gateways.html)

Please sign in to comment.