Skip to content

Implement subnet support for clients - #708

Merged
DL6ER merged 7 commits into
release/v5.0from
new/CIDR_clients
Mar 28, 2020
Merged

Implement subnet support for clients#708
DL6ER merged 7 commits into
release/v5.0from
new/CIDR_clients

Conversation

@DL6ER

@DL6ER DL6ER commented Mar 4, 2020

Copy link
Copy Markdown
Member

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?:

10


This PR implements subnet support for clients. Previously, only exact client / group associations have been possible, like 192.168.0.1. This PR allows for arbitrarily complex subnet configurations using the widely known Classless Inter-Domain Routing (CIDR) notation.

This allows users to specify "broad clients" such as

  • 192.168.1.0/24 which will match al clients in the range 192.168.1.1 to 192.168.1.255 (256 devices),
  • 10.8.0.0/16 will match all clients in the range 10.8.0.1 to 10.8.255.255 (65,536 devices),
  • 192.168.100.0/22 represents the 1024 IPv4 addresses from 192.168.100.0 to 192.168.103.255.

This implementation is IPv6-aware and can be used for IPv6 subnets as well, such as the IPv6 block 2001:db8::/48 representing the block of IPv6 addresses from 2001:db8:0:0:0:0:0:0 to 2001:db8:0:ffff:ffff:ffff:ffff:ffff (1,208,925,819,614,629,174,706,176 devices).

Our implementation is more generic than what is written on the linked Wikipedia article as you can use any CIDR block (not only multiples of 4).

DL6ER added 5 commits March 3, 2020 23:35
…t may use Classless Inter-Domain Routing (CIDR) notation. This is also known as variable-length subnet masking (VLSM) technique.

Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…dition.

Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER added this to the v5.0 milestone Mar 4, 2020
@pralor-bot

Copy link
Copy Markdown

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/subnetting-doesnt-appear-to-work-for-groups/28813/25

@DL6ER
DL6ER marked this pull request as ready for review March 24, 2020 13:06
… enabled.

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER
DL6ER requested a review from a team March 25, 2020 09:48
Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER
DL6ER merged commit f9476dd into release/v5.0 Mar 28, 2020
@DL6ER
DL6ER deleted the new/CIDR_clients branch March 28, 2020 14:02
@pralor-bot

Copy link
Copy Markdown

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/netzwerk-in-clientliste-hinzufugen/34779/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants