Why dhclient is still running when I choose static IP?

  1. You first have to shutdown the interface (in dhcp mode) sudo ifdown eth0
  2. Then edit the config nano /etc/network/interfaces

    # The primary network interface
    auto eth0
    iface eth0 inet static
    netmask 255.255.0.0
    address 10.10.130.128
    gateway 10.10.1.1
    
  3. Bring the interface back up sudo ifup eth0

Otherwise dhclient doesn't correctly shuts down,


I had the same issue (Ubuntu 16.04). However, this was a cloud instance and I could not ifdown the interface that easily.

Short answer: I removed the file /etc/network/interfaces.d/50-cloud-init.cfg ifup was triggered by that specific file.

Long answer: I configured the interface using the /etc/network/interfaces with a static IP address, but I still found in the daemon.log that dhclient was still requesting IP's from the DHCP and dhclient was started through systemd. Specifically, systemd called the networking.service unit, which called ifup, which read both the interfaces file and the 50-cloud-init.cfg file. Resulting in some conflicts, but still a functional network.