Network Requirement
- Device1 is the NTP server; Device2 and Device3 are the NTP clients.
- Device2 are interconnected with Device1 and Device 3 via interface vlan2, vlan3; the route is reachable.
- Device1 provides the clock for Device2; Device2 provides the clock for Device3.
Network Topology
![Networking of configuring the NTP server and multi-level clients](/storage/images/Document/Maipu/monitoring/config-ntp-server-and-multi-level-clients.jpg)
Figure 4-2 Networking of configuring the NTP server and multi-level clients
Configuration Steps
Step 1: Configure the IP address of the interface. (Omitted)
Step 2: Configure the NTP server Device1.
#Enable NTP IPv4 of device1, configure the time zone as Beijing time zone, local clock as reference clock, and the number of clock layers as 3.
Device1#configure terminal
Device1(config)#ntp enable
Device1(config)#clock timezone BINJING 8
Device1(config)#ntp master 3
Device1(config)#exit
Device1(config)#ntp master 3
|
Step 3: Configure the NTP client Device2.
#Enable the NTP IPv4 function of Device2, and configure the time zone as Beijing time zone.
Device2#configure terminal
Device2(config)#ntp enable
Device2(config)#clock timezone BINJING 8
|
#Specify the NTP server Device1 and the IP address is 1.0.0.1.
Device2(config)#ntp server 1.0.0.1
|
Step 4: Configure the NTP client Device3.
#Enable the NTP IPv4 function of Device3, and configure the time zone as Beijing time zone.
Device3#configure terminal
Device3(config)#ntp enable
Device3(config)#clock timezone BINJING 8
|
#Specify the NTP server Device2 and the IP address is 2.0.0.1.
Device2(config)#ntp server 2.0.0.1
|
Step 5: Check the result, viewing the clock synchronization information on Device2 and Device3.
#Execute the show ntp status command on the client Device2, and view the clock synchronization status, indicating that Device2 and NTP server Device1 are synchronized and the clock layers is 4, larger than Device1.
Device2#show ntp status
Current NTP status information NTP ipv4 is enabled
NTP ipv6 is disabled
Clock is synchronized, stratum 4, reference is 1.0.0.1
reference time is D44CC35E.BAA6A190 (13:02:22.729 Tue Nov 13 2012)
#Execute the show clock command to view the device clock on the client Device2.
Device2#show clock
BEIJING(UTC+08:00) TUE NOV 13 21:02:24 2012
#Execute the show ntp status command on the client Device3, and view the clock synchronization status, indicating that Device3 and Device2 are synchronized and the clock layers is 5, larger than Device1.
Device3#show ntp status
Current NTP status information NTP ipv4 is enabled
NTP ipv6 is disabled
Clock is synchronized, stratum 5, reference is 2.0.0.1
reference time is D44CC365.5CC8C4C8 (13:02:29.362 Tue Nov 13 2012)
#Execute the show clock command to view the device clock on the client Device3.
Device3#show clock
BEIJING(UTC+08:00) TUE NOV 13 21:02:36 2012