2

I have a webserver running on a local machine, which spontaneously started to send about 400 DHCP requests per second, constantly changing its IP address, until I killed dhclient several hours later. Simply restarting the server did not help, I actually had to kill dhclient in order for it to stop.

The server is configured to use DHCP, and the router is configured to give it a static IP address.

This is the output of grep -i dhc /var/log/syslog.1 (.1 because I restarted it) for the first few seconds (the rate increased dramatically later, but not the overall pattern):

Sep 11 04:36:01 net-server dhclient: DHCPREQUEST on eth0 to 10.0.0.1 port 67
Sep 11 04:36:01 net-server dhclient: DHCPACK from 10.0.0.1
Sep 11 04:36:01 net-server dhclient: DHCPDECLINE on eth0 to 255.255.255.255 port 67
Sep 11 04:36:01 net-server dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
Sep 11 04:36:04 net-server dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Sep 11 04:36:04 net-server dhclient: DHCPOFFER from 10.0.0.1
Sep 11 04:36:04 net-server dhclient: DHCPACK from 10.0.0.1
Sep 11 04:36:04 net-server dhclient: DHCPDECLINE on eth0 to 255.255.255.255 port 67
Sep 11 04:36:04 net-server dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
Sep 11 04:36:04 net-server dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Sep 11 04:36:04 net-server dhclient: DHCPOFFER from 10.0.0.1
Sep 11 04:36:05 net-server dhclient: DHCPACK from 10.0.0.1
Sep 11 04:36:05 net-server dhclient: DHCPDECLINE on eth0 to 255.255.255.255 port 67
Sep 11 04:36:05 net-server dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8

Later, lines like Sep 11 05:13:01 net-server ifup[436]: /sbin/dhclient-script: 28: .: Can't open /usr/share/sendmail/dynamic started to appear, but since they did not appear for the better part of an hour, I don't imagine that they are causally related.

Since I guess I didn't actually ask anything yet, my question is: what could possibly cause a Linux server to change its IP this often, and how can I prevent it?

Searching the internet was entirely unproductive, because in most cases "many" requests means every few minutes, not hundreds per second. I can provide more information if requested, but at the moment I don't even know enough about the situation to ask a proper question about it.

  • 1
    Which debian version are you running? – StackAbstraction Sep 12 '15 at 2:17
  • Debian 8 standard, with manually installed X – Killian L. Sep 12 '15 at 4:22
  • Did you configure your DHCP server? If so, could you please tell us the details of your configuration? There are several possible reasons for this odd behavior, and we need more info to pinpoint one. – MariusMatutiae Sep 12 '15 at 7:00
  • The DHCP server for my network is just a Comcast-branded consumer router with standard configuration except for the one static IP. It's worked 'well enough' for about two months. – Killian L. Sep 12 '15 at 9:23
5

DHCP Decline messages are used to report an IP address conflict or TCP/IP config is invalid.

Please check for conflicts with any other Ethernet device even phones.

arp 10.0.0.xx (server ip)

If that reports no other devices using it, then restart router, remove/add the reservation, and lastly try a new IP. Final idea check if it might be a broadcast/routing configuration error see DHCP Decline over and over yet no conflict.

  • There are no other devices using that IP address, so I guess I'll blame the router, since it's had other issues. – Killian L. Sep 12 '15 at 4:55
  • 1
    @KillianL. Have you tried assigning the server a static IP? – AStopher Sep 12 '15 at 9:33
  • @KillianL. Did that solve your challenge? Can't hurt to call comcast and get a new router too. You can sometimes swap them at the local office (get receipts). – StackAbstraction Sep 14 '15 at 22:08
  • I actually don't know exactly how to properly assign a static IP locally because it seems that there are at least 3 different incompatible ways to do it and none of the popular guides are clearly dated. In the meantime, I killed dhclient and used ip add. I guess I will have to call Comcast, even though I'm not much for phone calls. – Killian L. Sep 15 '15 at 2:39
1

This is an older question, but I just ran into this exact problem on my personal server, so it is still relevant today.

/sbin/dhclient-script: 28: .: Can't open /usr/share/sendmail/dynamic is actually the source of your problem, believe it or not. I added set -x to the beginning of /sbin/dhclient-script and discovered the script was crashing immediately after this error. Turns out I removed sendmail while tinkering. Reinstalled and now DHCP works fine.

Supposedly this bug was fixed here, but, as this is still happening, I have my doubts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.