Network Time Protocol (NTP) is used for centralized synchronization of the date and time of devices. It works over UDP port 123.
NTP operation modes:
- Server: the device synchronizes with a source of a lower layer and provides time synchronization with servers or clients of a higher layer.
- Client: The device synchronizes its clock with an NTP server.
- Peer: The device exchanges time information with another peer device.
- Broadcast/multicast: The device functions as an NTP server but sends the time information to any device that listens to it. Because the “push” is in one direction only, time accuracy may suffer somewhat.
NTP server configuration.
Switch(config)# ntp server ip-address [ prefer ] [ version { 3 | 4 } ]
Set the time zone according to your location and enable daylight saving time:
Switch(config)# clock timezone EST-5.
Example:
Switch(config)# ntp server 10.1.1.1.1 prefer
Switch(config)# ntp server 10.99.99.45
Verification commands:
Switch# show clock
Switch# show ntp status
Switch# show ntp associations