Operating System - Linux
1828038 Members
2007 Online
109973 Solutions
New Discussion

DHCP available /used addresses

 
Alexander Chuzhoy
Honored Contributor

DHCP available /used addresses

Is there a command to see how many free/used addresses are in dhcpd pool(s).
Parsing dhcpd.leases isn't satisfying cause I also have static addresses that don't appear there.
I'm using RedHat (any version).
Thanks in advance.
5 REPLIES 5
Ivan Ferreira
Honored Contributor

Re: DHCP available /used addresses

If dhcp.leases does not contains all information you need, you could combine it with nmap to check what ip addresses are used (nmap -sP static-address-range).
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Stuart Browne
Honored Contributor

Re: DHCP available /used addresses

Why do you have static IP addresses within a DHCP pool ?

If you're going to make addresses static, then they should either be assigned by DHCP (using hwaddress), or be outside of the DHCP pool.

Why do I say this? DHCP thinks it's in control of the entire pool. It thinks it can assign *any* address from this pool to any requesting machine. This means that some of your static's might get assigned to another machine on the network, causing nastyness and IP conflicts.
One long-haired git at your service...
Alexander Chuzhoy
Honored Contributor

Re: DHCP available /used addresses

Thanks for your replies.
1. I can come up with some workaround myself, but the question is whether there's a command to do this.

2. What I mean by static addresses is that the addresses are binded to mac in dhcpd.conf file.


What I need is a tool/command to see available/occupied IP addresses on dhcp server.
Arno Kuyper_1
Trusted Contributor

Re: DHCP available /used addresses

Alexander,

Take a look at this tool -> Sauron.
http://sauron.jyu.fi/.
It's a web based DNS & DHCP configuration tool based on a SQL-database.

Hope it helps,

Arno
Sergejs Svitnevs
Honored Contributor

Re: DHCP available /used addresses

reportdhcp.pl CGI script can tell at a glance how many leases are available in each network, and how many of these are currently â activeâ .

http://www.omar.org/opensource/reportdhcp/index.html

Regards,
Sergejs