Home > Articles > Certification > Cisco Certification

Cisco Network Time Protocol Configuration

  • Print
  • + Share This
Configuring Network Time Protocol (NTP) is not overly complex. In this article, networking consultant Sean Wilkins walks you through the configuration steps that can be used to implement NTP and get the target device’s clock time synchronized.
Like this article? We recommend

As discussed in the previous Network Time Protocol (NTP) concepts article, the configuration of NTP is not overly complex. The first thing that needs to be determined is the method of NTP operation that best fits the requirements for the target network; once this decision has been made, the steps shown in this article can be used to implement NTP and get the target device’s clock time synchronized.

NTP Configuration Steps

The first thing that must be established in an NTP deployment is where is the master clock going to be coming from; for example, is it coming from an Internet time source, from a local timing device, or from a specific network device (not recommended). From a Cisco perspective, getting the clock from an Internet time source and/or from a local timing device both require the same command (ntp server). To have a specific network device consider itself as a reference clock source, another command is used (ntp master). Table 1 covers the commands that are required to set a network reference clock source:

Table 1 - Reference Clock Source Configuration

1

Configure the local device to use a remote NTP clock source.

router(config)#ntp server {ip-address | hostname}

 

or

 

1

Configure the local device as a NTP reference clock source.

Note: The stratum-numbercan be from 1 to 15 and indicates the advertised accuracy of the local reference clock.

router(config)#ntp master stratum-number

Once a couple main centrally located devices have configured with a reference clock source, they can then be used within the network as a local time source to all other devices within the network. This prevents all of the devices in the network from requiring external network access to accurately keep time. Typically, these internal time sources are configured in Symmetric active NTP mode; what this means is that if any of these sources were to lose contact with its external time source, it would reference the other internal time sources to synchronize and adjust its time (they act as both server and client to each other).

It is important to note, however, that if all of the master reference clocks are lost within a network, regardless if a device is configured as a NTP client or NTP peer, it will still no longer synchronize itself or other clients. To get around this situation, it is possible to configure NTP orphan mode; while in this mode, if a device loses its primary clock source, it will then begin to announce its internal clock as a reference clock source. It is important to configure the orphan mode with a Stratum level that is less than the current primary reference source.

Table 2 covers the commands that are required to set up devices in Symmetric active NTP mode.

Table 2 - Symmetric Active NTP Mode Configuration

1

Configure the local device to use a remote NTP clock source (client only).

router(config)#ntp server {ip-address | hostname}

2

Configure the local device to peer with another NTP device (server and client).

router(config)#ntp peer {ip-address | hostname}

3

(Optional) Configure NTP Orphan mode.

router(config)#ntp orphan stratum-number

It is important to note that the ntp server(because it enables the local NTP process) command will enable other clients to synchronize their clocks to the local device (yes, this seems counterintuitive); for example, the scenario ntp master -> ntp server -> ntp serverwill work. However, these other clients will need to be individually configured. When using the ntp peercommand, the local device will automatically configure the remote device as a peer; however, for this remote configuration to work, the remote device must have NTP enabled (e.g., using the ntp master, ntp server or ntp peercommands). When configuring NTP in this way, the local device is considered in Active Symmetric mode while the remote device is considered in Passive Symmetric mode. If two devices configure each other as peers with the ntp peercommand, then they will both be considered in Active Symmetric mode.

The “normal” clients within a network would typically be configured in one of two ways: using NTP client mode or using NTP broadcast. When configured in NTP client mode, a device will actively poll the NTP time source to ensure that its clock maintains accuracy and synchronization with the time source. When using NTP broadcast, a client will listen for the broadcasts from an NTP broadcast server (time source); when it receives one of these broadcasts, it takes the information contained within the packet to synchronize its clock.

For the most accurate clock, client mode would be preferred over broadcast mode; however, it does require that each device send polling traffic that raises network utilization; in networks with high utilization, this may be a factor in selecting an NTP operational mode.

Table 3 covers the commands that are required to set up devices in Client mode and in Broadcast mode.

Table 3 - Client Mode and Broadcast Mode Configuration

1

Configure the local device to use a remote NTP clock source (client only).

router(config)#ntp server {ip-address | hostname}

 

or

 

1

Configure an NTP broadcast server

