Listing all devices in WebGui incl. static ips?

Hi all,
I started using OpenWrt yesterday and am wondering if there is a way to see all connected devices in the web interface, even those that have a static ip setup and are not having one assigned by the dhcp server?

Thanks,
Stuoningur

Status-> Routes-> Read the ARP table.
Also at the bottom of the page are the IPv6 Neighbours.

1 Like

Thanks, a nice pretty overview like the dhcp leases would be better, but that will do the job.

Use ip -s -s neigh flush all to get the correct active position as the ARP table will contain
non-active ip addresses.

2 Likes

You could use this useful info

ip -s -s neigh flush all

from @azeu666 and write a simple bash cgi listing all you need, locate it in /www/cgi-bin/your.cgi modify the original /www/index.html inserting a link to your cgi and first of all let sh to read cgi in /etc/config/uhttp of course if you will write your cgi in lua, uhttpd config is already ok.

The simplest cgi in sh:

#!/bin/sh

cat << EOT

<!DOCTYPE html>
<html>
<head>
        <title>webserver </title>
        <link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body style="background-color: white">
<!-- Header -->
<div id="header">
        <h1>ip</h1>
</div>
<!-- Content -->
<div id="content">
EOT

for IP in $(ip -s neigh | sed -e s'/ /-/'g | tr '\n'); do
echo "$IP<br><br>"; done

cat << EOT

</div>
<!-- End content -->
</body>
</html>

EOT

exit 0

Don't forget to add

list interpreter ".cgi=/bin/sh"

In your uhttp config file

1 Like

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