Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement DHCP Subnet Mask Configuration #5471

Closed

Conversation

biodigitalfish
Copy link

@biodigitalfish biodigitalfish commented Nov 2, 2023

This PR introduces the capability to configure the DHCP subnet mask directly from the Pi-hole admin settings. The changes include the addition of a new positional parameter in the EnableDHCP() function and an update to the ProcessDHCPSettings() function to handle the DHCP subnet mask.

I have also updated the parameter positions following the new addition. The subnet mask is now taken into account when generating the dhcp-range setting in the Pi-hole DHCP configuration.

The motivation behind this change is to provide users with the flexibility to define their subnet masks as per their network requirements, enhancing the DHCP functionality of Pi-hole.

Example: pihole on 192.168.1.10 but having a dhcp range in 192.168.4.100 -> .200. Currently the default config applies a /24 scope, which breaks client connectivity as they receive an incorrect subnet. There is no error or message to describe the intended behaviour in the webUI. This means having to go through and edit dhcp config file directly. However this gets reset each time you make a change to DHCP scope settings. So it would make the experience of managing DHCP a lot easier in these types of setups.

Corresponding Changes:
This PR is part of a set of changes, and there is a corresponding update in the pi-hole/web repository. The changes in the web repository handle the UI elements for this new configuration option. PR [#2800]


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.
  • I have read the above and my PR is ready for review. Check this box to confirm

This change adds a new argument for adding DHCP_SUBNET_MASK value when calling EnableDHCP()

This change is required along with updates to pi-hole/web settings.php, savesettings.php & func.php files to handle the additional field within DHCP settings form.

Signed-off-by: biodigitalfish <11165243+biodigitalfish@users.noreply.github.com>
@DL6ER
Copy link
Member

DL6ER commented Nov 4, 2023

Thank you very much for your PR. We are in the middle of our public Pi-hole v6.0 beta phase making it rather unlikely that there will be another regular v5.x Pi-hole release.

We nonetheless appreciate your submission and agree with the motivation so we took liberty and created a PR that will add this functionality in v6.0. See pi-hole/FTL#1731

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants