Take the 2-minute tour ×

There is DHCP server in network (isc-dhcpd-server-3.0 on FreeBSD 7.2) than gives one IP per switch port to every user via Option 82

The problem appears when user disconnects one of his computers and connects another(i.e notebook with different MAC address) then DHCPD puts to log "...network net1: no free leases", because there is record in leases file that this IP is already owned by another MAC. That second computer will have his IP only after default-lease-time (that is IIRC minimum 10min, and after 3min he usually calling support) or after deletion of dhcpd.leases file and restart of dhcpd.

Is there a way to turn leases off at all, because we have strict binding between switch-port-ip?

share|improve this question
How many ports do you have and how big is your IP address space? Could you just assign more than one IP to each switch-port? –  Ben Dunlap Jun 19 '09 at 0:33
IP pool is public so it's pretty limited and cost $$. So solution with assigning more than one IP is out of question, but thanks for the try. –  SaveTheRbtz Jun 19 '09 at 0:56

4 Answers 4

up vote 2 down vote accepted

At $former_employer, I modified the OpenBSD dhcpd to understand Option 82 and do address assignment directly on that. As a matter of policy, "if you're coming in on connection X, you have the address assigned to X and if you use a switch to connect multiple computers, that's your own problem", and then just direct assignment based on that.

If you start seriously messing around with Option 82 assignment, it's probably worth doing this. Wasn't too hard, but wasn't trivial either.

share|improve this answer
do you still have that patch around to share? –  cstamas Dec 4 '12 at 7:35
No, and it's not my property, it was written for and so belongs to that employer. –  Phil P Dec 5 '12 at 2:54

The only thing I can think of is to set the lease time excruciatingly low. What you're trying to do is essentially the exact opposite of what DHCP is intended to do, so don't expect there to be any simple and painless answers that actually work.

share|improve this answer

One option would be to encourage your user to release the DHCP lease before disconnecting. I realise this is a workaround, rather than a solution, and might require some user training before it is effective!

On Windows, you can use the command "ipconfig /release" - although this requires elevated permissions, so a tool like CPAU might be useful.

Under FreeBSD or Linux, "dhclient -r" (must be running the ISC dhclient) is the release command. If you're using dhcpcd, "dhcpcd -k" should send the release packet. I'm yet to get this working while running NetworkManager, though. Again, these commands are privileged operations.

share|improve this answer

Solution found:

  1. Setup switches to generate snmp traps on port down.
  2. On trap server catch them and call omshell script that deletes old lease.

Not trivial, but also not impossible.

share|improve this answer

Your Answer


