Debian stuck in Endless DHCPNAK/OFFER loop unless I ask DHCP server to clear expired leases











up vote
0
down vote

favorite












have a Marvel Kirkwood device running Debian with 3.16 Kernel. On boot, the DHCPClient gets stuck in a loop and never picks up an ip unless I log onto the dhcp server and ask it to dump the expired leases. The dhcp server has no issue with any of the other 25 devices in the place.



I feel this has something to do with the device rejecting the hostname that the dhcp server is trying to push on the device. Not sure how and if the device can announce it's hostname to dhcp server.



Edit: When it does finally pick up an ip, the DHCP clients list shows its name as new-host and not the actual device name.



 [   34.300664] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPNAK from 192.168.2.1
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.2.1
DHCPNAK from 192.168.2.1
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPNAK from 192.168.2.1
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.2.1
DHCPNAK from 192.168.2.1
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPNAK from 192.168.2.1
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.2.1
// CLEARED the 'expired DHCP leases'
DHCPACK from 192.168.2.1 bound to 192.168.2.24 --renewal in 100664 seconds.


Any suggestions?










share|improve this question




























    up vote
    0
    down vote

    favorite












    have a Marvel Kirkwood device running Debian with 3.16 Kernel. On boot, the DHCPClient gets stuck in a loop and never picks up an ip unless I log onto the dhcp server and ask it to dump the expired leases. The dhcp server has no issue with any of the other 25 devices in the place.



    I feel this has something to do with the device rejecting the hostname that the dhcp server is trying to push on the device. Not sure how and if the device can announce it's hostname to dhcp server.



    Edit: When it does finally pick up an ip, the DHCP clients list shows its name as new-host and not the actual device name.



     [   34.300664] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    DHCPREQUEST on eth0 to 255.255.255.255 port 67
    DHCPNAK from 192.168.2.1
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
    DHCPREQUEST on eth0 to 255.255.255.255 port 67
    DHCPOFFER from 192.168.2.1
    DHCPNAK from 192.168.2.1
    DHCPREQUEST on eth0 to 255.255.255.255 port 67
    DHCPNAK from 192.168.2.1
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
    DHCPREQUEST on eth0 to 255.255.255.255 port 67
    DHCPOFFER from 192.168.2.1
    DHCPNAK from 192.168.2.1
    DHCPREQUEST on eth0 to 255.255.255.255 port 67
    DHCPNAK from 192.168.2.1
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
    DHCPREQUEST on eth0 to 255.255.255.255 port 67
    DHCPOFFER from 192.168.2.1
    // CLEARED the 'expired DHCP leases'
    DHCPACK from 192.168.2.1 bound to 192.168.2.24 --renewal in 100664 seconds.


    Any suggestions?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      have a Marvel Kirkwood device running Debian with 3.16 Kernel. On boot, the DHCPClient gets stuck in a loop and never picks up an ip unless I log onto the dhcp server and ask it to dump the expired leases. The dhcp server has no issue with any of the other 25 devices in the place.



      I feel this has something to do with the device rejecting the hostname that the dhcp server is trying to push on the device. Not sure how and if the device can announce it's hostname to dhcp server.



      Edit: When it does finally pick up an ip, the DHCP clients list shows its name as new-host and not the actual device name.



       [   34.300664] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPNAK from 192.168.2.1
      DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPOFFER from 192.168.2.1
      DHCPNAK from 192.168.2.1
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPNAK from 192.168.2.1
      DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPOFFER from 192.168.2.1
      DHCPNAK from 192.168.2.1
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPNAK from 192.168.2.1
      DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPOFFER from 192.168.2.1
      // CLEARED the 'expired DHCP leases'
      DHCPACK from 192.168.2.1 bound to 192.168.2.24 --renewal in 100664 seconds.


      Any suggestions?










      share|improve this question















      have a Marvel Kirkwood device running Debian with 3.16 Kernel. On boot, the DHCPClient gets stuck in a loop and never picks up an ip unless I log onto the dhcp server and ask it to dump the expired leases. The dhcp server has no issue with any of the other 25 devices in the place.



      I feel this has something to do with the device rejecting the hostname that the dhcp server is trying to push on the device. Not sure how and if the device can announce it's hostname to dhcp server.



      Edit: When it does finally pick up an ip, the DHCP clients list shows its name as new-host and not the actual device name.



       [   34.300664] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPNAK from 192.168.2.1
      DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPOFFER from 192.168.2.1
      DHCPNAK from 192.168.2.1
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPNAK from 192.168.2.1
      DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPOFFER from 192.168.2.1
      DHCPNAK from 192.168.2.1
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPNAK from 192.168.2.1
      DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
      DHCPREQUEST on eth0 to 255.255.255.255 port 67
      DHCPOFFER from 192.168.2.1
      // CLEARED the 'expired DHCP leases'
      DHCPACK from 192.168.2.1 bound to 192.168.2.24 --renewal in 100664 seconds.


      Any suggestions?







      debian networking dhcp hostname






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 22 '15 at 2:19

























      asked Jan 22 '15 at 0:52









      MandoMando

      1012




      1012






















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          1
          down vote













          I had the exact same problem with Debian on Cubox.



          Looking at the log file on the DHCP server (running dhcpd OpenBSD) however revealed what the problem was in my case:



          Oct  4 08:45:04 gateway dhcpd[22743]: Both dynamic and static leases present for 192.168.1.2.
          Oct 4 08:45:04 gateway dhcpd[22743]: Either remove host declaration 192.168.1.2 or remove 192.168.1.2
          Oct 4 08:45:04 gateway dhcpd[22743]: from the dynamic address pool for 192.168.1.0


          The mistake I had made was to both assign static IP addresses to some hosts based upon their MAC addresses and then have the same IP addresses available in the dynamic pool (the range part on the DHCP server).



          Hopes this helps others.






          share|improve this answer




























            up vote
            0
            down vote













            the dhcp client at /etc/dhcp/dhcp/dhclient.conf was sending gethostname(); as the hostname to the dhcp server.



            Replaced gethostname() with the hardcoded name of the device and it has fixed the issue.






            share|improve this answer





















            • How do I know the device name?
              – GuySoft
              Jun 8 '17 at 6:47










            • @GuySoft cat /etc/hostname
              – Philippe Gachoud
              Dec 4 at 14:16










            • @PhilippeGachoud Thats the host name, not the device name. But I don't really remember what i did here anymore.
              – GuySoft
              2 days ago










            • maybe could be more specific about "device"
              – Philippe Gachoud
              2 days ago


















            up vote
            0
            down vote













            I got problems with my DHCP Server (Router) with reserved addresses



            Remove them and reallocate them solved my problem






            share|improve this answer





















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f180388%2fdebian-stuck-in-endless-dhcpnak-offer-loop-unless-i-ask-dhcp-server-to-clear-exp%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote













              I had the exact same problem with Debian on Cubox.



              Looking at the log file on the DHCP server (running dhcpd OpenBSD) however revealed what the problem was in my case:



              Oct  4 08:45:04 gateway dhcpd[22743]: Both dynamic and static leases present for 192.168.1.2.
              Oct 4 08:45:04 gateway dhcpd[22743]: Either remove host declaration 192.168.1.2 or remove 192.168.1.2
              Oct 4 08:45:04 gateway dhcpd[22743]: from the dynamic address pool for 192.168.1.0


              The mistake I had made was to both assign static IP addresses to some hosts based upon their MAC addresses and then have the same IP addresses available in the dynamic pool (the range part on the DHCP server).



              Hopes this helps others.






              share|improve this answer

























                up vote
                1
                down vote













                I had the exact same problem with Debian on Cubox.



                Looking at the log file on the DHCP server (running dhcpd OpenBSD) however revealed what the problem was in my case:



                Oct  4 08:45:04 gateway dhcpd[22743]: Both dynamic and static leases present for 192.168.1.2.
                Oct 4 08:45:04 gateway dhcpd[22743]: Either remove host declaration 192.168.1.2 or remove 192.168.1.2
                Oct 4 08:45:04 gateway dhcpd[22743]: from the dynamic address pool for 192.168.1.0


                The mistake I had made was to both assign static IP addresses to some hosts based upon their MAC addresses and then have the same IP addresses available in the dynamic pool (the range part on the DHCP server).



                Hopes this helps others.






                share|improve this answer























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  I had the exact same problem with Debian on Cubox.



                  Looking at the log file on the DHCP server (running dhcpd OpenBSD) however revealed what the problem was in my case:



                  Oct  4 08:45:04 gateway dhcpd[22743]: Both dynamic and static leases present for 192.168.1.2.
                  Oct 4 08:45:04 gateway dhcpd[22743]: Either remove host declaration 192.168.1.2 or remove 192.168.1.2
                  Oct 4 08:45:04 gateway dhcpd[22743]: from the dynamic address pool for 192.168.1.0


                  The mistake I had made was to both assign static IP addresses to some hosts based upon their MAC addresses and then have the same IP addresses available in the dynamic pool (the range part on the DHCP server).



                  Hopes this helps others.






                  share|improve this answer












                  I had the exact same problem with Debian on Cubox.



                  Looking at the log file on the DHCP server (running dhcpd OpenBSD) however revealed what the problem was in my case:



                  Oct  4 08:45:04 gateway dhcpd[22743]: Both dynamic and static leases present for 192.168.1.2.
                  Oct 4 08:45:04 gateway dhcpd[22743]: Either remove host declaration 192.168.1.2 or remove 192.168.1.2
                  Oct 4 08:45:04 gateway dhcpd[22743]: from the dynamic address pool for 192.168.1.0


                  The mistake I had made was to both assign static IP addresses to some hosts based upon their MAC addresses and then have the same IP addresses available in the dynamic pool (the range part on the DHCP server).



                  Hopes this helps others.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 4 '15 at 0:15









                  Martin

                  111




                  111
























                      up vote
                      0
                      down vote













                      the dhcp client at /etc/dhcp/dhcp/dhclient.conf was sending gethostname(); as the hostname to the dhcp server.



                      Replaced gethostname() with the hardcoded name of the device and it has fixed the issue.






                      share|improve this answer





















                      • How do I know the device name?
                        – GuySoft
                        Jun 8 '17 at 6:47










                      • @GuySoft cat /etc/hostname
                        – Philippe Gachoud
                        Dec 4 at 14:16










                      • @PhilippeGachoud Thats the host name, not the device name. But I don't really remember what i did here anymore.
                        – GuySoft
                        2 days ago










                      • maybe could be more specific about "device"
                        – Philippe Gachoud
                        2 days ago















                      up vote
                      0
                      down vote













                      the dhcp client at /etc/dhcp/dhcp/dhclient.conf was sending gethostname(); as the hostname to the dhcp server.



                      Replaced gethostname() with the hardcoded name of the device and it has fixed the issue.






                      share|improve this answer





















                      • How do I know the device name?
                        – GuySoft
                        Jun 8 '17 at 6:47










                      • @GuySoft cat /etc/hostname
                        – Philippe Gachoud
                        Dec 4 at 14:16










                      • @PhilippeGachoud Thats the host name, not the device name. But I don't really remember what i did here anymore.
                        – GuySoft
                        2 days ago










                      • maybe could be more specific about "device"
                        – Philippe Gachoud
                        2 days ago













                      up vote
                      0
                      down vote










                      up vote
                      0
                      down vote









                      the dhcp client at /etc/dhcp/dhcp/dhclient.conf was sending gethostname(); as the hostname to the dhcp server.



                      Replaced gethostname() with the hardcoded name of the device and it has fixed the issue.






                      share|improve this answer












                      the dhcp client at /etc/dhcp/dhcp/dhclient.conf was sending gethostname(); as the hostname to the dhcp server.



                      Replaced gethostname() with the hardcoded name of the device and it has fixed the issue.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jan 22 '15 at 15:02









                      MandoMando

                      1012




                      1012












                      • How do I know the device name?
                        – GuySoft
                        Jun 8 '17 at 6:47










                      • @GuySoft cat /etc/hostname
                        – Philippe Gachoud
                        Dec 4 at 14:16










                      • @PhilippeGachoud Thats the host name, not the device name. But I don't really remember what i did here anymore.
                        – GuySoft
                        2 days ago










                      • maybe could be more specific about "device"
                        – Philippe Gachoud
                        2 days ago


















                      • How do I know the device name?
                        – GuySoft
                        Jun 8 '17 at 6:47










                      • @GuySoft cat /etc/hostname
                        – Philippe Gachoud
                        Dec 4 at 14:16










                      • @PhilippeGachoud Thats the host name, not the device name. But I don't really remember what i did here anymore.
                        – GuySoft
                        2 days ago










                      • maybe could be more specific about "device"
                        – Philippe Gachoud
                        2 days ago
















                      How do I know the device name?
                      – GuySoft
                      Jun 8 '17 at 6:47




                      How do I know the device name?
                      – GuySoft
                      Jun 8 '17 at 6:47












                      @GuySoft cat /etc/hostname
                      – Philippe Gachoud
                      Dec 4 at 14:16




                      @GuySoft cat /etc/hostname
                      – Philippe Gachoud
                      Dec 4 at 14:16












                      @PhilippeGachoud Thats the host name, not the device name. But I don't really remember what i did here anymore.
                      – GuySoft
                      2 days ago




                      @PhilippeGachoud Thats the host name, not the device name. But I don't really remember what i did here anymore.
                      – GuySoft
                      2 days ago












                      maybe could be more specific about "device"
                      – Philippe Gachoud
                      2 days ago




                      maybe could be more specific about "device"
                      – Philippe Gachoud
                      2 days ago










                      up vote
                      0
                      down vote













                      I got problems with my DHCP Server (Router) with reserved addresses



                      Remove them and reallocate them solved my problem






                      share|improve this answer

























                        up vote
                        0
                        down vote













                        I got problems with my DHCP Server (Router) with reserved addresses



                        Remove them and reallocate them solved my problem






                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          I got problems with my DHCP Server (Router) with reserved addresses



                          Remove them and reallocate them solved my problem






                          share|improve this answer












                          I got problems with my DHCP Server (Router) with reserved addresses



                          Remove them and reallocate them solved my problem







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 4 at 14:28









                          Philippe Gachoud

                          423310




                          423310






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f180388%2fdebian-stuck-in-endless-dhcpnak-offer-loop-unless-i-ask-dhcp-server-to-clear-exp%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Accessing regular linux commands in Huawei's Dopra Linux

                              Can't connect RFCOMM socket: Host is down

                              Kernel panic - not syncing: Fatal Exception in Interrupt