NTP
Overview
Network Time Protocol (NTP) is designed for time synchronization on network devices. A device can synchronize its clock source and the server. Moreover, the NTP protocol can provide precise time correction (less than one millisecond on the LAN and dozens of milliseconds on the WAN, compared with the standard time) and prevent from attacks by means of encryption and confirmation.
To provide precise time, NTP needs precise time source, the Coordinated Universal Time (UTC). The NTP may obtain UTC from the atom clock, observatory, satellite or Internet. Thus, accurate and reliable time source is available.
To prevent the time server from malicious destroying, an authentication mechanism is used by the NTP to check whether the request of time correction really comes from the declared server, and check the path of returning data. This mechanism provides protection of anti-interference.
Ruijie switches support the NTP client and server. That is, the switch can not only synchronize the time of server, but also be the time server to synchronize the time of other switches. But when the switch works as the time server, it only support the unicast server mode.
I. Requirements
Switch synchronizes system clock to NTP Server in order to keep system clock more accurate.
II. Network Topology
III. Configuration Tips
1. Basic network routes setting
2. (Optional)Configuring a switch as NTP Server
3. Configuring a switch as NTP client
4. (Optional)Specifying a interface on switch to communicate with NTP Server
IV. Configuration Steps
NTP configuration without authentication
1. Basic network routes setting
Ensure that NTP client can communicate with the NTP server
2. (Optional) Configuring a switch as NTP Server
Note: Mostly NTP server is a particular server rather than a switch in production network. This example shows how to configure a switch as a NTP server:
Ruijie(config)#ntp master
3. Configuring a switch as NTP client
Ruijie(config)#ntp server 192.168.2.1 ——>set NTP server IP address
Ruijie(config)#ntp update-calendar ——>allow system to save clock in hardware even power interruption
4. (Optional) Specifying a interface on switch to communicate with NTP Server
Ruijie(config)#ntp server 192.168.1.2 source loopback 0 ——> specify interface loopback 0 to communicate with NTP Server
NTP configuration with authentication
1. Basic network routes setting
Ensure that NTP client can communicate with the NTP server
2. (Optional) Configuring a switch as NTP Server
Note:Mostly NTP server is a particular server rather than a switch in production network. This example shows how to configure a switch as a NTP server and how to configure NTP authentication on a switch NTP Server
Ruijie(config)#ntp master
Ruijie(config)#ntp authenticate ——>enable NTP authentication
Ruijie(config)#ntp authentication-key 6 md5 ruijie ——>NTP key id is “6” , and password is “ruijie”
Ruijie(config)#ntp trusted-key 6
3. Configuring a switch as NTP client
Ruijie(config)#ntp update-calendar ——>allow system to save clock in hardware even power interruption
Ruijie(config)#ntp authenticate ——>enable NTP authentication
Ruijie(config)#ntp authentication-key 6 md5 ruijie ——>NTP key id is “6” , and password is “ruijie”
Ruijie(config)#ntp trusted-key 6
Ruijie(config)#ntp server 192.168.2.1 key 6 ——>apply key id 6 to corresponding NTP server 192.168.2.1
4. (Optional) Specifying a interface on switch to communicate with NTP Server
Ruijie(config)#ntp server 192.168.1.2 source loopback 0 ——>specify interface loopback 0 to communicate with NTP Server
V. Verification
1. This example displays the clock on NTP server
2. This example displays the clock on NTP client before synchronization
3. This example displays NTP status on NTP client before synchronization
4. System returns a message after synchronizing successfully:
*Mar 12 10:55:04: %SYS-6-CLOCKUPDATE: System clock has been updated to 10:55:04 UTC Tue Mar 12 2013.
This example displays NTP status on NTP client before synchronization