Question : How Can we test the connectivity to NTP server from NTP client?
To check the connectivity to NTP server from NTP client execute the command :
# ntpq -p
ntpdate -d [ntp server]
1. If a ‘*‘ sign is seen against the NTP server, in the output of the ‘ntpq -p’ command, it means that ntp client is syncing with that ntp server.
# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== *192.168.122.38 10.16.255.1 2 u - 16 37 0.165 -0.035 0.018
2. Alternatively, if you’d like to see if your ntp client is capable of receiving ntp related udp traffic, you may execute the below command.
# nmap -sU 10.10.10.10 -p 123 ==> port 123 is for NTP and '-sU' is for scanning UDP ports. Starting Nmap 5.51 ( http://nmap.org ) at 2015-10-29 02:47 IST Nmap scan report for 10.10.10.10 (192.168.122.38) Host is up (0.00018s latency). PORT STATE SERVICE 123/udp open ntp MAC Address: 52:54:00:E7:D2:96 (QEMU Virtual NIC) Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds
3. If you want to know if at any given instance, the ntp client is able to receive ntp traffic from a ntp source, you may execute the below command from ntp client.
# ntpdate -d 10.10.10.10 ==> 10.10.10.10 in this illustration is the ntp server. 29 Oct 02:46:02 ntpdate: ntpdate firstname.lastname@example.org Thu Jan 10 15:17:41 UTC 2013 (1) Looking for host 10.10.10.10 and service ntp host found : 192.168.122.38 transmit(192.168.122.38) receive(192.168.122.38) transmit(192.168.122.38) receive(192.168.122.38) ..snip.. 29 Oct 02:46:02 ntpdate: adjust time server 192.168.122.38 offset -0.000036 sec