Product SiteDocumentation Site

16.8. Serving NTP Time with PTP

NTP to PTP synchronization in the opposite direction is also possible. When ntpd is used to synchronize the system clock, ptp4l can be configured with the priority1 option (or other clock options included in the best master clock algorithm) to be the grandmaster clock and distribute the time from the system clock via PTP:
~]# cat /etc/ptp4l.conf
priority1 127
# ptp4l -f /etc/ptp4l.conf
With hardware time stamping, phc2sys needs to be used to synchronize the PTP hardware clock to the system clock. If running phc2sys as a service, edit the /etc/sysconfig/phc2sys configuration file. The default setting in the /etc/sysconfig/phc2sys file is as follows:
OPTIONS="-a -r"
As root, edit that line as follows:
~]# vi /etc/sysconfig/phc2sys
OPTIONS="-a -r -r"
The -r option is used twice here to allow synchronization of the PTP hardware clock on the NIC from the system clock. Restart the phc2sys service for the changes to take effect:
~]# systemctl restart phc2sys
To prevent quick changes in the PTP clock's frequency, the synchronization to the system clock can be loosened by using smaller P (proportional) and I (integral) constants for the PI servo:
~]# phc2sys -a -r -r -P 0.01 -I 0.0001