Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API & Integration, DevOps,NetOps,SecOps


DHCP Leases by network CIDR

Posts: 12
2624     0



I'm looking for something rather simple, but a way in the WAPI to:


"Give me all live leases in network x.y.z.q/mm"


I have a workaround currently whereby I dump the entire list of all leases in Infoblox and using python netaddr, filter out those that are within the particular CIDR block I'm looking for.  Although "network" is a field in the lease object, it cannot be used for searching in version 2.9. I would be fine even if I could squelch the master list of all leases to just those with the first 2 octets, which would likely speed up things, considering my current script takes 5 minutes to run to return a networks' worth of leases.


Is there another way?





Re: DHCP Leases by network CIDR

Posts: 246
2625     0

You can get a list of the lease objects using an IPAM approach:


curl -k1 -u admin:infoblox -X GET '' -H "Content-Type: application/json" -d \
  "network": "", 
  "status": "USED", 
  "types": "LEASE"

You will get a list of results like this:


        "_ref": "ipv4address/Li5pcHY0X2FkZHJlc3MkMTAuMTAyLjEwMC4xMDYvMA:", 
        "ip_address": "", 
        "is_conflict": false, 
        "lease_state": "BACKUP", 
        "mac_address": "00:50:56:83:15:09", 
        "names": [], 
        "network": "", 
        "network_view": "default", 
        "objects": [
        "status": "USED", 
        "types": [
        "usage": [

If you need specifics on the individual leases you can load them separately.


Note I'm using DHCP Failover so there are two leases recorded per IP + MAC address, one for each appliance in the HA pair.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You