0

I have a server with the following /etc/networking/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address <My IP>
netmask 255.255.255.248
gateway <Gateway Assigned by host>
dns-nameservers 8.8.8.8 8.8.4.4

This all looks okay to me. However, occasionally, the server will stop responding. When I log into it, eth0 is up, but only for an IPv6 address that I don't recognize. Running ifdown -a; ifup -a brings it back up to the right IP.

How can I make sure that this would happen automatically?

EDIT:

At about the time it went down, there were a few possibly related entries in /var/log/syslog:

May 29 15:28:13 main-www dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 1
May 29 15:28:14 main-www dhclient: No DHCPOFFERS received.
May 29 15:28:14 main-www dhclient: No working leases in persistent database - sleeping.
  • What do your system logs say about the loss of your static address configuration? – James S. May 30 '14 at 13:54
  • Which log would this normally be in? I wasn't able to find anything under /var/log/kern.log about it. – JeffS May 30 '14 at 13:59
  • Is this a hardware server, or a VM? If it's a VM, and the hypervisor is managed by your host, your VM may be getting migrated between Hosts, and losing connection when that happens. – James S. May 30 '14 at 14:05
  • You may wish to look at /var/log/syslog for the specific times when your interface is getting dropped. If your server is still running a desktop environment of some kind, you may still be running Network Manager, and that may be making some automated decisions about your interface, as well, but that seems unlikely. More generally; kern.log is unsurprisingly only kernel messages. /var/log/messages is non-critical but still important system logging. syslog aggregates these two (and other things, based upon your syslog.conf) – James S. May 30 '14 at 14:06
  • See my edit for some possibly relevant logs, the server is a hardware server, with a SuperMicro board, with two Intel I350 NICs. – JeffS May 30 '14 at 14:17
1

The solution was to run sudo killall dhclient.

It turns out that at one point this server was running with DHCP.

The /etc/networking/interfaces file was edited while the interface was still up, so ifdown -a didn't kill dhclient. When the DHCP lease expired, dhclient would run, attempt to get a configuration, fail, and reset the IP to a default configuration, taking the server offline.

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.