Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-01-2014, 08:44 AM   #1
Registered: Apr 2012
Posts: 167

Rep: Reputation: Disabled
Question ntp starts working when restarting arp


I had an issue with one of myservers who didnt want to sync its clock using ntp.

Prior solving the proplem the ntpq status was as below:

server@root$ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
============================================================================== .INIT.          16 u    -   64    0    0.000    0.000   0.000 .INIT.          16 u    -   64    0    0.000    0.000   0.000 .INIT.          16 u    -   64    0    0.000    0.000   0.000
In other words, the systen couldnt reach the ntp servers but strange thing was that i could ping and querry the ntpservers without any problems. I found a forum where the guy had a similar problem and he sort it out by clearing the arp cache.

I tried it and it worked for me as well! So as soon i cleared arp table and restarted the ntp everything worked just fine. Thing is that the post was very old and the guy didnt bother to provide further explaination hence i am left with the though "WHY"

How could the ntp corelate with the ntp?
Why when clearing arp ntp works?

Any ideas?
Old 08-01-2014, 11:27 AM   #2
Senior Member
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
There are a couple of perhaps interesting places you may want to look at about Address Resolution Protocol (ARP): and, maybe,

Something to know is what ARP does:
ARP is the process of resolving a mac address from an IP address. It is broadcasted to every host on the local subnet. The very purpose of an ARP cache, is to store the IP to MAC combination in the case that you might be sending traffic to that same host (IP/Mac address). Having the ARP cache allows you to not have to send an APR broadcast to every node on your local subnet, because you already have it in the cache!

Clearing the APR cache will cause all request that were in the ARP cache to go through the APR process again (if the node tries to communicate with them).
(from the second link above).

That is, it's local, not external.

This suggests a question or two: what does the server you're having a problem with use for DNS service (an external DNS server, BIND, a DNS server on you LAN, a DNS server in your router/switch)? It also suggests perhaps a large time difference between an external time source and your hardware or system clock (when NTP refuses to initialize it generally (but not always) means that your system clock is too far out of time for NTP to use it.

Looking at the result of your nptq -p above I note that you do not have a local server defined; I'd suggest that you add one to the server area of your /etc/ntp.conf file:
server	# local clock
fudge stratum 10	

# NTP server (list one or more) to synchronize with:
#server iburst
Defining a stratum 10 local clock lets NTP synchronize with itself when there is no external time source available (obviously, you would want to replace "us" in the above with "de").

Also, look at your start up for NTPD. Somewhere in the shell program that starts the daemon you should have a line that looks similar to this:
/usr/sbin/ntpd -g
The -g is important: it lets the first time adjustment to be big (if the system time offset is more than 1000 seconds NTPD will not synchronize, the -g argument allows it to adjust the clock).

You may want to look at your hardware clock time (in the BIOS); the (software) system clock is set from the hardware clock on boot, NTPD synchronizes the system clock while you're running and on shutdown the system clock time is written to the hardware clock. If you've not been synchronized for some period of time your system clock may have drifted enough to more than then panic threshold (1000 seconds) which is subsequently saved to the hardware clock and when you reboot you're not going to get synchronized without the above -g argument.

You can set the system time with ntpd:
ntpd -q
This sets the time (from your list of servers in /etc/ntp.conf) and quits. You should shut down NTPD if it's running before doing this. The command mimics the behavior of the ntpdate program (which will be retired). The important thing is that the servers are reachable; i.e., you can ping them.

"Reachable" means that you have a DNS server available so you can
ping -c 5
ping: unknown host
Uh-oh: this ain't good. I should be able to ping those servers: let's try something different
ping -c 5                                                      
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=40 time=1404 ms
64 bytes from ( icmp_seq=2 ttl=40 time=1121 ms
64 bytes from ( icmp_seq=3 ttl=40 time=688 ms
64 bytes from ( icmp_seq=4 ttl=40 time=716 ms
64 bytes from ( icmp_seq=5 ttl=40 time=715 ms

--- ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4044ms
rtt min/avg/max/mdev = 688.596/929.138/1404.677/287.131 ms, pipe 2
That's better.

Are your server addresses LAN addresses? If so, that explains why clearing the ARP cache got you going; you forced it to go through the ARP process again, ARP has nothing to do with external addresses.

So, anyway, that's a long, round about way of getting to what may be your problem.

Hope this helps some.
Old 08-20-2014, 04:49 AM   #3
Registered: Apr 2012
Posts: 167

Original Poster
Rep: Reputation: Disabled
OK ... so the issue was caused by two main reasons:

1) ntp was configured to operate with IPv6
2) the server for some reason lost its IPv6 gateway hence couldnt communicate to other ntp servers

Solved by switching ntpd to operate with ipv4


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
UART not working while kernel starts, but working in uboot ramesh.khokhani Linux - Kernel 2 06-24-2013 04:35 AM
[SOLVED] ntp restarting every night? rjo98 Linux - Newbie 8 02-18-2011 06:38 AM
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 08:35 PM
__attribute__ ((weak)) suddenly stops working / starts working ta0kira Programming 3 08-15-2007 12:31 PM
proxy arp not working DrowningFish Linux - Networking 2 08-25-2006 12:46 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration