How to force forget of a lease

Hi,

I’ve had this problem recently where a PC on the network has had a DHCP lease assigned, but after a time the pc can no longer access the network.

Even if i assign a fixed IP that pc with that MAC address can no longer see or bee seen on the network.

Looking at DHCP leases on the web front end the specific PC appears crossed out at the bottom of current leases list.

How do I clear this lease ? The only way i’ve found so far is to fit a new network card which is untenable.

Thanks in advance for any help :slight_smile:

This is totally unusual. The PC has got a fixed and valid IP, Gateway and DNS address or got it from the DHCP. At the end of the leas time it’s supposed to ask the DHCP again and get new/same information for the network.

You’ll need to figure out if that accurs only with that (a single) device or with any other as well.

Those entries in ‘dynamic leases’ are unimportant, even you have set up a static ip assignment with the DHCP for clients with MAC addressed (fixed leases) that show up in there.

This has been asked so many times and I still can’t remeber where the file is located…

1 Like

If the dynamic lease in the bottom table is crossed out then this means that it is no longer reserved but has expired. So it, or any other dynamic lease could be used again by any pc.

What have you put into the start and end address of the dynamic range?
How many IP’s are available for dynamic use?
What have you set for the Default and Max Lease time?
How many pc’s are on your lan network and are they all using dynamic dhcp or do some of them have a reserved IP?

1 Like

I have a mix of dynamic and fixed leases :

1 → 50 being available for fixed IP’s ( servers and network hardware etc )
51 → 200 for DHCP leases ( workstations etc )

The default lease is 60 mins and the max is 120 mins ( ipfires default ).

I have approx 50 workstations at any one time with DHCP leases.

Can someone advise which logfile I should start looking in as this is totally annoying.

Cheers

You have not answered, if that happanes with a single or with all devices. Also have you tried to request new network information from the DHCP manually from the affected device? What’s the result?

1 Like

The setup of your dhcp is not the problem then. Those numbers should work fine.

In IPFire you can look in the WUI Logs - System Logs and select dhcp server in the drop down box and press update. This will show you all the IP requests that came from the pc’s. You can set the date to be all days from a specific month. You can also export it then which will show them on a web page which you can then search for all entries related to the specific mac address to see what the communications were.

If you want to do it via the console then the file is /var/log/messages or any of the gzipped versions.
You can then grep them for dhcpd and the specific mac address.

As your pc is losing its dhcp lease then I would also look in the logs of that machine to see what is happening when it tries to get an ip address. What response is it getting back from IPFire.

1 Like

Hi Terry,

Sorry - yes it’s a single device ( at the moment ).

I’ve released and renewed the lease on the client numerous times and literaly get timed out.

I’ve also tried using a static the ip on the client, but again it’s like ipfire is just ignoring the specific MAC address of the client.

It’s a real headscratcher…

cheers

In case you can still renew / talk top the DHCP server via a different device it’s not DHCP related. Please try that.

Already that’s a proof that it’s not related to the DHCP.

Also restart the affected client top see any change. In case it’s working afterwards again, it’s not ipfire at all. Also try a different switch port. Is that switch managed or unmanaged?

1 Like

Thanks Terry - tried on another switch - works fine now.

Gonna have to dig into the console logs of the switch now as ipfires DHCP log shows a lease being offerred on a constatnt basis but the event log on the client shows nothing when plugged into the other switch… should be a laugh :frowning:

Still would be nice to hide old leases on the GUI.

Thanks to all for the help.

Yeah this is an old topic. Don’t know why that old leases seem to never disappear. With a limited DHCP pool and many clients this can be a problem.

Normal this should not a problem. After a lease is expired it will blocked for i think twice of the max_leasetime before the dhcp server will reassign it to an other mac address.

1 Like

So why do the “totally” expired leases never disappear?

1 Like

If the number of active devices isn’t greater than the size of IP pool set ( defined by the ranges ), there is no problem.
The DHCP server keeps the info of expired leases to hand out the same IP for a MAC. If there are no unused IPs in the pool in case of a DHCP request, the server chooses the oldest expired IP.
So the pool size defines the number of possible clients, with a high possibility that the same device ( identified by MAC ) gets the same IP.

Certainly it isn’t really ‘nice’ to have a big list of expired leases in an environment with many different devices, which partly show up only once. If you can estimate the number of simultaneous active devices, you can adjust your dynamic pool size accordingly. These should limit your table of dynamic leases also.

What are “totally expired leases”? If you can give a formal definition, the table can be reduced by these leases. :wink:

Arnes description of the DHCPs behaviour with expired leases.

That wasn’t the point and it can’t do anything else.

That was my concern. I know a free DHCP server for windows that has a “bug” not deleting expired leases from its list and when the pool is full (active and expired leases) it won’t use expired leases It’s always just looking at the list and its IP pool and if expired leases won’t be deleted it runs full.

Hi it guy,
back to the starting point: What do you mean with “… the pc can no longer access the network”?
Does ping with ip-address work? If ping with ip-addrss works, but with the PC-name doesn’t, it is a name service problem.
Afaik the DHCP-Server communicates the leases to the DNS-Server (assuming standard installation of IPF), so you can work with names. But if you assign a static ip on the client, the DNS will keep the old assignment from before.

Btw. leases are stored in /var/state/dhcp/dhcpd.leases

That makes a DHCP-error unlikely.
Just an other suggestion: can you exclude a hardware defect?

  • Did you try an other LAN-cable?
  • Did you try an other Switch-Port?
  • When the switch is manageable: did you check the error count of the switch port?
1 Like