Featured Posts

CCIE-Journals

CCIE-Journals
From Student to Engineer,a journey of discovery.

Configure and verify NTP operating in a client and server mode

NTP

Network Time Protocol (NTP) is used to synchronize the time of network devices with a common reference time source. In a network environment, it is crucial that all devices operate on the same time to ensure proper network operation, logging, and troubleshooting. In this blog post, we will discuss how to configure and verify NTP operating in a client and server mode on a Cisco device.

What is NTP?



Network Time Protocol (NTP) is an Internet standard protocol used to synchronize the clocks of computers or network devices to a reference time source. NTP works based on the client-server model, where the NTP client synchronizes its time with the NTP server. NTP can be used to synchronize the time between devices within a LAN or WAN, and also across the internet.

Configuring NTP:


To configure NTP on a Cisco device, follow the steps below:

Step 1: Enable NTP service on the device

Firstly, we need to enable the NTP service on the device. This is done by configuring the 'ntp' command in global configuration mode. This will enable the device to act as an NTP client or server.

Router(config)# ntp ?
  authenticate        Enable NTP authentication
  authentication-key  Authentication key for trusted time sources
  logging              Enable NTP logging
  master               Configure NTP master parameters
  max-associations     Maximum number of associations
  peer                 Configure NTP peer parameters
  server               Configure NTP server parameters
  source-interface     Configure source interface for NTP packets
  trusted-key          Key numbers for trusted time sources
  update-calendar      Update system calendar with NTP
  version              NTP version

Step 2: Configure NTP server or client

Next, we need to configure the device as an NTP server or client. This is done by configuring the 'ntp server' or 'ntp client' command respectively.

To configure the device as an NTP server, use the following command:
Router(config)# ntp server <IP_address>


To configure the device as an NTP client, use the following command:
Router(config)# ntp server <IP_address>

 

Step 3: Configure NTP authentication (optional)

NTP authentication can be used to ensure that the NTP client or server is communicating with a trusted time source. This can be done by configuring an NTP authentication key on the device.

To configure an NTP authentication key, use the following commands:

Router(config)# ntp authentication-key <key_id> md5 <key_string>
Router(config)# ntp trusted-key <key_id>

The 'ntp authentication-key' command is used to configure the authentication key, and the 'ntp trusted-key' command is used to specify the trusted key.

Step 4: Verify NTP status

To verify the NTP status on the device, use the following command:
Router# show ntp status

Clock is synchronized, stratum 4, reference is <IP_address>
nominal freq is 119.2092 Hz, actual freq is 119.2092 Hz, precision is 2**18
reference time is <time>
...
This command will display the current NTP status on the device, including the stratum, reference IP address, and reference time.

Conclusion:


In this blog post, we discussed how to configure and verify NTP operating in a client and server mode on a Cisco device. NTP is a crucial protocol in a network environment to ensure that all devices operate on the same time. By following the steps outlined above, you can easily configure NTP on your Cisco device and verify its status.

0 comments:

Post a Comment