Note: This command would be configured on a device that is configured to receive time from a reference clock or that is a reference clock.

This command is configured on an interface that contains the NTP broadcast clients.

router(config-if)#ntp broadcast

2

Configure an NTP broadcast client.

Note: This command is configured on an interface that contains the NTP broadcast server.

router(config-if)#ntp broadcast client

NTP Configuration Scenarios

To pull together the commands that were covered in the previous section (and the concepts that were covered in the previous NTP concepts article), this section covers a couple of common configuration scenarios. You learn the configuration of two devices that separately connect to primary remote clock sources and peer together, and a second scenario where some clients are configured to use a local NTP server and other clients are configured to use NTP broadcast.

Symmetric Active Scenario

In this section, devices R1 and R2 are separately connected to a known high-level clock source and are configured to peer to each other; should the connection to this primary source fail, the peers with synchronize clock between each other. Figure 1 shows the scenario’s topology.

Figure 1 Symmetric active scenario topology

Table 4 covers the steps that are required to configure NTP on both devices R1 and R2.

Table 4 - Symmetric Active Scenario Configuration

1

Enter privileged EXEC mode.

R1>enable

2

Enter global configuration mode.

R1#configure terminal

3

Configure R1 to use a primary clock source.

R1(config)#ntp server 192.5.41.40

4

Configure R2 as a NTP peer.

R1(config)#ntp peer 10.10.10.2

5

Configure R1 to act as an NTP orphan server should its primary clock fail.

R1(config)#ntp orphan 3

 

 

 

1

Enter privileged EXEC mode.

R2>enable

2

Enter global configuration mode.

R2#configure terminal

3

Configure R2 to use a primary clock source.

R2(config)#ntp server 192.5.41.40

4

Configure R1 as a NTP peer.

R2(config)#ntp peer 10.10.10.1

5

Configure R1 to act as an NTP orphan server should its primary clock fail.

R1(config)#ntp orphan 3

NTP Client/NTP Broadcast Client Scenario

In this section, two separate sub-scenarios will be covered. First, devices R3 and R4 will be configured in an NTP broadcast server/client relationship with R3 broadcasting a clock source that is received and used by R4 as its clock source. Second, device R5 will be configured as a NTP polled client using devices R1 and R2 as reference clock sources.

Figure 2 shows these scenarios’ topology.

Figure 2 NTP client/NTP broadcast client scenario topology

Table 5 covers the steps that are required to configure NTP on devices R3, R4 and R5.

Table 5 - NTP Client/NTP Broadcast Client Scenario Configuration

1

Enter privileged EXEC mode.

R3>enable

2

Enter global configuration mode.

R3#configure terminal

3

Configure R1 as a primary clock source.

R3(config)#ntp server 1.1.1.1

4

Configure R2 as a primary clock source.

R3(config)#ntp server 2.2.2.2

5

Enter interface configuration mode.

R3(config)#interface fa0/0

6

Configure R3 as an NTP broadcast server.

R3(config-if)#ntp broadcast

 

 

 

1

Enter privileged EXEC mode.

R4>enable

2

Enter global configuration mode.

R4#configure terminal

3

Enter interface configuration mode.

R4(config)#interface fa0/0

4

Configure R4 as an NTP broadcast client.

R4(config-if)#ntp broadcast client

 

 

 

1

Enter privileged EXEC mode.

R5>enable

2

Enter global configuration mode.

R5#configure terminal

3

Configure R1 as a primary clock source.

R5(config)#ntp server 1.1.1.1

4

Configure R2 as a primary clock source.

R5(config)#ntp server 2.2.2.2

Summary

As can be seen from this article, the configuration of NTP in almost any scenario is not overly complex from a basic configuration standpoint. The real thing that needs to be done on a network that includes multiple LAN’s is to plan how the time structure is organized. Generally speaking, it is best if any network nodes have at least a Stratum 2 or better clock source directly configured. Hosts, on the other hand, can be configured with a Stratum 3 clock source without much effect on perceived clock accuracy. Remember that for every NTP hop away (notice: not network hop), the clock accuracy goes down by a single stratum level. Now take the information learned within this article and the concepts article, and get NTP configured!

  • + Share This
  • 🔖 Save To Your Account

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020