ntp server

Syntax

ntp server[key] [minpoll] [maxpoll][burst | iburst] [prefer] [version] no ntp serverno ntp server[burst] [iburst] [prefer] [key-id]

Description

Defines an NTP server to use for time synchronization, or updates the settings of an existing server with new values. Up to eight servers can be defined.

Thenoform of this command removes a configured NTP server.

Command context

config

Parameters

server

Specifies the address of an NTP server as a DNS name, an IPv4 address (x.x.x.x), wherexis a decimal number from 0 to 255, or an IPv6 address (xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx), wherexis a hexadecimal number from 0 to F.

When specifying an IPv4 address, you can remove leading zeros. For example, the address192.169.005.100becomes192.168.5.100.

When specifying an IPv6 address, you can use two colons (::) to represent consecutive zeros (but only once), remove leading zeros, and collapse a hextet of four zeros to a single 0. For example, this address2222:0000:3333:0000:0000:0000:4444:0055becomes2222:0:3333::4444:55.

key

Specifies the key to use when communicating with the server. A trusted key must be defined with the commandntp authentication-keyand authentication must be enabled with the commandntp authentication. Range: 1 to 65534.

minpoll

Specifies the minimum polling interval in seconds, as a power of 2. Range: 4 to 17. Default: 6 (64 seconds).

maxpoll

Specifies the maximum polling interval in seconds, as a power of 2. Range: 4 to 17. Default: 10 (1024 seconds).

burst

Send a burst of packets instead of just one when connected to the server. Useful for reducing phase noise when the polling interval is long.

iburst

Send a burst of six packets when not connected to the server. Useful for reducing synchronization time at startup . Range: 1 to 4094.

prefer

Make this the preferred server.

version

Specifies the version number to use for all outgoing NTP packets. Range: 3 or 4.

Authority

Administrators or local user group members with execution rights for this command.

Examples

Defining the ntp server pool.ntp.org, using iburst, and NTP version 4.

switch(config)#ntp server pool.ntp.org iburst version 4

Removing the ntp server pool.ntp.org.

switch(config)#no ntp server pool.ntp.org

Defining the ntp server my-ntp.mydomain.com and makes it the preferred server.

switch(config)#ntp server my-ntp.mydomain.com prefer