Show Hostnames on dumb AP

Hello community,

I've recently configured a dump AP for my network.
Usually I was able to see what hostnames are occupying which IPs and which MACs in the LuCi web-interface.

Now, as the AP only act's as AP and the IPs and DNS entries are assigned from the routers behind the AP, I only get presented with a screen like that:

Is there any way I force to show the hostnames/IPs automatically?
If not, is there any manual approach? Like for example adding every hostname and IP with the corresponding MAC to some sort of file for LuCi to read and display the correct IPs/hostnames?

It's not a big deal however, just a bit of an annoyment to me, as I used to check which devices are connected with which speed etc - now I have to copy the MAC, search in the router to see which device is which .. you get it.

Thank you very much!

The AP doesn't 'know' the hostnames, as they are only know by the dhcp server. So it can't show them.
About manual, you can write a cgi script (in ash, as that's available) which downloads the dhcp leases table from the dhcp server, and combines it with the associated client list
iwinfo wlan0 assoclist
to provide the hostname in the list.

1 Like

I am perfectly fine writing that, I'm just wondering were to I have to put the outcome and in which format for the AP to read it so that LuCi can display it?

You can simply put your script (generating a valid html page) in /www/cgi-bin/, then you can access it as /cgi-bin/script

uhttpd is a bit picky on cgi-scipts, they should provide some headers:

#! /bin/sh

echo "Status: 403 Forbidden"
echo "Content-Type: text/html"
echo 
echo "<html><head></head><body>"

echo payload

echo "</body></html>"

/etc/ethers, as I recall, or look at the LuCI code to see where it is reading the DHCP leases. Using rsync or similar for that file might be a good approach.

2 Likes

Thanks jeff, that works right of the box:

root@OpenWrt:~# cat /etc/ethers
#
#  Lookup man 5 ethers for syntax documentation
#
#  Examples :
#       02:00:11:22:33:44       OpenWrt.lan
#       02:00:11:22:33:44       192.168.1.1
d8:0d:17:a1:81:07 tplink-smartplug-network.home

Exactly what I was looking for - I'll just go for a cronjob, which will import the DHCP leases from /tmp/dhcp.leases from both routers (converting it beforehand to the appropriate format of course).

Thank you very much!

1 Like

I've bounced this around in my head a few times and keep coming back to MQTT over TLS as being a good way of managing the DHCP lease distribution. OpenWrt packages the mosquitto client, so it seems "doable", though I haven't had the value to me push it past the "thinking about" stage. Between not using LuCI on a regular basis, fixed leases for all my "known" devices, and host names reported in DHCP requests often not being very useful, transcribing my static leases to /etc/ethers was as far as I ever got.

Hi, please edit your title, it is "dumb" not "dump",

I tried to help with that issue(macaddress to name translation) some time ago, but some user just get angry and kick me out and the issue was ignored and closed:

see this thread if you want: https://github.com/openwrt/luci/issues/540#issuecomment-409302174
keep seeing, there is several messages hidden
see this and below messages: https://github.com/openwrt/luci/issues/540#issuecomment-244657293

long story short: I just came with the idea to have a simple text file that luci should use to make optional (configurable) macaddress-to-NAME (not a network hostname) just a defined name like "Alice Notebook" and use that to translate every mac address show, at least in dhcp-leases listing and the associated stations listing.

then, with that feature with an optional package (see the scripts that I tested with other user that helped me) those scripts involves getting information.
from dumb ap pulling from main router... (because this seams to be more natural and convenient that pushing from main router to dumb ap... and it is definitly much more easy than put different lists on different dumbs and merge it on all places including the main router..)
but some users started to get angry saying that they dont want that kind of features on luci, and dont want to add those scripts and started complaying about security issues ¿?... and make my mouth shut up.

It was really sad, because it was a VERY interesting feature to add, since WE (humans) tend to be more friendly with names than macaddress and I just wanted some of the luci developers to add that simple text file reading onto luci source code and push that code into the master branch.

They keep insisting that we need to use uci dhcp leases, or tmp dhcp-leases file or dnsmasq etc, but those are used for other purposes like hostname resolution or so and dont allow spaces, etc...

I encourage to read the thread for anyone that is interested on reopen that discussion or even try to code it and add a push request to see if they re-think about it at least with the code done.

Thanks.

Hi,

I just took a quick look at that thread and I believe that you were able to successfully use /etc/ethers to have some name translation.
This - at least for me - is more than sufficient and works out great.

I think if you want to have some other kind of file/mechanism to set these translations, you are better up opening another thread for it, as this is - at least in my opinion - a totally different topic.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.