Howto get info about connected station from dumb accesspoints

Hello I have configured mesh where omnia acts as mesh node and connect other 4 Dlink DAP-X1860 APs flashed with latest openwrt. It works perfectly, however I lost visibility who is connected and where. At mesh nodes I see only ? insted of names from DHCP. I would like to see translations at my APs and also have overview which device connect where.

Is there any way hot to achieve this? To transfer DHCP names to be shown in luci I found script way which is not perfect mainly when I must copy to several targets…

1 Like

You can copy /tmp/dhcp.leases from your router to your access point.

I use xinetd:

On your router:

opkg update && opkg install xinetd

create script „/root/dhcp-list“
‘‘‘#!/bin/bash
cat /tmp/dhcp.leases ‘‘‘

and make it executable:
‘‘‘chmod +x /root/dhcp-list‘‘‘

Create following file „/etc/xinetd.d/dhcpleases“:

‘‘‘
service dhcpleases
{
socket_type = stream
protocol = tcp
port = 8000
wait = no
user = root
group = root
server = /root/dhcp-list
disable = no
type = UNLISTED
only_from = „your LAN network“
}

‘‘‘

Run:
‘‘‘/etc/init.d/xinetd enable
/etc/init.d/xinetd start ‘‘‘

Add following cron task on every AP:
‘‘‘* * * * * nc „Router IP“ 8000 > /tmp/dhcp.leases
‘‘‘

Pros:

  • easy to set up
  • Not much overhead
  • No extra software/script needed on APs
  • Cron entry is preserved during upgrades on APs

Cons:

  • No authentication, every LAN client can connect to Port 8000 on your Router an get dhcp list but there is no real critical information in it as every LAN client can scan LAN network on ita own and get the same information
4 Likes

Sorry for broken format, will fix it when I‘m at my laptop

Thank you this solves my first problem. And is there any service which would tell me which clients/mac addresses are currently connected? Ideally like HTML page. I know I can run arp at router manually.

I tried to set it up, but it the file that is created on the dump aps is empty.
grafik
whereas the /tmp/dhcp.leases on my router has as of writing this 33 active leases
grafik
Any idea what would cause this problem?

Did you make your script executable?

Yes, I double-checked to have everything done exactly as @protree advised bevor posting :slightly_smiling_face:

I just configured it for myself and it works for me. I suspect that the script is using shebang for bash which might not be installed on your Turris device. Try changing it to #!/bin/sh at first line. Then restart xinetd service and post output of

logread | grep -i xinet

tried it with sh. works for me too . thank you

1 Like

This is really weird.
When executing sh /root/dhcp-list it prints the leases. So this part is working (thanks @AreYouLoco !).
But executing netcat does not work (I double checked it is installed). Opening Port 8000 to lan didn’t help either.

can you post your output?

Output of sh /root/dhcp-list

When doing a nc <my router IP> 8000 >tmp/dhcp.leases on my router or one of the dump aps, nothing happens.

But the command hangs or completes with nothing?

Check with telnet to port 8000 or nmap to make sure its open. And netstat -tulpn on the router to make sure it is listening on that port.

It completes with nothing:

root@turis:~# nc 192.168.1.1 8000
root@turis:~#

Side note: it also completed with nothing when I didn’t have netcat installed.

root@turris:~# nmap 192.168.1.1 -p 8000
Starting Nmap 7.95 ( https://nmap.org ) at 2025-04-14 12:48 CEST
Nmap scan report for 192.168.1.1
Host is up (0.00031s latency).

PORT     STATE SERVICE
8000/tcp open  http-alt
MAC Address: <MAC> (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.57 seconds

edit: forgot to print this output:

root@turris:~# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
[...]
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      19919/xinetd
[...]

I believe turris is your AP not the router. Depending what you have in only_from it might work

Check your xinetd service then and /etc/init.d/xinetd restart && logread | grep xinetd

Here is mine:

root@router:~# cat /etc/xinetd.d/dhcp-leases

service dhcpleases
{
socket_type = stream
protocol = tcp
port = 8000
wait = no
user = nobody
group = nogroup
server = /root/bin/copy_dhcp_leases.sh
disable = no
type = UNLISTED
flags = NODELAY KEEPALIVE IPv4
only_from = %ACCESS_POINT_IP%
}

I’ve added TCP flags and changed execution user/group to default non-permisive for security. And since its port above 1024 so user nobody can do that. Also on my AP in cronjob I am executing it as user nobody and it works. Just had to delete once /tmp/dhcp.leases created as root on AP so user nobody can do it later on and create that file

Netcat is there by default from busybox. If it completes with nothing it is not a firewall issue but xinetd service is broken I guess

1 Like

Found the error - thanks a lot!!
I stupidly inserted in only_from not the IP-range, but the network name… :see_no_evil_monkey:
Now with inserting instead 192.168.1.1/24, it works like a charm!

1 Like

Network address should end in .0/24 with this netmask.

1 Like