Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

DNS DHCP IPAM

Reply
Highlighted
Accepted Solution

Clear all DHCP Lease at once...

Techie
Posts: 14
11088     0

 

In a Point of Sale network, we have 20 000 scopes with only 1 IP available per scope.  For operationnal reason (equipement replacement, testing eqpt on the network), we need to make sure that even if the lease is for 2 weeks, any one of those IP are to be available 15 minutes after the lease.

 

On the actual Cisco Network Registrar system, a script run every 15 min and clear all leases, one by one.

 

Is it possible with Infoblox IPAM to clear all leases with one command?

 

If not, is it possible to allow any DHCP request to one scope to be answer even if the lease is not expired (would not make sence in a normal network but there could be no collision here)?

 

Last option, is there any REST script example available to read a 20 000 lines text file and issue a delete lease command?

 

Thank you

Highlighted

Re: Clear all DHCP Lease at once...

[ Edited ]
Techie
Posts: 1
11089     0

Hi DBO,

 

You cannot do it in one command but you could write a script to get all your leases and iteratively remove each lease.

 

Ex:

 

# Get a All DHCP leases.
my @retrieved_objs = $session->get(
    object => "Infoblox::DHCP::Lease"
);
 
# Iteratively Remove a DHCP Lease object
foreach (@retrieved_objs) {
    my $desired_lease = $_;
    unless($desired_lease){
        die("get lease failed: ",
        $session->status_code() . ":" . $session->status_detail());
    }
 
    # Submit the object for removal
    $session->remove($desired_lease)
        or die("Remove dhcp lease failed: ",
        $session->status_code() . ":" . $session->status_detail());
}

 

Highlighted

Re: Clear all DHCP Lease at once...

Techie
Posts: 4
11089     0

Can you also download the leases.csv from the DHCP leases tab, then sort for only the "Active" leases and do a CSV import to delete those leases?  Also, does deleting DHCP leases cause the DHCP server to send anything to the DHCP client that would force it to attempt to renew for a new lease?

Highlighted

Re: Clear all DHCP Lease at once...

Techie
Posts: 14
11089     0

I was thinking along those lines.  The remove lease command using the API is currently taking 1.3 sec/lease so it's way too slow.  A global CSV export of the active leases the first day the IB get in production would allow me to create a valid template (the 8500 POS change very little) that I could reuse.

 

The question is can I clear a lease doing a CSV import and how can I automate this???

Highlighted

Re: Clear all DHCP Lease at once...

Techie
Posts: 14
11089     0

Niet, CSV import for lease is not supported...

 

Back to square one

Showing results for 
Search instead for 
Do you mean 

Recommended for You