• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Command ntpstat Shows unsynchronised (CentOS/RHEL)

By admin

The ntpstat command output shows “unsynchronised”:

# ntpstat 
unsynchronised
time server re-starting

The “ntpq -p ” command output shows none of ntp servers is chosen:

# ntpq -p
==========================================
   remote           refid      st t when poll reach   delay   offset  jitter
===============================================
ntp-server   .INIT.          16 u    -   16    0    0.000    0.000   0.000
ntp-server   .INIT.          16 u    -   16    0    0.000    0.000   0.000

The as command output shows both ntp servers are rejected:

# ntpq> as
ind assID status conf reach auth condition last_event cnt
===========================================================
1 54459 8000 yes yes none reject
2 54460 8000 yes yes none reject

The rv command output shows both ntp servers are in “unreach” status:

# ntpq> rv 54459
assID=54459 status=8000 unreach, conf, no events,
srcadr=, srcport=123, dstadr=x.x.x.x, dstport=123, leap=11,
..........
# ntpq> rv 54460
assID=54460 status=8000 unreach, conf, no events,
srcadr=, srcport=123, dstadr=x.x.x.x, dstport=123, leap=11,
..........

The Solution

“restrict default ignore” in ntp configuration file prevents the access from remote ntp server. The ntp configuration file is as following:

# cat /etc/ntp.conf
restrict default kod nomodify notrap nopeer noquery ignore
restrict -6 default kod nomodify notrap nopeer noquery ignore
...

“restrict default ignore” will prevent access not only from all clients but also from all remote ntp servers.

Solution 1

1. Edit /etc/ntp.conf and modify the configuration to allow unrestricted access from all machines:

Change from:

restrict default kod nomodify notrap nopeer noquery ignore
restrict -6 default kod nomodify notrap nopeer noquery ignore

To

restrict default
restrict -6 default

2. Restart ntpd service:

# service ntpd restart

3. Wait for a few minutes, then run “ntpq -p” to check if it works.

Solution 2

1. Edit /etc/ntp.conf and modify the configuration to allow unrestricted access from a specific ntp server:

Change from:

restrict default kod nomodify notrap nopeer noquery ignore
restrict -6 default kod nomodify notrap nopeer noquery ignore

To

restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict xxx.xxx.xxx.xxx (IP address of a specific ntp server)

2. Restart ntpd service:

# service ntpd restart

3. Wait for a few minutes, then run “ntpq -p” to check if it works.

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, Linux

Some more articles you might also be interested in …

  1. How to Migrate CentOS/RHEL 6 iptables Rules to CentOS/RHEL 7 firewalld
  2. How to extract RAR files in CentOS/RHEL 7 and 8
  3. How to use the “screen” command in Linux
  4. Understanding TCP Wrappers (/etc/hosts.allow & /etc/hosts.deny) in Linux
  5. How to prevent SSH connections from disconnecting due to inactivity when using MobaXterm
  6. Understanding SELinux Policies in Linux
  7. pvcreate error : Can’t open /dev/sdx exclusively. Mounted filesystem?
  8. How to Extend the Last Existing Filesystem Partition with Parted
  9. How to Find Number of CPU Sockets on a CentOS/RHEL System
  10. iSCSI connection command examples (Cheat Sheet)

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary