Debian server making many DHCP queries per second

2

1

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.

Killian L.

Posted 2015-09-12T01:14:06.427

Reputation: 21

1Which debian version are you running? – StackAbstraction – 2015-09-12T02:17:31.237

Debian 8 standard, with manually installed X – Killian L. – 2015-09-12T04:22:13.717

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 – 2015-09-12T07:00:30.170

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. – 2015-09-12T09:23:55.387

Answers

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.

StackAbstraction

Posted 2015-09-12T01:14:06.427

Reputation: 782

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. – 2015-09-12T04:55:39.003

1@KillianL. Have you tried assigning the server a static IP? – AStopher – 2015-09-12T09:33:16.007

@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 – 2015-09-14T22:08:22.367

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. – 2015-09-15T02:39:06.910

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.

Samuel A

Posted 2015-09-12T01:14:06.427

Reputation: 11