2

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?

SaveTheRbtz
  • 5,621
  • 4
  • 29
  • 45
  • 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 00: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 00:56

4 Answers4

2

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.

Phil P
  • 3,040
  • 1
  • 15
  • 19
1

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.

womble
  • 95,029
  • 29
  • 173
  • 228
1

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.

Zanchey
  • 3,041
  • 20
  • 28
1

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.

SaveTheRbtz
  • 5,621
  • 4
  • 29
  • 45