Services: ISC DHCPv6 - show "tracking" interfaces when enabled and offer an explicit disable#8576
Conversation
…er an explicit disable option for the service in question so someone could use dnsmasq or kea instead. To avoid large changes, we opt for a minimal set here. In services_dhcpv6.php, we add a separate form and handler in case tracking (without dhcpd6track6allowoverride) is set, which either flushes the unused isc-dhcpv6 server configuration when enabled (default) or writes a small section only including ['enabled' => -1]. For visibility, we show the calculated range as would be set by dhcpd_dhcp6_configure() when tracking is used. The backend code then double checks the services which er explicitly disabled (-1) and skip processing for these (not enabled). In order to make people aware of the fact that an isc-dhcpv6 server could be running, make sure the menu system also reflects reality. Since router advertisements are stored within the same container and will need a toggle as well, keep the value of ramode so we have a way to intervene in a similar way as for dhcpv6. One small side affect of this commit is that it will show "Services: Router Advertisements" for the tracking interface, which we need to implement later. One of the building blocks for: #8528
56a5c7c to
03348d0
Compare
| !empty($config['interfaces'][$_GET['if']]['track6-interface']))) { | ||
| $if = $_GET['if']; | ||
| } else { | ||
| /* if no interface is provided this invoke is invalid */ |
There was a problem hiding this comment.
wouldn't remove this at first glance, the page shows garbage when invoked this way?
| **/ | ||
| if ($if === null) { | ||
| /* if no interface is provided this invoke is invalid */ | ||
| header(url_safe('Location: /index.php')); |
| $this_server['ramode'] = $dhcpdv6cfg[$if]['ramode']; | ||
| } | ||
| if (empty($_POST['enable'])) { | ||
| $this_server['enable'] = '-1'; |
There was a problem hiding this comment.
the downside of this is when the interface is switched to static the value will be '' or '0' again and it re-enabled the auto-mode which potentially leads to more code and all the 'enable' use flags need to be checked/adjusted too empty() doesn't work anymore. Maybe you have done it, i just want to mention it here.
There was a problem hiding this comment.
I don't think the interfaces page mangles with dhcpv6 section, the only reference I could find was this one :
Lines 624 to 626 in 39d5ff1
which is merely a validation (and might need a change, but haven't looked at that yet)
There was a problem hiding this comment.
yeah stuff like that, just to keep in mind
Co-authored-by: Franco Fichtner <franco@opnsense.org>
…led an offer an explicit disable option for the service in question so someone could use dnsmasq instead. More or less the same construction as added for dhcpv6, using the ramode field to switch between types (disabled or assisted). While here, also bugfix fieldname in services_dhcpv6.php also for #8528
fichtner
left a comment
There was a problem hiding this comment.
ok, let's just see how this behaves on master
…fer an explicit disable (#8576) * Services: ISC DHCPv6 - show "tracking" interfaces when enabled an offer an explicit disable option for the service in question so someone could use dnsmasq or kea instead. To avoid large changes, we opt for a minimal set here. In services_dhcpv6.php, we add a separate form and handler in case tracking (without dhcpd6track6allowoverride) is set, which either flushes the unused isc-dhcpv6 server configuration when enabled (default) or writes a small section only including ['enabled' => -1]. For visibility, we show the calculated range as would be set by dhcpd_dhcp6_configure() when tracking is used. The backend code then double checks the services which er explicitly disabled (-1) and skip processing for these (not enabled). In order to make people aware of the fact that an isc-dhcpv6 server could be running, make sure the menu system also reflects reality. Since router advertisements are stored within the same container and will need a toggle as well, keep the value of ramode so we have a way to intervene in a similar way as for dhcpv6. One small side affect of this commit is that it will show "Services: Router Advertisements" for the tracking interface, which we need to implement later. One of the building blocks for: #8528 * Update src/www/services_dhcpv6.php Co-authored-by: Franco Fichtner <franco@opnsense.org> * Services: Router Advertisements: show "tracking" interfaces when enabled an offer an explicit disable option for the service in question so someone could use dnsmasq instead. More or less the same construction as added for dhcpv6, using the ramode field to switch between types (disabled or assisted). While here, also bugfix fieldname in services_dhcpv6.php also for #8528 --------- Co-authored-by: Franco Fichtner <franco@opnsense.org> (cherry picked from commit 727967e)
Needed in case someone would like to use dnsmasq or kea instead.
To avoid large changes, we opt for a minimal set here. In services_dhcpv6.php, we add a separate form and handler in case tracking (without dhcpd6track6allowoverride) is set, which either flushes the unused isc-dhcpv6 server configuration when enabled (default) or writes a small section only including ['enabled' => -1]. For visibility, we show the calculated range as would be set by dhcpd_dhcp6_configure() when tracking is used.
The backend code then double checks the services which er explicitly disabled (-1) and skip processing for these (not enabled).
In order to make people aware of the fact that an isc-dhcpv6 server could be running, make sure the menu system also reflects reality.
Since router advertisements are stored within the same container and will need a toggle as well, keep the value of ramode so we have a way to intervene in a similar way as for dhcpv6.
One small side affect of this commit is that it will show "Services: Router Advertisements" for the tracking interface, which we need to implement later.
One of the building blocks for: #8528