DHCP Friendly Name (without static IP)

Started by shanelord, August 02, 2023, 04:19:10 AM

Previous topic - Next topic
This may have been asked before, but it would be great to have the ability to map friendly names to MAC addresses in the system for help in identifying devices.

This is a feature that is present in many if not all consumer routers, Unifi management, Firewalla etc etc

Ideally an ability to do one, some or all of the following based on MAC address:
1. Replace or provide the hostname of a device.
2. Provide a Friendly Name in the "Description" field of a device.
3. "Tag" or "Categorise" the device i.e. as a "Known" device (could be useful for alerts on new devices connecting).

I don't want to have to use static addresses to achieve this.

Thanks,
Shane.

You can configure dhcp reservations in unbound... I do it all the time.

August 02, 2023, 08:50:06 AM #2 Last Edit: August 02, 2023, 09:06:08 AM by shanelord
As in a static reservation (sorry if that's not what you mean)? I want the IP address to remain dynamic, but have the manually set Hostname or Friendly Name show up in DHCPv4 leases list.

Edit:
I setup a hostname and description for a device in DHCPv4 Leases and left the IP address field blank.

Now I have two entries showing for the device in the leases list.

- One has no hostname or description but has a dynamic IP.
- The other has a hostname and description, but shows static and displays no IP address.

Ideally for this to be beneficial for my needs it would show as one combined device.

Services -> DHCPv4 -> [LAN]   

Scroll down to DHCP Static Mappings...


https://prnt.sc/rhlfn5yjks9o

Quote from: slackadelic on August 02, 2023, 02:54:39 PM
Services -> DHCPv4 -> [LAN]   

Scroll down to DHCP Static Mappings...


https://prnt.sc/rhlfn5yjks9o

Thanks - but they are static mappings and I'd like them to be dynamic IP assignments just with friendly names.

Is there a particular reason you need dynamic mappings?  Are you expecting a couple hundred different devices to be using the network at various times?

I just prefer it. If I knew how to code this I would and I'd put in a pull request. This would be an option for people to manage their own environment the way they want rather than being forced to move to static addressing. The D in DHCP is there for a reason ;)

I think want you mean is replace the MAC address in the log with some host name.
would be great to tell which device is getting which address.

August 03, 2023, 06:23:35 AM #8 Last Edit: August 03, 2023, 06:33:09 AM by shanelord
See the attached images (dark background) as an example from how Unifi Networks does it. The "Friendly Name" is at the top : "myQ Bridge" which I can set to whatever I want (as per image 2).

I can leave them as dynamic (ie Fixed IP Address is disabled) and they show up everywhere in the interface with their friendly name.

Also see the attached image from Firewalla (a firewall vendor using ubuntu base) where once given a name, it is very easy to apply groups, policies, restrictions, routes etc to this specific device even without a static IP address.

This is what I'm looking for.

You can still do this in the area I spoke of... just don't fill out an IP address to tie the MAC to.  All those products are doing are mapping mac to name via DHCP, that's it.  That's all the section I showed you does.  I just happen to tie static DHCP addressing to a few devices.  You don't have to fill out the IP.

The 'help' hint on the IPv4 entry:

   
If an IPv4 address is entered, the address must be within the interface subnet.
If no IPv4 address is given, one will be dynamically allocated from the pool.

Yes I tried this. As per above:

Now I have two entries showing for the device in the leases list.

- One has no hostname or description but has a dynamic IP.
- The other has a hostname and description, but shows static and displays no IP address.

Ideally for this to be beneficial for my needs it would show as one combined device.

That is probably because the device got a DHCP dynamic address while being unnamed and you subsequently "named" it. It should fall into one item on next DHCP release or at least next reboot.