How to Set the Time and Time Zone on Junos Devices - dummies

How to Set the Time and Time Zone on Junos Devices

By Walter J. Goralski, Cathy Gadecki, Michael Bushong

To accurately know what (and when) events happen on a single device, it needs to have the correct time and time zone. On a whole network, all the devices must have the same time, especially when you’re trying to track events and problems. Otherwise, you’ll have difficulty tracking sequences of events and determining what went wrong and exactly when.

With Junos, you set the time much like you do when setting a watch. This task is reasonably easy to do in a small network. Simply set the time in operational mode, as follows:

user@junos-device> set date 200802121646
Tue Aug 22 17:45:00 UTC 2011

The time the router displays is not the local time (unless you’re in the United Kingdom in winter); rather, it’s UTC (Universal Time Coordinated, once called Greenwich Mean Time, or GMT). If you want to use the local time zone instead, set the time zone for the device in configuration mode. For the western United States, set the local time zone with this configuration (this is for standard time):

[edit system]
user@junos-device# set time-zone GMT-7

If you operate a larger network or have networks with devices in different time zones, use UTC across the entire network. Networks generally have a centralized time server of some kind, using the Network Time Protocol (NTP) on the device to have it automatically synchronize itself to the time server. If it knows the IP address of the NTP server, the device can synchronize its time whenever it boots:

[edit system]
user@junos-device# set ntp boot-server

In a stable network, you don’t reboot devices very often, but the time on the router can slowly drift. You can have the router periodically synchronize its time with the NTP server by leaving out the boot-server option:

[edit system]
user@junos-device# set ntp server