0
# uptime -s
2020-10-31 15:24:21

# head -1 /var/log/syslog
Oct 31 15:50:53 ...

OBSERVATION: uptime is before the 1st timestamp in syslog

DHCP IP IS GOT at 15:51

Oct 31 15:51:34 dhclient[841]: DHCPOFFER of 10.50.51.49 from 10.50.51.102
Oct 31 15:51:38 dhclient[841]: bound to 10.50.51.49 -- renewal in 145 seconds

NTP Sync kicks in and time goes back to 15:25 (goes back by ~25 mins)

Oct 31 15:52:03 ntpd[944]: ...
Oct 31 15:25:42 ntpd[944]: ntpd: time set -1588.158001 s

NTP also seem to delete the interface due to time set

Oct 31 15:30:09 ntpd[1278]: Deleting interface #3 eth0, 10.50.51.49#123, interface stats: received=27, sent=27, dropped=0, active_time=226 secs

Next renewal happens at 15:54

Oct 31 15:54:03 dhclient[841]: DHCPREQUEST for 10.50.51.49 on eth0 to 10.50.51.102

DHCP renewal is not happening ~145 seconds but rather 25 odd mins due to NTP

I am on ubuntu 20.04 with following packages installed:

# dpkg -l | grep dhc
ii  isc-dhcp-client                  4.4.1-2.1ubuntu5                  amd64        DHCP client for automatically obtaining an IP address
# dpkg -l | grep bind
ii  bind9-dnsutils                   1:9.16.1-0ubuntu2.4               amd64        Clients provided with BIND 9
ii  bind9-host                       1:9.16.1-0ubuntu2.4               amd64        DNS Lookup Utility
ii  bind9-libs:amd64                 1:9.16.1-0ubuntu2.4               amd64        Shared Libraries used by BIND 9

DHCP process running:

root         841  0.0  0.2  99896  5960 ?        Ssl  Oct31   0:00 /sbin/dhclient -1 -4 -v -i -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases -I -df /var/lib/dhcp/dhclient6.eth0.leases eth0
3
  • 1
    It is important to Linux that the time is correct. Why is your system going backwards 25 minutes for NTP? That is going to cause all sorts of issues because the file that it written when DHCP runs is now in the future so it will have to wait until that time passes before it can run again. – Terrance Nov 1 '20 at 3:47
  • The deployment is a VM and it comes up with the wrong time. Is there any neat solution where in dhcp doesn't depend on system time / force a renew when there is a time change happening ? – Aravindhan Krishnan Nov 1 '20 at 5:12
  • Give the VM either a DHCP Reservation so that it gets the same IP every time, or give the VM a static IP that does not rely on the DHCP. Or fix the VM to have the correct time so DHCP works properly. Other than that, DHCP relies heavily on the system time for lease expiration and renewals. Having incorrect time can also cause problems with updates and upgrades since files rely heavily on timestamps as well. – Terrance Nov 1 '20 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.