NTP
NX-OSNTP (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.
Diagram
Section titled “Diagram”Diagram
Section titled “Diagram”Classes
Section titled “Classes”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| devices | List | devices | No | |
| device_groups | List | device_groups | No | |
| global | Class | global | No | |
| templates | List | templates | No |
devices (nxos)
Section titled “devices (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
device_groups (nxos)
Section titled “device_groups (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
global (nxos)
Section titled “global (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
templates (nxos)
Section titled “templates (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| configuration | Class | configuration | No |
configuration (nxos.devices)
Section titled “configuration (nxos.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ntp | Class | ntp | No |
ntp (nxos.devices.configuration)
Section titled “ntp (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| authenticate | Boolean | true, false | No | |
| logging | Boolean | true, false | No | |
| logging_level | Choice | emergency, alert, critical, error, warning, notif, inform, debug | No | |
| master | Boolean | true, false | No | |
| master_stratum | Integer | min: 1, max: 15 | No | |
| passive | Boolean | true, false | No | |
| allow_control | Boolean | true, false | No | |
| allow_private | Boolean | true, false | No | |
| allow_ | Integer | min: 1, max: 65535 | No | |
| source_ | Choice | ethernet, loopback, mgmt, port-channel, vlan, vni | No | |
| source_ | Any | String or Integer[min: 0] | No | |
| access_ | Boolean | true, false | No | |
| access_ | String | No | ||
| access_ | String | No | ||
| access_ | String | No | ||
| access_ | String | No | ||
| authentication_ | List | authentication_ | No | |
| servers | List | servers | No | |
| peers | List | peers | No |
ntp (nxos.devices.configuration)
Section titled “ntp (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| authenticate | Boolean | true, false | No | |
| logging | Boolean | true, false | No | |
| logging_level | Choice | emergency, alert, critical, error, warning, notif, inform, debug | No | |
| master | Boolean | true, false | No | |
| master_stratum | Integer | min: 1, max: 15 | No | |
| passive | Boolean | true, false | No | |
| allow_control | Boolean | true, false | No | |
| allow_private | Boolean | true, false | No | |
| allow_ | Integer | min: 1, max: 65535 | No | |
| source_ | Choice | ethernet, loopback, mgmt, port-channel, vlan, vni | No | |
| source_ | Any | String or Integer[min: 0] | No | |
| access_ | Boolean | true, false | No | |
| access_ | String | No | ||
| access_ | String | No | ||
| access_ | String | No | ||
| access_ | String | No | ||
| servers | List | servers | No | |
| peers | List | peers | No |
authentication_keys (nxos.devices.configuration.ntp)
Section titled “authentication_keys (nxos.devices.configuration.ntp)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | min: 1, max: 65535 | Yes | |
| type | Choice | md5, aes128cmac | No | |
| key | String | No | ||
| key_encryption | Choice | 0, 6, 7 | No | |
| trusted | Boolean | true, false | No |
servers (nxos.devices.configuration.ntp)
Section titled “servers (nxos.devices.configuration.ntp)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ip | IP | Yes | ||
| use_vrf | String | No | ||
| key | Integer | min: 1, max: 65535 | No | |
| prefer | Boolean | true, false | No | |
| minpoll | Integer | min: 4, max: 16 | No | |
| maxpoll | Integer | min: 4, max: 16 | No |
peers (nxos.devices.configuration.ntp)
Section titled “peers (nxos.devices.configuration.ntp)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ip | IP | Yes | ||
| use_vrf | String | No | ||
| key | Integer | min: 1, max: 65535 | No | |
| prefer | Boolean | true, false | No | |
| minpoll | Integer | min: 4, max: 16 | No | |
| maxpoll | Integer | min: 4, max: 16 | No |
Examples
Section titled “Examples”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: managementExample 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: 1Example 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: 1Example 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: 1Examples
Section titled “Examples”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: managementExample 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: 1Example 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: 1Example 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