FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
1,090 views 2 comments
by
Is it possible to test if NTP is working with a selected server?

I tried it over ssh but I see no possibility to test a host with ntpclient or ntpd. Also in the webconfig you can only start sync with browser or gps.

Is there a log where I can see if it is working?

1 Answer

0 votes
by anonymous

Hello,

You can use ntpclient to query NTP server, for example:

ntpclient -c 1 -h 0.lt.pool.ntp.org

You should see a single line printed like
36765 4980.373    1341.0     39.7  956761.4    839.2  0

Column headers explanation are according to http://doolittle.icarus.com/ntpclient/HOWTO
 1. day since 1900
 2. seconds since midnight
 3. elapsed time for NTP transaction (microseconds)
 4. internal server delay (microseconds)
 5. clock difference between your computer and the NTP server (microseconds)
 6. dispersion reported by server (microseconds)
 7. your computer's adjtimex frequency (ppm * 65536)

To see if NTP server is being queried you can use tcpdump command:

tcpdump -n -i any dst port 123

Query:

07:42:02.208563 IP your.public.ip.123 > 92.243.6.5.123: NTPv3, Client, length 48

Reply:

07:42:02.302573 IP 92.243.6.5.123 > your.public.ip.123: NTPv3, Server, length 48

-n: Do not resolve domain name

-i: Interface, in this case any interface

dst port 123: filter packets with destination port 123

by

Great! Thank you for your help!!!

This is what I get with tcpdump:

09:02:12.815186 IP 10.120.0.103.37564 > 91.212.242.21.123: NTPv3, Client, length 48

10.120.0.103 is the ip I have in the LAN connected to the WAN Port. But I do not understand the port 37564 ?

And whats the 92.212.242.21? It is none of the configured ntp servers.

by anonymous

Port 37564 is your outgoing / private port, it can be this high, it is normal. You can find more information here:

https://en.wikipedia.org/wiki/Ephemeral_port

92.212.242.21 is resolved from one of your NTP servers, you can resolve their domain name manually with command:

nslookup your.ntp.server.com