associate MAC address with name on OpenWRT

Does anyone know if there's a way to associate a descriptive name to a MAC address on OpenWRT/LEDE, without necessary being able to change the hostname of the device?

The answer is not hostname, for users who think the answer is hostname.

Currently, the DHCP table on OpenWRT/LEDE shows the name of the devices that these devices gave(or their owners gave), however, these names mean nothing to me.

For example, currently, the DHCP table shows

android-1boeusthaoeu <MAC address> <IP address>
? <another MAC address> <another IP address>

I would like to see, for example,

"jim's device" <MAC address> <IP address>
"The TV" <another MAC address> <another IP address>

Is there a package, or something I can configure to make it so?


Solution 1:

If you want to assign a host name to a DHCP client based on its mac address then you can configure that in /etc/config/dhcp with a block like this:

config host
    option name myhost
    option mac de:ad:be:ef:ca:fe

You can also add an option ip to reserve a specific IP address for it.

You can either edit the file, use the uci command-line tool or do it through the LuCI web application. Remember to /etc/init.d/dnsmasq restart after changing the config file with an editor or uci commit if using uci.

I realise that jim's device is probably not a host name but assigning a host name (e.g jim_device) will at least make devices recognisable by a name of your choosing.