AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home/overview.html
GNU General Public License v3.0
25.79k stars 1.85k forks source link

Can't create dhcp static lease for client id #4872

Open joshqou opened 2 years ago

joshqou commented 2 years ago

Prerequisites

Description

AGH only allows users to create static reservations by MAC address, for some devices this is not suitable. Support for DHCP client ids should be added

ainar-g commented 2 years ago

ClientIDs exist only on the DNS level, not DHCP.

You can add the MAC addresses of the clients to the permanent client record as another ID, and that should automatically mark queries from those devices e.g. in the Query log.

joshqou commented 2 years ago

@ainar-g I'm not exactly sure where to point you but "Client IDs" do seem to exist. iOS, dhcpcd, and macOS allow you to set it, and the since discontinued Apple AirPort allowed you to assign reservations based on it.

From man dhcpcd.conf

     clientid string
             Send the clientid.  If the string is of the format 01:02:03 then it is encoded as hex.  For interfaces whose hard-
             ware address is longer than 8 bytes, or if the clientid is an empty string then dhcpcd sends a default clientid of
             the hardware family and the hardware address.
ainar-g commented 2 years ago

Ah, I see, you mean the DHCP Client IDs, not AdGuard Home's own ClientIDs for DNS clients. In that case, yes, I think we could add this feature in the future.

setovi commented 2 years ago

This would be amazing, I'm looking forward into it.