Debian Ubuntu Mint DHCP dhclient quits and how to make it persistent if first attempt to get DHCP lease fails

Debian based OS's have a similar issue as the behavior in RHEL/CentOS dhclient, which is that if you have an interface that relies on DHCP, if the first attempt fails, it will quit and stop.  This is a problem especially if you are using your Linux as a router or something else mission critical, but where the internet for some reason may have been down or the DHCP server it gets a lease from broken.

The expected behavior you would hope is that when things are back online that the device will get a lease, but this is not the default behavior.  The default is to quit dhclient.

The Debian/Mint/Ubuntu Solution

Fortunately you can just edit /etc/network/interfaces and add this line for your NIC (assuming it is eth0):

allow-hotplug will give us the desired behavior, you can test it yourself that even if the NIC is offline or internet is down, dhclient will still be running for the interfaces specified under allow-hotplug.

allow-hotplug eth0

This is the equivalent solution to the RHEL/Centos DHCP Persistent Solution

 


Tags:

debian, ubuntu, mint, dhcp, dhclient, quits, persistent, lease, failsdebian, os, rhel, centos, interface, relies, fails, linux, router, server, online, default, fortunately, edit, etc, interfaces, nic, eth, hotplug, desired, offline, specified, equivalent,

Latest Articles

  • FreePBX 17 How To Add a Trunk
  • Docker Container Onboot Policy - How to make sure a container is always running
  • FreePBX 17 How To Add Phones / Extensions and Register
  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist