Skip to content

NTP

NTP (Network Time Protocol) maintains accurate and consistent time synchronization across NX-OS devices by synchronizing with authoritative time sources through configurable server and peer relationships. It supports authentication for time source integrity, master mode with stratum configuration for local time authority, passive mode, source interface selection, access group restrictions, and logging with adjustable severity levels for time synchronization events. NTP server and peer entries provide granular control over VRF assignment, key-based authentication, preferred source selection, and configurable minimum/maximum polling intervals.

NameTypeConstraintMandatoryDefault Value
devicesListdevicesNo
device_groupsListdevice_groupsNo
globalClassglobalNo
templatesListtemplatesNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
ntpClassntpNo

NameTypeConstraintMandatoryDefault Value
authenticateBooleantrue, falseNo
loggingBooleantrue, falseNo
logging_levelChoiceemergency, alert, critical, error, warning, notif, inform, debugNo
masterBooleantrue, falseNo
master_stratumIntegermin: 1, max: 15No
passiveBooleantrue, falseNo
allow_controlBooleantrue, falseNo
allow_privateBooleantrue, falseNo
allow_control_rate_limitIntegermin: 1, max: 65535No
source_interface_typeChoiceethernet, loopback, mgmt, port-channel, vlan, vniNo
source_interface_idAnyString or Integer[min: 0]No
access_group_match_allBooleantrue, falseNo
access_group_peerStringNo
access_group_query_onlyStringNo
access_group_serveStringNo
access_group_serve_onlyStringNo
authentication_keysListauthentication_keysNo
serversListserversNo
peersListpeersNo

NameTypeConstraintMandatoryDefault Value
authenticateBooleantrue, falseNo
loggingBooleantrue, falseNo
logging_levelChoiceemergency, alert, critical, error, warning, notif, inform, debugNo
masterBooleantrue, falseNo
master_stratumIntegermin: 1, max: 15No
passiveBooleantrue, falseNo
allow_controlBooleantrue, falseNo
allow_privateBooleantrue, falseNo
allow_control_rate_limitIntegermin: 1, max: 65535No
source_interface_typeChoiceethernet, loopback, mgmt, port-channel, vlan, vniNo
source_interface_idAnyString or Integer[min: 0]No
access_group_match_allBooleantrue, falseNo
access_group_peerStringNo
access_group_query_onlyStringNo
access_group_serveStringNo
access_group_serve_onlyStringNo
serversListserversNo
peersListpeersNo

authentication_keys (nxos.devices.configuration.ntp)

Section titled “authentication_keys (nxos.devices.configuration.ntp)”
NameTypeConstraintMandatoryDefault Value
idIntegermin: 1, max: 65535Yes
typeChoicemd5, aes128cmacNo
keyStringNo
key_encryptionChoice0, 6, 7No
trustedBooleantrue, falseNo

NameTypeConstraintMandatoryDefault Value
ipIPYes
use_vrfStringNo
keyIntegermin: 1, max: 65535No
preferBooleantrue, falseNo
minpollIntegermin: 4, max: 16No
maxpollIntegermin: 4, max: 16No

NameTypeConstraintMandatoryDefault Value
ipIPYes
use_vrfStringNo
keyIntegermin: 1, max: 65535No
preferBooleantrue, falseNo
minpollIntegermin: 4, max: 16No
maxpollIntegermin: 4, max: 16No

Example 1: Basic NTP with redundant time servers

nxos:
devices:
- name: LEAF1
configuration:
ntp:
logging: true
servers:
- ip: 10.50.100.1
prefer: true
use_vrf: management
- ip: 10.50.100.2
use_vrf: management

Example 2: NTP with authentication enabled for secure time synchronization

nxos:
devices:
- name: SPINE1
configuration:
ntp:
authenticate: true
logging: true
authentication_keys:
- id: 1
type: md5
key: NtpS3cr3t
key_encryption: "0"
trusted: true
servers:
- ip: 10.50.100.1
prefer: true
use_vrf: management
key: 1
- ip: 10.50.100.2
use_vrf: management
key: 1

Example 3: NTP with custom polling intervals and master fallback

nxos:
devices:
- name: BORDER-LEAF1
configuration:
ntp:
authenticate: true
logging: true
master: true
master_stratum: 8
source_interface_type: loopback
source_interface_id: "0"
authentication_keys:
- id: 1
type: aes128cmac
key: NtpS3cr3t
key_encryption: "0"
trusted: true
servers:
- ip: 10.50.100.1
prefer: true
use_vrf: management
key: 1
minpoll: 6
maxpoll: 10
- ip: 10.50.100.2
use_vrf: management
key: 1

Example 4: NTP with access group restrictions

nxos:
devices:
- name: SPINE1
configuration:
ip_access_lists:
- name: NTP-PEER-ACL
entries:
- sequence_number: 10
action: permit
protocol: ip
source:
prefix: 10.50.100.0
prefix_length: 24
- name: NTP-SERVE-ACL
entries:
- sequence_number: 10
action: permit
protocol: ip
source:
prefix: 10.0.0.0
prefix_length: 8
ntp:
authenticate: true
logging: true
source_interface_type: loopback
source_interface_id: "0"
access_group_match_all: true
access_group_peer: NTP-PEER-ACL
access_group_serve: NTP-SERVE-ACL
authentication_keys:
- id: 1
type: md5
key: NtpS3cr3t
key_encryption: "0"
trusted: true
servers:
- ip: 10.50.100.1
prefer: true
use_vrf: management
key: 1
- ip: 10.50.100.2
use_vrf: management
key: 1

Example 1: Basic NTP with redundant time servers

nxos:
devices:
- name: LEAF1
configuration:
ntp:
logging: true
servers:
- ip: 10.50.100.1
prefer: true
use_vrf: management
- ip: 10.50.100.2
use_vrf: management

Example 2: NTP with authentication enabled for secure time synchronization

nxos:
devices:
- name: SPINE1
configuration:
ntp:
authenticate: true
logging: true
servers:
- ip: 10.50.100.1
prefer: true
use_vrf: management
key: 1
- ip: 10.50.100.2
use_vrf: management
key: 1

Example 3: NTP with custom polling intervals and master fallback

nxos:
devices:
- name: BORDER-LEAF1
configuration:
ntp:
authenticate: true
logging: true
master: true
master_stratum: 8
source_interface_type: loopback
source_interface_id: "0"
servers:
- ip: 10.50.100.1
prefer: true
use_vrf: management
key: 1
minpoll: 6
maxpoll: 10
- ip: 10.50.100.2
use_vrf: management
key: 1

Example 4: NTP with access group restrictions

nxos:
devices:
- name: SPINE1
configuration:
ip_access_lists:
- name: NTP-PEER-ACL
entries:
- sequence_number: 10
action: permit
protocol: ip
source_address: 10.50.100.0
source_wildcard: 0.0.0.255
- name: NTP-SERVE-ACL
entries:
- sequence_number: 10
action: permit
protocol: ip
source_address: 10.0.0.0
source_wildcard: 0.255.255.255
ntp:
authenticate: true
logging: true
source_interface_type: loopback
source_interface_id: "0"
access_group_match_all: true
access_group_peer: NTP-PEER-ACL
access_group_serve: NTP-SERVE-ACL
servers:
- ip: 10.50.100.1
prefer: true
use_vrf: management
key: 1
- ip: 10.50.100.2
use_vrf: management
key: 1