Network Time Protocol
R1#show clock
^Display the time and date
R2#clock set hh:mm:ss DayOfMonth Month Year
^ Set clock
clock = Software clock
calendar = Hardware clock
R2#calendar set hh:mm:ss DayOfMonth Month Year
^ Set hardware clock
R2#show calendar
^ Display hardware clock time & date
R2(config)#clock timezone EST 4
^ Set software clock timezone.
EST = Time zone name
4 = Hour offset from UTC
R2(config)#clock summer-time EDT <date|recurring>
^ Set Daylight Savings Time
Date = When to start
Recurring = Set up a yearly schedule
R1(config)#clock summer-time EDT recurring 2 Sunday March 02:00 1 Sunday November 02:00
^ The first date is when DST starts;
the second is when DST ends
R1(config)#ntp server ip-address [prefer]
^ Tells the router which NTP server from which it should get time
R1(config)#ntp peer ip-address
^ Devices can peer with one another at the same stratum to provide more accurate time
Devices peering with another device is called 'symmetric active'
Modes:
- Server mode
- Client mode
- Symmetric active mode (peer)
NTP does not update the hardware calendar clock.
R1(config)#ntp update-calendar
^ This will update the hardware calendar clock with the NTP provided time
R1(config)#ntp master [stratum]
^Sets the device as a master clock
R1(config)#source interface
^Tells R1 to use <interface> as the soruce of its NTP messages (when acting as a server)
Example:
R1(config)#interface loopback0
R1(config-if)#ip address 10.1.1.1 255.255.255.255
R1(config-if)#exit
R1(config)#ntp source loopback0
R1#show ntp associations
^Displays which NTP servers the device pulls time from
R1#show ntp status
^Displays additional info
There is some errata at Jeremy's lab that indicates the following authentication stuff is not needed unless using ntp passive, broadcast, or multicast stuff:
R1(config)#ntp authenticate
^ Enable NTP authentication
R1(config)#ntp authentication-key <key-number> md5 <key>
^ Create NTP authentication keys
R1(config)#ntp trusted-key <key-number>
Specify the trusted key(s)
R2(config)#ntp <ip-address> key <key-number>
^Notice this isn't needed on R1.
Used on R2, this command specifies which key is needed when pulling time from <ip-address>
[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]