# Question regarding multiple group assignments for same clients

**URL:** https://discourse.pi-hole.net/t/question-regarding-multiple-group-assignments-for-same-clients/34184
**Category:** Help
**Created:** [June 9, 2020, 11:07am UTC](https://discourse.pi-hole.net/t/question-regarding-multiple-group-assignments-for-same-clients/34184 "2020-06-09T11:07:32Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)
#### Post date: [June 9, 2020, 12:09pm UTC](https://discourse.pi-hole.net/t/question-regarding-multiple-group-assignments-for-same-clients/34184/3 "2020-06-09T12:09:34Z")

</div>

At the moment ~~both~~ the first matching will be assigned, but this behavior will change in v5.1

> [@Subnetting is not working with most relevant entry](https://discourse.pi-hole.net/t/subnetting-is-not-working-with-most-relevant-entry/31482):
>
> Problem with Beta 5.0: I have added a subnet entry for a /24 network and assigned it to group id 1. Also I have added a native Client IP-Address with /32 and assigned it to group id 0 and group id 2. The client will get the group id 1. The same behavior when adding the client with the dropdown menu. As I saw, in the selection from the database the first matching record is taken. See line 278-279 in get\_client\_groupids (gravitiy-db.c). The Select is limited to 1. Maybe there must be evalua…

> <https://github.com/pi-hole/FTL/pull/753>
>
> \*\*By submitting this pull request, I confirm the following:\*\*
> 
> \- \[X\] I have re…ad and understood the \[contributors guide\](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).
> \- \[X\] I have checked that \[another pull request\](https://github.com/pi-hole/FTL/pulls) for this purpose does not exist.
> \- \[X\] I have considered, and confirmed that this submission will be valuable to others.
> \- \[X\] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
> \- \[X\] I give this submission freely, and claim no ownership to its content.
> 
> \*\*How familiar are you with the codebase?:\*\* 
> 
> \## 10
> 
> \---
> 
> This allows to configure specific settings for a whole range of devices but still exclude others. Complain softly (no error) if multiple configured subnets match with the same number of relevant bits.
> 
> We log in case there are multiple groups defined matching equally which one FTL chose. It will deterministic chose the most matching \*last added one\*.
> 
> !\[Screenshot at 2020-05-11 20-25-22\](https://user-images.githubusercontent.com/16748619/81597148-8e180280-93c5-11ea-9a23-8d834d38fd4d.png)
> 
> resulting in the following log line (only the last line is logged in non-DEBUG mode, I kept all for illustrative proposes here):
> \`\`\`plain
> \[2020-05-11 20:26:55.425 18858\] SQL: Comparing 127.0.0.1 vs. 127.0.0.0/8 (subnet 255.0.0.0) - !! MATCH !!                                            
> \[2020-05-11 20:26:55.425 18858\] SQL: Comparing 127.0.0.1 vs. 127.0.0.0/8 (subnet 255.0.0.0) - !! MATCH !!
> \[2020-05-11 20:26:55.425 18858\] SQL: Comparing 127.0.0.1 vs. 127.0.0.1/8 (subnet 255.0.0.0) - !! MATCH !!
> \[2020-05-11 20:26:55.425 18858\] SQL: Comparing 127.0.0.1 vs. 127.0.0.1/8 (subnet 255.0.0.0) - !! MATCH !!                                                                    
> \[2020-05-11 20:26:55.425 18858\] SQL: Comparing 127.0.0.1 vs. 127.0.0.1/8 (subnet 255.0.0.0) - !! MATCH !!                                            
> \[2020-05-11 20:26:55.425 18858\] SUBNET WARNING: Client 127.0.0.1 is managed by 2 groups (IDs 1,37), all describing /8 subnets. FTL chose the most recent entry 127.0.0.1/8 (ID 37) for this client.
> \`\`\`
> 
> This will also show up on the dashboard when the new Pi-hole diagnostics system has been merged:
> !\[Screenshot\_2020-05-11 Pi-hole - ubuntu-server(1)\](https://user-images.githubusercontent.com/16748619/81597737-78570d00-93c6-11ea-9072-d5a772ec0509.png)

---

_[View the full topic](https://discourse.pi-hole.net/t/question-regarding-multiple-group-assignments-for-same-clients/34184)._
