LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   find assigned dhcp addresses (https://www.linuxquestions.org/questions/linux-newbie-8/find-assigned-dhcp-addresses-935553/)

daisychick 03-20-2012 03:58 PM

find assigned dhcp addresses
 
If I am running a dhcp server, how do I find what IP addresses have been assigned to connected computers?

daisychick 03-20-2012 04:35 PM

Code:

arp -n
worked

Tinkster 03-20-2012 05:45 PM

While that gives you a result it may not be just addresses that have been handed
out by your dhcp server; clients could have hard-coded IPs that happen to match
your subnet/netmask, and you'd see them in your arp table irrespective of how
they acquired those IPs.

Depending on which dhcp server daemon/process you're using you should be able
to parse current leases out from its log-/status files.

For the isc dhcp-server look at dhcp.leases.



Cheers,
Tink

chrism01 03-20-2012 05:46 PM

Actually, section 20.2.2 gives the answer http://www.linuxtopia.org/online_boo...lease-database
Quote:

On the DHCP server, the file /var/lib/dhcpd/dhcpd.leases stores the DHCP client lease database.
...
...
arp shows what MAC/IPs are currently cached by the arp table in the kernel http://linux.die.net/man/8/arp.

Not quite the same thing


All times are GMT -5. The time now is 07:50 PM.