As pointed out in my previous blog post, I don’t like seeing wrong time. I especially do not like seeing two different time on show log and show clock output. I’ve seen this happened several times on Cisco routers and switches and it really annoys me whenever I need to know when a specific event happened and also how long ago it happened. Having said that, I try to create a config template for every router and switches I deploy. Also, I try to go back to all the routers and switches already deployed so everything is standardized. If you have thousands of routers and switches, it’ll be a pain in the neck to do it manually so tools such as AlterPoint Device Authority or SolarWinds’ Network Configuration Manager are there to help. These products also keep backups of all your configurations also so it’s a great tool to have in an enterprise.
Below is to show an example of a router with NTP and timezone properly configured but log timestamp doesn’t match the system time.
Router#sho clock 10:39:06.730 PST Tue Jul 31 2012 Router#conf t Router (config)#int f0/0 Router (config-if)#no shut Jul 31 15:52:39: %SYS-5-CONFIG_I: Configured from console by networkjutsu on console Jul 31 15:52:39: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up Jul 31 15:53:39: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
To fix this, issue the command below.
Router(config)# service timestamps log datetime localtime msec Router#show clock 10:40:30.360 PST Tue Jul 31 2012 Router#conf t Router (config)#int f0/0 Router (config-if)#shut Jul 31 10:39:53.280: %SYS-5-CONFIG_I: Configured from networkjutsu by console Jul 31 10:39:54.280: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down Jul 31 10:39:54.580: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
As you can see above, the log timestamp is now synchronized with the system time clock. Now, it’s time for you to send this config to all routers and switches in your network.
Hope this has been helpful and thank you for reading!
NetworkJutsu.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com.