Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find out free ip addresses... 1

Status
Not open for further replies.

adsfx

Programmer
Jun 4, 2003
237
GB
Hi,
in my table ip adresses are store xxx.xxx.xxx.xxx
(with the dots)
ip addresses go up to xxx.xxx.xxx.255
can i query the table to find out how many ip addresses are not used, and whcih ones they are?#
cheers MG
 
Do you have a field that tells you if they are used?
We need a little more info to tell you how.

Paul
 
the field is part of a table that lists all bits of kit on the network with the items IP address [equiptcp]
i want the query to 'fill in the blanks' - that is produce a list of addresses that are not there

let me know if ya want more info

cheers
 
Hi

I recently had a similar problem, actual need was to find 'available' CostCentre numbers, given a list of used CostCentres and rules on how to derive a cost centre, logically similar to your problem

My solution may not be the most elegant, but it works heres is how I did it:

Create a table to hold list of available codes with a prime key of Code (Ip Address)

Write some code to generate a list of IP addresses, and insert a row into the table for each IP Address

Make a query which extracts only the unused addresses from this total list, something like

SELECT IpAddress FROM tblAllIps WHERE IpAddress NOT IN (SELECT ipAddress FROM tblEquipment) ORDER BY IpAddress;

Hope this works for you

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Adsfx,

Would it not be easier just to export the DHCP allocation table from your server to find out what is being used?

John
 
dunno which option is easiest
gonna write a bit of code that queries the table
and produces a report with the info.
probly end up using kens method

PS how do you xport the DHCP tab from a linux srvr?

cluless as always MG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top