1. Overview
Network Time Protocol (NTP) provides accurate time across a whole network of devices such as routers or switches and synchronizes time among these devices on a network. NTP uses an NTP server that maintains a highly accurate time. An NTP network is comprised of devices (clients) that are to be synchronized with the NTP server that has UTC time and provides it to the client devices.
1.1. Prerequisites
-
Install and configure an NTP server on your network and remember the IP address of the NTP server.
1.2. Supported Platforms
Not all features are necessarily supported on each hardware platform. Refer to the Platform Guide for the features and the sub-features that are or are not supported by each platform.
2. NTP Configuration
2.1. Configuration Syntax and Commands
The following sections describe the NTP configuration syntax and commands.
2.1.1. Specifying the NTP Server
To configure the NTP server, you must specify details such as the IPv4 address and the domain name of the NTP server.
Syntax
set system ntp server <server-id>
Attribute | Description |
---|---|
server <server-id> |
Specifies the name of the NTP server. |
ipv4-address <ipv4-address> |
Specifies the IPv4 address of the NTP server. |
domain-name <domain-name> |
Specifies the domain name of the NTP server. |
Example:
{ "ietf-restconf:data": { "rtbrick-config:system": { "ntp": { "server": [ { "server-name": "Server1", "ipv4-address": "198.51.100.100" } ] } }, } }
2.1.2. NTP Service Configuration
You can enable the NTP service under a specific VRF where NTP server is reachable (usually, the inband management VRF).
Syntax:
set inband-management instance <name> ntp
Attribute | Description |
---|---|
<name> <instance-name> |
Name of the instance |
true/false |
Enable or disable Network Time Protocol. |
Example: NTP Configuration
{ "rtbrick-config:inband-management": { "instance": [ { "name": "mgmt-vrf", "ntp": "true" } ] } }
2.2. Setting the System Date & Time Using DHCP Option 42 NTP Servers Information
The RtBrick ONL installer image performs a boot time ntpdate operation to set the system date and time.
By default, it uses the pool.ntp.org but DHCP bindings received over the ma1 interface will override it if DHCP option 42 contains a list of one or more NTP servers.
Separately from this boot time setting, the system will continue to use NTPd to maintain accurate system date and time using the list of NTP servers contained in the RBFS configuration.
The /etc/ntp.boot-time-servers.conf
file can be used to verify as its contents will be updated with the NTP servers from DHCP. Also, logs are available in /var/log/rtbrick-boot-time-ntpdate.log
.
3. NTP Operational Commands
3.1. Verifying NTP Service on Linux
To get more information about NTP’s status, use the ntpq
command:
The command displays the NTP servers that the system is synchronized with.
supervisor@rtbrick>LEAF01:~ $ sudo ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== 198.51.100.5 .XFAC. 16 u - 64 0 0.000 0.000 0.000
©Copyright 2023 RtBrick, Inc. All rights reserved. The information contained herein is subject to change without notice. The trademarks, logos and service marks ("Marks") displayed in this documentation are the property of RtBrick in the United States and other countries. Use of the Marks are subject to RtBrickās Term of Use Policy, available at https://www.rtbrick.com/privacy. Use of marks belonging to other parties is for informational purposes only.