1

I inherited VM server with two guests (with Debian) running with static IPs (they work fine).

I created new guest (Debian 8.5) and configured it with static IP through /etc/network/interfaces in same way the other guests are configured (standard iface eth0 inet static etc).

On this guest once a 24h IP reverses to DHCP configuration but after restarting eth0 it works with static IP again.

All guests are on the same vSwitch and in the same virtual network (connected to the same Physical Adapter).

I am managing VMs with vSphere Client 5.5.

/etc/network/interfaces on the guests:

This one is working correctly:

# The loopback network interface  
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.40
    netmask 255.255.255.0
    broadcast 192.168.1.255
    gateway 192.168.1.1
      dns-nameservers 8.8.8.8

This one is keep going back to dhcp:

# The loopback network interface  
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    broadcast 192.168.1.255
    gateway 192.168.1.1
      dns-nameservers 8.8.8.8 4.4.4.4
0

Look at the discussion and answers on this question. That question is about Raspbian (the Rasperry Pi OS) but the general problem sounds the same. The solution seems to be disabling DHCP or adjusting the DHCP config to set the static IP there.

To set a static value to DHCP, just edit this file /etc/dhcpcd.conf and adjust the config like this example to force a static IP to the specified interface; in this case eth0:

static <value>
             Configures a static <value>.  If you set ip_address then dhcpcd
             will not attempt to obtain a lease and just use the value for the
             address with an infinite lease time.

             Here is an example which configures a static address, routes and
             dns.
                   interface eth0
                   static ip_address=192.168.0.10/24
                   static routers=192.168.0.1
                   static domain_name_servers=192.168.0.1

To disable DHCP for a specific interface—like eth0—just edit /etc/dhcpcd.conf and add this line to the config to force DHCP to simply not care about eth0:

denyinterfaces eth0
|improve this answer|||||

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