Implement DHCP Subnet Mask Configuration #5471
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theProcessDHCPSettings()
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: