Netgate m1n1wall

Author Topic: DHCP leases question (deleting a dhcp lease manually)  (Read 31746 times)

0 Members and 1 Guest are viewing this topic.

Offline LawnMowerGuy1

  • Jr. Member
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
DHCP leases question (deleting a dhcp lease manually)
« on: June 16, 2007, 07:42:45 pm »
Is there a way (in the GUI) to manually delete DHCP lease? The DHCP server seems to "remember" even the expired leases, but I would prefer if they were removed, or there was a way to delete them.

« Last Edit: January 14, 2008, 04:34:55 pm by sullrich »

Offline C4colo

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question
« Reply #1 on: June 26, 2007, 08:01:17 am »
Is there a way (in the GUI) to manually delete DHCP lease? The DHCP server seems to "remember" even the expired leases, but I would prefer if they were removed, or there was a way to delete them.



From my experience using other DHCP servers this is a GOOD thing.

pfSense remembers the leases for much longer than the expiration time, this means that if you remove a computer from your LAN and leave it offline for a long time, and then reconnect it... it will probably receive the same IP address.  If pfSense needs those leases it will reassign them as needed, but if they are not needed it will leave them.

This will prevent IP address conflicts and will also allow your port forwarding to work on computers that are not always on the LAN. 

The impact of this is a few KB of disk space used (insignificant) and almost no RAM or CPU overhead.  If you want it cleaned up for asthetic purposes then I would say you are circumventing legitimate functionality.

I have my complaints about the DHCP implementation on pfSense, but this is not one of them.

- C4colo

Offline jnana

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question
« Reply #2 on: December 15, 2007, 02:51:43 pm »
Ok - it was great to find this so what I just want to confirm is that this part of the 1.2RC3 DHCP server gui at the bottom - with "enable network booting"

That is setting option 66 and 67 of DHCP. This company are about to turn up and I have to have this
    option bootfile-name "Thomson/ST2030S";
    next-server 10.10.0.1;


Set to make the phones find the server and config.

So just looking for reassurance.

Also still wondering if asterisk is going to be able to connect outward through the firewall. In the past I didn't have much luck making Asterisk work through a firewall but there are traffic shaping options related to asterisk.

These last weeks I have really been converted from ipcop and smoothwall - pfsense is really complete.

Thanks

Jnana

Offline AhnHEL

  • Sr. Member
  • ****
  • Posts: 572
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question
« Reply #3 on: December 27, 2007, 04:59:55 am »
I know this topic is rather old and kind of unnecessary but just to clarify if someone is really interested in removing expired leases

In the GUI, go to Diagnostics/Edit File and load /var/dhcpd/var/db/dhcpd.leases~

Delete the leases you want removed, then hit Save.

Do the same for /var/dhcpd/var/db/dhcpd.leases
 
AhnHEL (Angel)
NYC

3 pfSense sites: 2.1 RELEASE (amd64)
Dell 745 SFF E4400 @ 2.0Ghz, 2GB RAM, 20/5 Mbps
Dell 755 SFF E6550 @ 2.3Ghz, 2GB RAM, 20/5 Mbps
White Box i5 3570k @ 4.4Ghz, 16GB RAM, 114/6 Mbps, SSD
OpenVPN (Site to Site, Road Warrior), IPSec Mobile, UPnP Gaming, Traffic Shaping, Snort, Suricata

Offline Nostradamus

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question
« Reply #4 on: January 13, 2008, 05:43:15 pm »
@onhel

Thanks for your info. Exactly what i was looking for :)
1.2-RELEASE
built on Fri Mar 7 18:49:15 EST 2008
Intel Celeron 1100 Mhz
512MB PC-100
Segate 20GB HD
eth0: Intel 82801BA/BAM/CA/CAM 10/100 (WAN)
eth1: 3Com 3c905C-TX/TX-M 10/100 (LAN)

Offline AhnHEL

  • Sr. Member
  • ****
  • Posts: 572
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question
« Reply #5 on: January 13, 2008, 08:45:55 pm »
=O)
AhnHEL (Angel)
NYC

3 pfSense sites: 2.1 RELEASE (amd64)
Dell 745 SFF E4400 @ 2.0Ghz, 2GB RAM, 20/5 Mbps
Dell 755 SFF E6550 @ 2.3Ghz, 2GB RAM, 20/5 Mbps
White Box i5 3570k @ 4.4Ghz, 16GB RAM, 114/6 Mbps, SSD
OpenVPN (Site to Site, Road Warrior), IPSec Mobile, UPnP Gaming, Traffic Shaping, Snort, Suricata

Offline Torty

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question (deleting a dhcp lease manually)
« Reply #6 on: June 30, 2008, 02:25:55 am »
Hmmm Deleting all the leases shown in the two files did not work for me, a reboot does however, although clearly this is a less preferable fix!

Offline GruensFroeschli

  • Green Frog
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5066
  • Karma: +4/-0
  • No i will not fix your computer!
    • View Profile
    • FFXI related
Re: DHCP leases question (deleting a dhcp lease manually)
« Reply #7 on: June 30, 2008, 04:23:13 am »
As onhel wrote: Try to press save on the DHCP config page after deleting the files.

You somehow have to trigger that the config gets reloaded.
A reboot reloads the config. Pressing save does too.
We do what we must, because we can.
(Except when you PM me to help you directly - DONT: keep your issues in the forum)

Offline pfman

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question (deleting a dhcp lease manually)
« Reply #8 on: September 10, 2008, 03:36:49 pm »
I had same problem ..... pfSense DHCP remembers all leased IPs and won't releases them even though 1 machine have several leases .
I changed the IP range, save it then put the old IP range back, save it again. That resolves my problem till next time  the DHCP runs out of IP again.

Offline agidi

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question (deleting a dhcp lease manually)
« Reply #9 on: November 26, 2008, 05:43:20 pm »

Hello, just wondering if it actually worked

thanks

Offline ck42

  • Jr. Member
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question (deleting a dhcp lease manually)
« Reply #10 on: December 24, 2008, 10:20:51 am »
Verified.
Deleting the lease content information in those two lease files and then pressing the Save button in the DHCP Server page does update the current DHCP lease listing in the GUI.

Offline evewes

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile
Re: DHCP leases question (deleting a dhcp lease manually)
« Reply #11 on: March 16, 2009, 01:59:33 pm »
I had same problem ..... pfSense DHCP remembers all leased IPs and won't releases them even though 1 machine have several leases .
I changed the IP range, save it then put the old IP range back, save it again. That resolves my problem till next time  the DHCP runs out of IP again.

Do i understand this correctly, if many PC have several leases and every ip is used there will be no more leases until i do whats described here.