Thursday, November 12, 2009

NTP Server on Cisco Router

To show the time, clock on cisco router, use the following command
#show clock
00:01:10.415 UTC Thu Nov 12 2009
To set the time zone, use this command on enable mode
#clock timezone SGT 8 <--this example, set the singapore time zone GMT +8

To set the clock, by below command
#clock set 10:10:10 Nov 13 2009 <--format is (hh:mm:ss Month Date Year)

Note that: show clock command is showing software clock. You wanna see hardware clock type show calendar in enable mode
#show calendar

Let start about NTP protocol:
How is important TIME? Briefly says; To ensure that all network devices share a common time reference, e.g when you check the log file, call detail records for billing<--(voip), time should be same within all devices.
To synchronize the cisco router's clock with network time protocol (NTP) server, configure as below. From router config mode

(config)#ntp source ATM0.1 <-- this example I used atm0.1 is wan interface ip

(config)#ntp server sg.pool.ntp.org <--(you can find out more publc ntp server on
www.pool.ntp.org website) if you enable dns on router, dns will translate with ip address. otherwise you should add ip address manually.NTP will synchronize to ntp server periodically.

You will be noticed that ntp clock-period xxxxxx will show
in your running-config.
You don't need to configure ntp clock-period command.

As I mention earlier about hardware clock, you also want to update your hardware clock by ntp.
Do it below
(config)#ntp update-calendar