summaryrefslogtreecommitdiff
path: root/data/templates/chrony/chrony.conf.j2
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-09-24 10:08:55 +0100
committerGitHub <noreply@github.com>2024-09-24 10:08:55 +0100
commitcf55d9db374cccb263d671a4e9c7ba8e2cd93df5 (patch)
tree1135752fb44b0c0c2e16d0baac50009d8c7dc831 /data/templates/chrony/chrony.conf.j2
parent644a91e970c96de01d2e17a7ea91502b8f7265e6 (diff)
parent917c658e37b619b1b2cd261ae43dd02f11eef720 (diff)
downloadvyos-1x-cf55d9db374cccb263d671a4e9c7ba8e2cd93df5.tar.gz
vyos-1x-cf55d9db374cccb263d671a4e9c7ba8e2cd93df5.zip
Merge pull request #3966 from lucasec/t6630
T6630: ntp: support hardware timestamp offload and other mechanisms to improve accuracy
Diffstat (limited to 'data/templates/chrony/chrony.conf.j2')
-rw-r--r--data/templates/chrony/chrony.conf.j217
1 files changed, 16 insertions, 1 deletions
diff --git a/data/templates/chrony/chrony.conf.j2 b/data/templates/chrony/chrony.conf.j2
index e3f078fdc..2838f5524 100644
--- a/data/templates/chrony/chrony.conf.j2
+++ b/data/templates/chrony/chrony.conf.j2
@@ -42,7 +42,7 @@ user {{ user }}
{% if config.pool is vyos_defined %}
{% set association = 'pool' %}
{% endif %}
-{{ association }} {{ server | replace('_', '-') }} iburst {{ 'nts' if config.nts is vyos_defined }} {{ 'noselect' if config.noselect is vyos_defined }} {{ 'prefer' if config.prefer is vyos_defined }}
+{{ association }} {{ server | replace('_', '-') }} iburst {{- ' nts' if config.nts is vyos_defined }} {{- ' noselect' if config.noselect is vyos_defined }} {{- ' prefer' if config.prefer is vyos_defined }} {{- ' xleave' if config.interleave is vyos_defined }} {{- ' port ' ~ ptp.port if ptp.port is vyos_defined and config.ptp is vyos_defined }}
{% endfor %}
{% endif %}
@@ -66,3 +66,18 @@ bindaddress {{ address }}
binddevice {{ interface }}
{% endif %}
{% endif %}
+
+{% if ptp.timestamp.interface is vyos_defined %}
+# Enable hardware timestamping on the specified interfaces
+{% for iface, iface_config in ptp.timestamp.interface.items() %}
+{% if iface == "all" %}
+{% set iface = "*" %}
+{% endif %}
+hwtimestamp {{ iface }} {{- ' rxfilter ' ~ iface_config.receive_filter if iface_config.receive_filter is vyos_defined }}
+{% endfor %}
+{% endif %}
+
+{% if ptp.port is vyos_defined %}
+# Enable sending and receiving NTP over PTP packets (PTP transport)
+ptpport {{ ptp.port }}
+{% endif %}