DHCP not giving correct static addresses



  • Hello,
    I am running version 2.2.4 (x64) of pfSense, but I have the problem that static IP Addresses are not distributed correctly.

    I gave my laptop the IP address 192.168.1.2, but it gets 192.168.1.102 for example.
    (pfSense DHCP scope from 192.168.1.100 to 192.168.1.200)
    In the DHCP leases summary I see my static IP and the dynamic IP which was given to the cliënt, both have the same MAC address… See the screenshot below.

    pfSense is running on top of VMware ESXi 6, it has worked before, but I don't know if that was on older pfSense version or older ESXi 5 version...

    Does anyone know how to fix this ?



  • Release then renew, and it'll pick up the new IP. Otherwise it'll just keep renewing the existing lease.


  • LAYER 8 Global Moderator

    The mac address you put in there for chris-laptop the .2, is not the mac address that has the lease.  Your static mac is intel, the mac that has a lease for 102 shows as Azurewave

    Did you mean .20 ??  Thuis-PC Then yes release and then renew.



  • Sorry for the late reply ::)

    My problem seems that pfSense is "caching" DHCP leases.
    I just installed a new (test) server and give it a static ip, after I reboot the new (test) server it get's the old DHCP issued address, not the new static one.
    It seems that if I delete the DHCP issued static IP address and afterwards reboot the new (test) server, is get's the static address I want.

    Is this maybe a bug?
    Because I have to delete the DHCP issued address before my static assigned IP address is going to work… (This problem applies to all devices on my network...)


  • Banned

    Geez. As noted above. You MUST release the lease. This is no bug, this is a general (and useful) standard DHCP behaviour.


  • LAYER 8 Global Moderator

    Once a machine gets a lease, he will just continue to renew that..  Your dchp server has this lease and will continue to renew it even though it has a static setup..  Once you create a static you need to make sure clients do not have a lease or release any old ones they have and then do a discover for a new lease.

    The dhcp server will then say oh here this is your reservation I was holding for your mac, you can use it - it will then continue to renew that lease.



  • Sorry I have to bring this issue back… I have the same problem on my newly installed pfSense 2.2.5 (amd64).

    I have no problem with PCs or laptops since I can do release/renew, but I get a different story with other devices like smart phones or even manageable switches. Tried powering them off then back on, they get back their old leases. For the cellphones I managed by powering them off, re-assigning the static lease (deleting the previous one, you can't delete a lease if it's marked as online), restarted DHCPD to make sure, then power on.

    :-\ I can't power off for long the switches coz they're in heavy use.

    Thanks for any help.


  • LAYER 8 Global Moderator

    you sure can delete a lease even if marked online.. Just shutdown dhcp server and edit the leases file..

    This is not a dhcp server/pfsense issue..  If there is a OLD lease and the client requests it - what is the dhcp server to do??  Oh wait you can not have that old lease I had given you – your suppose to use this new static one..



  • Actually, I've seen enough strangeness from ISC DHCPd to point the finger at it as the culprit.
    Specifically, dhcpd will give you back the same IP address if the MAC address matches something in the leases file.  If you make subtle changes to the DHCP config, the lease that it may give back may no longer apply.  (Even weirder stuff happens in IPv6!)

    There really needs to be mechanism that blows away the leases file if you make big changes to the DHCP config, with appropriate warning, or if you change the interface IP on which the DHCP service is running, again with appropriate warnings.
    Also a button to flush all DHCP leases and restart the service somewhere in diagnostics menu would be a useful addition. 
    Personally, I'm comfortable going into the filesystem and deleting the leases file, but not everyone is.


  • LAYER 8 Global Moderator

    "dhcpd will give you back the same IP address if the MAC address matches something in the leases file"

    And how is that not appropriate behavior??



  • @johnpoz:

    "dhcpd will give you back the same IP address if the MAC address matches something in the leases file"

    And how is that not appropriate behavior??

    It is completely appropriate behaviour, except if the conditions under which the DHCP server is running have changed (ie: different subnet, pool range, etc), in which case you end up on a wild goose chase only to realise you need to flush the leases file.


  • LAYER 8 Global Moderator

    Um not sure I would call understanding that old leases need to be flushed if for example you change the subnet a goose chase..  This is pretty basic stuff, server is stupid.. It has a lease you ask for it - you get it..  Do we really need to code in idiot proofing to our dhcp servers??



  • @johnpoz:

    …  Do we really need to code in idiot proofing to our dhcp servers??

    That IS a good question!
    If the goal of pfSense's GUI to insulate the user as much as possible from having to know/navigate FreeBSD, ISC DHCPd, the yes, if on the other hand it is to give the user a jumping off point for learning more about Open source and what lies under the covers, then perhaps not.

    One could argue that Microsoft could just as easily have not had an option to delete a lease in their DHCP server from their DHCP manager GUI, and instead told the user to run netsh dhcp server serverID scope subnetID delete lease IPaddress from the command line.

    Just my 2¢


Log in to reply