NTP
- Network Time Protocol (NTP) is a protocol to synchronize time and calendar between devices, since manually configured clocks will drift over time
- NTP and Cisco use UTC by default, so the time zone must be set locally
- There a certain amount of inaccuracy allowed depending on proximity to NTP Server (1millisecond for same LAN, 50ms over the WAN)
- NTP Communicates over UDP 123
NTP Modes
- Cisco devices can act in one or more three NTP modes
- Server mode
- Client mode
- Clients request time from servers
- Symmetric active mode
- Two peer devices (in the same stratum) will help keep each other synchronized
NTP Stratum
- The distance between NTP Servers and the original reference clock is called the stratum
- Reference clocks (atomic clocks or GPS clocks) are Stratum 0
- They are the original time sources
- Stratum 1 NTP servers are called Primary servers and get their time from the reference clocks
- Stratum 2 from Stratum 1 And so on down the list
- Stratum 2 and above servers are called secondary servers and they operate in both server mode and client mode
- Anything beyond Stratum 15 is considered unreliable, and cannot be an NTP
Cisco Clocks
- Clock is a software clock, and Calendar is a hardware clock
- Clock and Calendar are configurable in privileged exec mode
- Default time is in UTC
- Time zone and NTP must be configured in global config mode
Commands
NTP Commands
config# ntp server <IP address>
- Adds NTP server addresses to the associations table
config# ntp source <interface>
- Configured the interface that NTP messages are programmed to send and receive from
- Best practice to use Loopback interfaces, since they are not depending on the status of a physical interface
# show ntp associations
- Shows all servers the NTP client is configured to connect to
* indicates the server it is syncing with
+ indicates a server that may be synced with
~ indicates a configured (vs. dynamic?) association
# show ntp status
- Clock synchronized or not
- Stratum level
- NTP server (reference) address
config# ntp update-calendar
- Keeps the hardware Calendar up to date
config# ntp master <stratum level>
- Sets an NTP Server to act as a "Master" server on the network
- The associated address will be a Loopback address (NOT Loopback interface) for the local device
- Default stratum level is 8
- The loopback address (not interface) is assigned a stratum of 7
config# ntp peer <IP address>
- Configures a device as a candidate on the associations table
NTP Authentication
config# ntp authenticate
- Enable NTP authentication
config# ntp authentication-key <key number> md5 <key>
- key numbers must match between authenticating devices
- key is a custom password
config# ntp trusted-key <key number>
- Specifies which authentication keys from clients are trusted
config# ntp [server|peer] <ip address> key <key number>
- Identifies which key to use with which server or peer
- This command is only run on the client
Calendar (hardware clock)
# show calendar
- Show hardware clock config
# calendar set <time> <day> <month> <year>
- Set the hardware clock
Clock (software clock)
# show clock <detail>
- Default timezone is UTC
- An
* at the beginning of the output indicates that the time is not considered authoritative/accurate
- Detail shows the source, such as hardware calendar, user config, or NTP
# clock set <time> <day> <month> <year>
- Manually set the clock time and date
# clock update-calendar
- Synchronize the hardware Calendar to the Clock time
# clock read-calendar
- Synchronize the software Clock to the hardware Calendar time
config# clock timezone <name for timezone> <hours offest> <minutes offset>
- Name does not have to match actual timezone
config# clock summer-time <word> <date/recurring>
- Word is local name for Daylight Savings time
- Configurations (not in Packet Tracer, maybe not important)
OSI or TCP/IP Layer
CCNA Exam Topic
#extop-4-2
Contributors
Sources