Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    DHCP not giving correct static addresses

    Scheduled Pinned Locked Moved DHCP and DNS
    13 Posts 6 Posters 3.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      cmb
      last edited by

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

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        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.

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • ?
          Guest
          last edited by

          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...)

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

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

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator
              last edited by

              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.

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              1 Reply Last reply Reply Quote 0
              • E
                EdCazini
                last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator
                  last edited by

                  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..

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                  1 Reply Last reply Reply Quote 0
                  • awebsterA
                    awebster
                    last edited by

                    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.

                    –A.

                    1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator
                      last edited by

                      "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??

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                      1 Reply Last reply Reply Quote 0
                      • awebsterA
                        awebster
                        last edited by

                        @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.

                        –A.

                        1 Reply Last reply Reply Quote 0
                        • johnpozJ
                          johnpoz LAYER 8 Global Moderator
                          last edited by

                          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??

                          An intelligent man is sometimes forced to be drunk to spend time with his fools
                          If you get confused: Listen to the Music Play
                          Please don't Chat/PM me for help, unless mod related
                          SG-4860 24.11 | Lab VMs 2.8, 24.11

                          1 Reply Last reply Reply Quote 0
                          • awebsterA
                            awebster
                            last edited by

                            @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¢

                            –A.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.