We have 2 VLANs, each VLAN has a server that provides DHCP, DNS and NTP to its corresponding VLAN. These 3 servers take time from a local NTP server. Here is the configuration of NTP client and servers on each VLAN and the problem of each setup:
VLAN 1:
NTP Server (Scientific Linux 7.3)
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
logfile /var/log/ntp.log
driftfile /var/lib/ntp/drift
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
restrict 127.0.0.1
restrict xx.xx.xx.xx mask XX.XX.XX.XX nomodify notrap
NTP Client (Scientific Linux 7.3)
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server yy.yy.yy.yy # added by /sbin/dhclient-script
This server is always drifting 3 hours forward despite the correct timezone.
VLAN 2:
NTP Server (Scientific Linux 6.4)
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
logfile /var/log/ntp.log
server 127.1.1.0 # local clock
fudge 127.127.1.0
driftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict xx.xx.xx.xx mask XX.XX.XX.XX nomodify notrap
NTP Client (Scientific Linux 6.4)
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server yy.yy.yy.yy # added by /sbin/dhclient-script
Here I could not change the time zone. It should be EET but it is always EEST despite the /etc/localtime link value.
I have made sure that:
- No firewall rules (
iptables -F) ntpddaemon is running and enabled (chckonfig on)- CentOS 7.x uses another time service called
chronydwhich blocksntpdfrom startup. So I disabled it (Lost the source for this :( ).
After setting up these services, we synchronized them with our local NTP once. Through the DHCP configuration on each server we have option ntp-servers xx.xx.xx.xx; so the NTP information is distributed withing DHCP. I tried adding the local NTP server's address to the server's /etc/ntp.conf but the problem is still there.
Note that all servers are virtualized through VMWare ESXi.
/etc/localtimelinked to? Are all machines running on UTC system time (they should be)? Is the current time summer time or winter time where you are? EEST is UTC +3 hours./usr/share/zoneinfo/EETbut thedatecommand always showsEEST. It is still winter time here, by the end of the week will be switching to EEST/usr/share/zoneinfo/Asia/Amman. If you are in Syria, use/usr/share/zoneinfo/Asia/Damascus. Not all countries in the EET zone switches to summer time at the same time, so you'll need to be a bit more specific when you pick the time zone.