NTP

Done

All devices have an internal built-in hardware clock, it is used for multiple time-related operations. Therefore, it is important to keep the time updated.

In the CCNA, the importance of time is for logging and its protocol: Syslog (show logging).

🚨
IMPORTANT: Use CLOCK to reference the software clock and CALENDAR to the hardware clock.

View the current configured clock

show clock [detail]
🚨
IMPORTANT: The reference for time is the UTC (Coordinated Universal Time)
πŸ’‘
NOTE: Before the time, the character can be: * β†’ Not authoritative (Not trusted) . β†’ Authoritative, NDP configured but not synced β†’ Authoritative

View the hardware clock

show calendar

Set the time/date (Good Practice)

  1. Configure the timezone
    configure terminal
    clock timezone {NAME} {-23 - 23}  // How much time from UT
  1. Set the clock
    exit     // PRIVILEGE EXEC MODE
    clock set {hh}:{mm}:{ss} {day} {MONTH} {year}   //Month is worded, not a number
  1. Update the calendar
    clock update-calendar  // This will update the hardware`s internal clock
    πŸ’‘
    NOTE: There is also the clock read-calendar, it updates the software clock based on the hardware`s internal clock.

Daylight Save Time

configure terminal
clock summer-time {NAME} {date | recurring} {which-week-starts} {DAY} {MONTH} {hh}:{mm} {which-week-ends} {DAY} {MONTH} {hh}:{mm}

NTP (Network Time Protocol)

It is used to synchronize automatically time over the network

NTP clients request time from NTP Server.

Delay

If in the same LAN…

≀1 milissecond

If over the WAN/Internet

≀ 50 milisseconds

NTP Server Classification (Stratum)

The accuracy of a NTP Server is defined by its distance from the reference clock, this measure is called stratum.

Devices like Atomic clocks and GPS clocks are the source of the time β†’ Stratum 0

Primary Servers (NTP Servers directly connected to these clocks) β†’ Stratum 1

Secondary Servers (Rest of the hierarchy of NTP Servers) β†’ Stratum 2 up to Stratum 15

πŸ’‘
NOTE: Secondary servers can operate at both client and server mode
🚨
IMPORTANT: The maximum stratum is stratum 15
πŸ’‘
NOTE: NTP Servers in the same stratum can connect to each other to become more accurate and act as backups. This is called a β€œpeer” relationship. To use this, the server must be configured to use β€œSymmetric mode”
🚨
IMPORTANT: The NTP modes don`t exclude each other, they can co-exist.

Configuration

Server Address

configure terminal
ntp server {address} [key {key-number}] [prefer]   // The 'prefer' keyword gives priority to a ntp server
πŸ’‘
NOTE: Multiple NTP servers can be configured, which is a good practice

See information about the NTP Servers

show ntp associations

Show information about NTP

show ntp status

Make NTP update Calendar (Hardware)

configure terminal
ntp update-calendar
πŸ’‘
NOTE: When the system first boots up, it is the hardware clock that is used to synchronize the time for the first time

Source NTP Interface

This is used to specify which interface will the NTP messages be sent from, so clients can synchronize to this server

configure terminal
ntp source {interface-id}

Make a device act as a Master Clock

configure terminal
ntp master [stratum]  // This stratum is the one that will appear in ntp status
πŸ’‘
IMPORTANT: The default stratum for a device configured as master clock is Stratum 8.

Configure Symmetric active mode

This options makes the device sync with a neighboring NTP Server that has the same stratum, making it more accurate and act as a backup.

configure terminal
ntp peer {ip-address} [key {key-number}] // The key is used for authentication

NTP Authentication

This is used to sync to only NTP Servers who has the same password.

Enable

configure terminal
ntp authenticate

Set the password

configure terminal
ntp authentication-key {key-number} md5 {password}

Trust a password

🚨
IMPORTANT: This step is required after setting a password.
configure terminal
ntp trusted-key {key-number}