next_available_ip for DHCP Range

Posts: 15
4396     0

Most of our subnets for workstations are large DHCP Ranges.  If we want to automate allocation of Fixed/Host+Mac entries within that Range, is there a function to allocate the next available ?


As I understand, just using the nextavailableip will choose those with status UNUSED.  As a DHCP Range marks all as USED it fails to return an address.


Alternate homebrew script to extract all Lease State = Free, Ping candidate, Create.


As mentioned in other posts this exposes a higher risk of collision as spreading the process across multiple script servers, instances, multi-threading, or even DHCP may try and allocate the same entry while I'm processing :-)

Re: next_available_ip for DHCP Range

Posts: 139
4397     0

You can leverage the nextavailableip function via the WAPI to request an IP address from a specific range.


Using a range lookup (if the view is not specified, the default view will be used):


      • func:nextavailableip:<start_addr-end_addr>[,<network view>]


Here is an example using curl for a range:


curl -k1 -u admin:infoblox -X POST -H "Content-Type:application/json" -d '{"name":"","ipv4addrs":[{"ipv4addr":"func:nextavailableip:"}]}'


You should be able to build on this to include the MAC address and enable DHCP to create the Host+Mac entry you are looking for.

Steve S.

Re: next_available_ip for DHCP Range

Posts: 15
4397     0

Thanks.  Interesting methodology.  So force with a range and does add host record inside DHCP range.

Just need to ensure we collect the range(s) per subnet.

Re: next_available_ip for DHCP Range

Posts: 9
4397     0

So when a range is wanted to select a range within the subnet, it seems you can't just set a start and end IP.. that this needs to be defined as a range (DHCP) on the appliance.


And it seems that the caller has to know what this range is. 

While the range can be named, it doesn't seem to allow that name to be used as the reference (and apparently names are arbritrary and aren't used--they don't have to be unique).


I would like the caller to not need to know the subnet nor the range IP addresses.. 

if any change is needed on the range or IP subnet then anything calling it has to be updated as well.. apparently.


perhaps there is a method to address this?  I'd be very intereseted in hearing solutions..


Showing results for 
Search instead for 
Did you mean: 

Recommended for You