Adding alias-clients to Pi-hole FTL

A single post is the smallest unit for splitting, there's no way to just move parts of it - thank you for reposting relevant parts back here.

1 Like

When i do:

pihole checkout new/super-clients

i get this msg [i] Requested option "new/super-clients" is not available

@Tntdruid It should be

pihole checkout ftl new/super-clients
1 Like

The tabel for

superclients

Does not get created after i did the checkout.

The table is called superclient without the trailing s, but watch my next post for further details before moving on.

Having seen @jpgpi250's interpretation of what this can be used for, I thought it may be a good idea to generalize the super-clients. So far, super-clients were set by using a MAC address as identifier. This is a limitation as you may have a device with:

  • more than one MAC address (e.g., Ethernet and WiFi interface)
  • devices without a MAC address being available (e.g., connected through VPN or on another VLAN)

So back to the drawing board!

Please first reset your database back to how it was before checking out the new/super-clients branch using:

sudo sqlite3 /etc/pihole/pihole-FTL.db "DROP TABLE superclient;"
sudo sqlite3 /etc/pihole/pihole-FTL.db "UPDATE ftl SET value = 8 WHERE id = 0;"

Then check out the latest version of this branch.

The superclient table now looks like this (hwaddr gone, id added):

ID host name comment
0 linux-box-1 (optional)

The network table - listing all devices - gets an extra column at the end: superclient_id (referencing the superclient table's IDs)

You can add a super-client ID to as many MAC addresses (may be real or mock-MAC addresses) as you like. This will give you a lot more flexibility and should work equally well.

Example:

  1. Check out the FTL branch

    pihole checkout ftl new/super-clients
    
  2. Add a new super-client

    sudo sqlite3 /etc/pihole/pihole-FTL.db
    
    INSERT INTO superclient (id,name,comment) VALUES (0,'something',NULL);
    
  3. Assign two MAC addresses to this super-client (ID = 0)

    sudo sqlite3 /etc/pihole/pihole-FTL.db
    
    UPDATE network SET superclient_id = 0 WHERE hwaddr = 'd0:50:99:33:78:33';
    
  4. Ask FTL to re-import super-clients

    sudo pkill -RTMIN+3 pihole-FTL
    
  5. See that the said client is now inside the super-client something
    Screenshot at 2020-08-12 19-59-43

  6. For the sake of demonstration, let's add the Top Client (25010 queries) to the same super-client:

    sudo sqlite3 /etc/pihole/pihole-FTL.db
    
    UPDATE network SET superclient_id = 0 WHERE hwaddr = 'd0:50:19:31:28:45';
    

    followed by a

    sudo pkill -RTMIN+3 pihole-FTL
    
  7. Enjoy.
    All statistics from all addresses of these two devices are summarized under one name:
    Screenshot at 2020-08-12 20-00-24

1 Like

This also works. It is even easier to configure.

It would be good if you could add a foreign-key constraint to the additional network table column:

superclient_id INTEGER REFERENCES superclient(id) ON DELETE SET NULL

to ensure superclient_id is reset to NULL when a super-client gets removed.

The superclient does not work whit client group, or my setup is buggy.

Yes, so far the supeclients only affect the computed statistics. I'm going forth and back on this, but should superclients even be used for group configuration? Given that - with the next version of Pi-hole - you can also specify per-client rules by MAC addresses, etc. It would be quite complex to bring them into this concept - and it would be working across databases (superclient and network in pihole-FTL.db, all per-group settings in gravity.db)

1 Like

Better wait for next version :+1:

Thank you for tackling this! I will load it on one of my pi-holes to test layer tonight!

1 Like

I see new/mac_clients has been merged into development by now. Is this the time to make a PR for this feature? Can it be considered ready? I did a lot of tests by now and everything seems to work everywhere. Another awesome feature. When you release this, you should definitely not make it a 5.1.3 micro step but jump straight to v5.2

Yes

We just updated this branch to the latest changes, fixes and improvements from the development branch. It would be very helpful if you could update your Pi-holes to the latest version and verify if everything still works as desired.

Thank you for your continued assistance in helping us make Pi-hole better for us all :slight_smile:

1 Like

Yes, it does. I see you pushed an update recently. Everything still works beautifully. I'm really looking forward to seeing this merged into Pi-hole. It increases usability quite a lot. I am finally able to see all the various MAC addresses (laptop Ethernet IPv4+6, Wi-Fi IPv4+6, mobile phone IPv4+6) under one entry per device. This is tremendously helpful.

Any ETA on this being merged to the development branch so it makes its way towards master? :slight_smile:

We are still looking for a better name than super-clients. Or maybe striving arguments for why it should be super. It is actually more a client-grouping, so maybe client-groups ?

The 'superclient' name is too close to 'superuser' for me. I don't have a suggestion for a replacement, but I'd like something that doesn't have the connotation that comes with something 'super' in linux.

Maybe something like client-units or multi-client?

IP group ?

Hmm, units seems strange to me. multi-client is already better, still looking for the convincing term that rules 'em all. Maybe something like aggregation-clients or something altogether different like device.

I'd see this as well too close to the group filtering (while it does not filter anything at all).