associate MAC address with name on OpenWRT

4

1

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

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?

chuacw

Posted 2017-10-20T06:20:54.770

Reputation: 276

Answers

4

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.

starfry

Posted 2017-10-20T06:20:54.770

Reputation: 1 169