I have an isolated and air-gapped LAN that I want to synchronise. I have one host that will be the authoritative time server for all clients on the LAN. It's not important that the LAN time reflects real time, but it is important that all the clients agree on the time. All hosts are running Linux.
I had hoped to configure chronyd
such that it would use the RTC on the nominated host as the authoritative time source, and provide an NTP service to clients so that they can synchronise with it. Therefore if the administrator needs to change the time on the LAN, they can update the RTC on the time server and everything should fall into sync given enough time.
Unfortunately I am not having much luck configuring chronyd
in this way. If I don't specify any time servers ("server ...
" in /etc/chrony/chrony.conf
) then chronyd
seems to operate with no sources, rather than using the local RTC as a source.
The refclock
config parameter can be used to select an external time source such as GPS or PPS, but none of the drivers seem appropriate for reading the RTC.
One idea I had is to write a small application to read the RTC and provide it as PPS data over the SOCK
driver, but further reading showed that this requires an NTP source as well since it's a sub-second measurement and not the absolute time.
Is it possible to use chronyd
in this way?
by itself in chrony.conf is sufficient to enable local system as reference.
RTCs are not perfect, they drift a lot. If you only need precision not accuracy, this may be acceptable.
Other directives are also useful.
To answer my own question, I found the Isolate-networks documentation to be partially relevant, in particular setting
chrony.conf
to include:This seems to pick up the time from RTC initially, so perhaps the use of
settime
is not needed? I'm not sure ifmanual
is necessary.