Configure Chrony for CNX NTS
Use this guide after CNX enables your subscription or trial. Install a
version of Chrony with NTS support. From the client, allow DNS resolution,
HTTPS access to crl.cnx.net.kh for the CA download, and outbound
TCP/4460 for NTS key establishment and UDP/123 for NTP, including reply
traffic. Set the system clock reasonably close to the current time so TLS
certificate validity checks can pass.
Install the CNX CA certificate
sudo mkdir -p /etc/chrony/certs
sudo curl -fsS https://crl.cnx.net.kh/cnx_ca.crt -o /etc/chrony/certs/cnx_ca.crtConfigure the time sources
Use your distribution's default configuration file and systemd unit.
| Distribution | Configuration file | systemd unit |
|---|---|---|
| Debian, Ubuntu | /etc/chrony/chrony.conf | chrony.service |
| RHEL, Fedora | /etc/chrony.conf | chronyd.service |
If the service starts chronyd with -f, edit the file specified by
that option. Add the following to the active configuration:
server kph.nts.cnx.net.kh iburst nts
server sct.nts.cnx.net.kh iburst nts
server bdc.nts.cnx.net.kh iburst nts
ntstrustedcerts /etc/chrony/certs/cnx_ca.crt
To keep clock synchronization limited to the CNX sources, disable any
other server, pool, or peer entries in the active configuration
and its included source files. If you want to observe an independent NTP
comparison and your network policy permits it, add this optional line:
pool pool.ntp.org iburst maxsources 2 noselect
Chrony measures up to two sources from the public pool. noselect
keeps them out of clock selection and combining, so they cannot serve as
fallback sources. The pool measurements are unauthenticated.
Restart Chrony to load the configuration.
- Debian and Ubuntu use
sudo systemctl restart chrony.service. - RHEL and Fedora use
sudo systemctl restart chronyd.service.
Verify NTS authentication and clock selection
chronyc -N authdata
chronyc -N sources
In authdata, check that all three CNX endpoints show NTS in the
Mode column and have a non-zero cookie count (Cook). The following
example shows the CNX rows from a test after restarting Chrony:
Name/IP address Mode KeyID Type KLen Last Atmp NAK Cook CLen
=========================================================================
kph.nts.cnx.net.kh NTS 1 30 128 20m 0 0 7 64
sct.nts.cnx.net.kh NTS 1 30 128 30 0 0 8 64
bdc.nts.cnx.net.kh NTS 3 30 128 21m 0 0 7 64
In sources, non-zero Reach indicates recent NTP responses. Look for
^* next to one CNX endpoint once Chrony has collected enough samples.
In this test, Chrony selected bdc. The selected endpoint can change.
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^- kph.nts.cnx.net.kh 1 7 17 130 -35us[ -131us] +/- 2234us
^- sct.nts.cnx.net.kh 1 7 17 1 +601us[ +601us] +/- 2939us
^* bdc.nts.cnx.net.kh 1 7 27 2 +37us[ -71us] +/- 2018us
If a CNX source has no cookies after startup, check the service journal,
system time, CNX CA file, and TCP/4460 connectivity. If cookies are present
but Reach stays at zero, check UDP/123 and the return path.
See the Chrony manuals for
chrony.conf
and chronyc.