Koozali.org: home of the SME Server

How to release DHCP leases?

Offline jumba

  • *****
  • 291
  • +0/-0
  • Donations: July 2007 - $ 20.00
    • Smeserver på svenska!
How to release DHCP leases?
« on: April 10, 2009, 06:06:43 PM »
I stumbled on a new one today:

Suddenly some machines just couldn't get any IP numbers från the server (SME 7.4 with all updates) anymore.

After a little research I found that there was no free leases available to the machines.

Sample from the messages log:

Code: [Select]
Apr 10 11:48:27 server dhcpd: DHCPREQUEST for 192.168.0.76 (192.168.0.109) from 00:1a:4d:f2:d1:37 via eth1: lease 192.168.0.76 unavailable.
Apr 10 11:48:27 server dhcpd: DHCPNAK on 192.168.0.76 to 00:1a:4d:f2:d1:37 via eth1
Apr 10 11:48:29 server dhcpd: DHCPREQUEST for 192.168.0.72 (192.168.0.109) from 00:1f:c6:ed:2f:92 via eth1: lease 192.168.0.72 unavailable.
Apr 10 11:48:29 server dhcpd: DHCPNAK on 192.168.0.72 to 00:1f:c6:ed:2f:92 via eth1
Apr 10 11:48:35 server dhcpd: DHCPDISCOVER from 00:1a:4d:f2:d1:37 via eth1: network 192.168.0/24: no free leases

I "solved" the problem by simply expanding the DHCP range, but there would probably be some more clever commands to release those leases???

Anyone?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How to release DHCP leases?
« Reply #1 on: April 10, 2009, 07:34:15 PM »
I "solved" the problem by simply expanding the DHCP range, but there would probably be some more clever commands to release those leases???

The DHCP protocol doesn't allow leases to be revoked. The PCs holding those leases must release them. Or you need to wait until the leases expire.

You could shut down dhcpd and edit the leases file, then restart dhcpd, effectively losing memory of those leases, but then you risk having duplicate addresses on your network.

Offline jumba

  • *****
  • 291
  • +0/-0
  • Donations: July 2007 - $ 20.00
    • Smeserver på svenska!
Re: How to release DHCP leases?
« Reply #2 on: April 10, 2009, 09:58:48 PM »
OK, in this particular network is usually only a small number of machines running, and the dhcp range has been enough for several years. Yesterday I made quite a few Ubuntu OEM installations on new machines, and that included doing complete updates as well as adding a few special software. Each new machine used of its own lease, therefore all leases were finally used up.

Obviously something to remember next time I need to work with lots of machines during short periods of time...

Happy Eastern to you all!

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How to release DHCP leases?
« Reply #3 on: April 10, 2009, 10:43:08 PM »
Each new machine used of its own lease, therefore all leases were finally used up.

Those machines should have released their leases before being shut down. They weren't being good net citizens by shutting down while holding a lease.

Offline jumba

  • *****
  • 291
  • +0/-0
  • Donations: July 2007 - $ 20.00
    • Smeserver på svenska!
Re: How to release DHCP leases?
« Reply #4 on: April 10, 2009, 10:47:29 PM »
Well I agree, but obviously they didn't :sad:

Doing OEM installations of Ubuntu ends by running a "prepare script". Maybe some useful information for other people doing the same stuff....

« Last Edit: April 10, 2009, 11:32:17 PM by jumba »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How to release DHCP leases?
« Reply #5 on: April 11, 2009, 02:13:47 AM »
Well I agree, but obviously they didn't :sad:=

Open a bug report in the Ubuntu bug tracker.