Synchronize a Cisco router's clock with Network Time Protocol (NTP)

Source: Internet
Author: User

By David Davis CCIE, MCSE + I, scsa | more from David Davis CCIE, MCSE + I, scsa | published: 5/26/05
Category: Home | audience: Networking & Communications

Takeaway:
It's critical that all devices on an organization's network display the accurate time and date. if they don't, things can go wrong in a hurry. david Davis explains why Cisco devices need to use Network Time Protocol (NTP) for their time synchronization needs, and he tells you how to configure NTP on your Cisco devices.

Whether you're working with a server, router, switch, firewall, or PC, it's imperative that all devices on your organization's network exhibit the correct time and date. if this critical information isn' t accurate, a variety of things can go wrong.

That means Event Logs and firewall logs can be incorrect, you might not be able to tell when your router rebooted, and/or Windows devices may not be able to log in to the domain. the fact that Microsoft has integrated the Windows Time Service into its products only underscores the importance of proper time synchronization.

Cisco routers have embraced the Network Time Protocol (NTP), a protocol designed to synchronize the clocks of computers over a network, for policyears. NTP Version 3 is a standard protocol ormalized in RFC 1305 protocol hat uses the user datateprotocol (UDP) and Port 123.

Unlike PCs or servers, Cisco network devices specifically need to run NTP to synchronize the time and date. That's because most Cisco devices don't have an internal clock.

For example, when a Cisco 2600 or 3600 series router loses power or the network administrator needs to reload it, the time and date are lost. consequently, all log files, time-based access lists, or any other configuration based on time or date will either be incorrect or not work at all.

An NTP client synchronizes the time and date with an NTP server. the NTP server shoshould be a reliable source, such as a time server on the Internet. A number of free public Internet time servers are available.

One example is the National Institute of Standards and Technology (NIST) Internet time service, which bases its time on an atomic clock. the NIST web site also provides a list of the publicly available NIST Internet time servers on the Internet. in fact, you'll even find Microsoft on this list. the software giant runs its own free Internet time server license ime-nw.nist.gov with an IP address of 131.107.1.10.

Known as stratum-1 time servers, these public Internet time servers obtain their time directly from a stratum-0 device, A reference clock that can't be an NTP server on the network (such as an atomic clock ). the greater the stratum of the server, the greater the distance between that server and the reliable time source.

To ensure that your network devices display the most accurate time, you need to configure the NTP protocol and link your devices to a reliable time source. To do so, you have a couple of options.

You cocould purchase a hardware time device that obtains the time via GPS or some other method. in effect, you're essentially creating your own stratum-1 time server. however, for most small to midsize companies, a better alternative is to opt for a free Internet time server.

In my organization, we use Unix scripts that depend on the proper router date. we receive a morning e-mail that lists all router events that occurred the previous day. the scripts go to each router and use a command similarShow logging | include May 16To gather the date, combine it in a file, and e-mail it to all network administrators.

So, when a router reboots, if no one has configured NTP, then the command will find no data from that router. Nor is the command likelyEverRetrieve data again because the router reverts back to its default date of February or March 1993.

Because of such possibilities, it's easy to see why it's imperative to configure NTP on your routers and switches. Refreshing NTP on a Cisco IOS device is a relatively easy process.

Follow these steps:

  1. Choose the NTP server your devices will use.
  2. Find out the IP address for this server. it cocould be an external source such as NIST, or it cocould be an internal device that offers NTP services (such as a hardware device or software server from mongoricom ).
  3. Enter the following commands on the iOS device:
Router# configure terminalRouter(config)# ntp server <IP address of NTP Server>
  1. Verify the association with the server usingShow NTP statusAndShow NTP associationsCommands.ListingOffers an example of the output of these commands.

Before you get started, I 'd like to point out a couple of things to keep in mind:

  • NTP is a slow protocol, and the formation of NTP associations can take a long time. So, don't expect CT anything to happen fast. You can keep an eye on it usingDebug NTP <option>Set of commands.
  • If you decide to use an Internet NTP server, make sure you open UDP port 123 inbound on your firewall to your NTP client.

For more information, as well as detailed instructions for the options you can enable with NTP, check out Cisco's "sorting NTP" documentation.

Want to learn more about router and switch management? Automatically sign up for our free Cisco routers and switches newsletter, delivered each Friday!

David Davis has worked in the IT industry for 12 years and holds several certifications, including CCIE, MCSE + I, cissp, ccna, ccda, and ccnp. he currently manages a group of systems/network administrators for a privately owned retail company and performs networking/systems consulting on a part-time basis.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.