Home > NTP Questions

NTP Questions

March 23rd, 2020 Go to comments

Question 1

Explanation

If a router is configured to get the time from a Network Time Protocol (NTP) server, the times in the router’s log entries may be different from the time on the system clock if the [localtime] option is not in the service timestamps log command. To solve this issue, add the [localtime] option to the service timestamps log command. The times should now be synchronized between the system clock and the log message timestamps.

Reference: https://community.cisco.com/t5/networking-documents/router-log-timestamp-entries-are-different-from-the-system-clock/ta-p/3132258

Question 2

Explanation

Even we had a synchronized clock but it may show different timezone so we should set the “localtime” keyword (which uses local time zone for timestamps) so that the time of logging messages is matched with our clock.

Question 3

Explanation

By default, Catalyst switches add a simple uptime timestamp to logging messages. This is a cumulative counter that shows the hours, minutes, and seconds since the switch has been booted up. For example:

20w2d: %LINK-3-UPDOWN: Interface FastEthernet1/0/27, changed state to down
21w3d: %SYS-5-CONFIG_I: Configured from console by vty0 (172.25.15.246)

At exactly what date and time did that occur? Who knows!

Instead, you can configure the switch to add accurate clock-like timestamps that are easily interpreted. you can use the following command to begin using the switch clock as an accurate timestamp for syslog messages:

Switch(config)# service timestamps log datetime [localtime] [show-timezone] [msec] [year]

Below is the output if we entered the command “service timestamps log datetime localtime show-timezone” (without”msec” keyword the output would not show time in milisecond)

*MarĀ  1 00:02:24 UTC: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback4, changed state to up

Note: The command “clock calendar-valid” enables the device to act as a valid time source to which network peers can synchronize. By default, the time maintained on the software clock is not considered to be reliable and will not be synchronized with NTP or VINES time service. To set the hardware clock as a valid time source, use this command.

Comments (13) Comments
  1. Anonymous
    June 30th, 2020

    Question 1. The answer is:

    A. The keyword localtime is not defined on the timestamp service command

    Reference:
    https://community.cisco.com/t5/networking-documents/router-log-timestamp-entries-are-different-from-the-system-clock/ta-p/3132258

  2. asad
    July 4th, 2020

    @Anonymous
    If a router is configured to get the time from a Network Time Protocol (NTP) server, the times in the router’s log entries may be different from the time on the system clock if the [localtime] option is not in the service timestamps log command.

    So Answer A ( The keyword localtime is defined on the timestamp service command ) not correct

  3. heyo
    August 7th, 2020

    Shouldnt question 1A be “localtime is NOT defined” or am I missing something?

  4. Jaffery
    September 7th, 2020

    Can anyone confirm the answer for Question 1 (A or B)? any why?

  5. mi
    October 20th, 2020

    Guys, read the answers carefully:
    A. The keyword localtime is defined on the timestamp service command
    so it means that this command is already applied to the config – which is false.
    Considering the fact that it is not present in the config, the only logically correct answer is B.

    Answer B is confirming the fact – the server is in a different time zone indeed and the keyword from answer A would solve the problem from the question, but the answer tells us that it is already applied – which is not true.

  6. XR
    November 2nd, 2020

    @mi
    A. The keyword localtime is defined on the timestamp service command
    in exam there is this one
    A. The keyword localtime is;;; NOOOOOT ;;;defined on the timestamp service command

  7. XR
    November 10th, 2020

    @networktut – is it right or not?
    A. The keyword localtime is defined on the timestamp service command
    in exam there is this one
    A. The keyword localtime is;;; NOOOOOT ;;;defined on the timestamp service command

  8. networktut
    November 11th, 2020

    @XR: Thanks for your detection, we have just updated this question.

  9. Manu
    November 12th, 2020

    Hey @Networktut Team!

    I saw that you edited answer A in question 1. With this change, the correct answer to the question could be A instead of B.

  10. ssh
    November 12th, 2020

    @networktut can you please clarify on q1? thanks in advance

  11. networktut
    November 12th, 2020

    @Manu, @ssh: Thanks for your information, we have just updated Q.1.

  12. nanya
    February 10th, 2021

    R1#show clock
    *06:13:44.045 MST Sun Dec 30 2018

    If the show command resulted with an “*” in front of the time/date, then that means it is not talking to the NTP server, could be an authentication problem. I noticed this during my lab exercise. Do you concur with my reasoning?

  13. Ariu
    April 5th, 2021

    For me, this clarifies it all: https://community.cisco.com/t5/other-network-architecture/logging-shows-an-asterisk-quot-jan-13-11-05-40-quot/td-p/564707
    The answerer says: “*” symbol means time is not authoritative: the software clock is not in sync or has never been set.
    But the issue, the question is that “the timestamps on the system logs did not match the clock”. It doesn’t care that the clock on the router is not correct.
    The same stands for Question 2.
    In my opinion…