View Full Version : [ubuntu] Count DHCP clients in network

November 14th, 2008, 05:04 PM

I have successfully created local network using Ubuntu in my router (pc). I have one problem - can`t count how many users are currently connected to my router. How can i do this?

November 14th, 2008, 05:46 PM
The who command is supposed to tell who is logged on. I suppose you could filter the results through grep -c for a count. (who |grep -c "192.168.1.")

That may not tell you who is actually connected, though.
/var/lib/dhcp3/dhcpd.leases shows which machines have leases. but dunno if it tells which are actually connected - sometimes old leases are still there, too.