Section 3-8. Time and Calendar


3-8. Time and Calendar

  • System time is maintained by the software. When a switch is initialized, the system time is set from a hardware time clock (system calendar) in the switch.

  • An accurate system clock is important to maintain, especially when you need to compare the output of logging and debugging features. A switch timestamps these messages, giving you a frame of reference.

  • System time is maintained as coordinated universal time (UTC, also known as Greenwich mean time,GMT). The format of time as it is displayed can be configured with operating system commands.

  • System time can be set manually or by Network Time Protocol (NTP). In addition, the hardware time clock in a switch can be updated by NTP if desired.

  • NTP uses a concept of stratum to determine how close an NTP speaker is to an authoritative time source (an atomic or radio clock). Stratum 1 means that an NTP server is directly connected to an authoritative time source. NTP also compares the times reported from all configured NTP peers and will not listen to a peer that has a significantly different time.

  • NTP associations with other NTP peers can be protected through an encrypted authentication.

NTP version 3 is based on RFC 1305 and uses UDP port 123. You can find information about public NTP servers and other NTP subjects at www.eecis.udel.edu/~ntp/.

NOTE

Catalyst 4000 and 6000 series switches running native IOS and 2948G-L3 and 4908G-L3 switches can also be configured as NTP authoritative time sources. For configuration information on these devices, visit the Cisco web site at www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/ffun_c/fcfprt3/fcf012.htm#41044 or refer to Cisco Field Manual: Router Configuration by David Hucaby and Steve McQuerry, Cisco Press, ISBN 1-58705-024-2.


Configuration

You can set the system time using in two different ways:

  • Manually

  • Using the NTP

For manual configuration, you will be setting the time and date on the router along with the time zone and whether to observe summer hours. With manual configuration, the router has no way to preserve the time settings and cannot ensure that time remains accurate. NTP is defined by RFC 1305 and provides a mechanism for the devices in the network to get their time from an NTP server. With NTP, all the devices would be synchronized and will keep accurate time.

Setting the System Time Manually

1.

Set the time zone:

COS

 set timezone [zone_name] [hours [minutes]] 

IOS

 (global) clock timezone zone hrs-offset min-offset 


The time zone is set to the abbreviated name zone (that is, EST, PST, CET). This name is only used for display purposes and can be any common zone name. The actual displayed time is defined by an offset in hours (hrs-offset) and minutes (min-offset) from UTC.

2.

(Optional) Configure daylight savings time (DST):

COS

[View full width]

 set summertime {enable | disable} [zone] set summertime recurring [week day month hh:mm  week day month hh:mm} [offset]] set summertime date month date year hh:mm month  date year hh:mm [offset] 

IOS

[View full width]

 (global) clock summer-time zone recurring [week  day month hh:mm week day month hh:mm [offset]] (global) clock summer-time zone date [date month |  month date] year hh:mm [date month | month date]  year hh:mm [offset] 


For COS, you can enable and disable summertime manually with the command set summertime {enable | disable}. This causes the switch to set the time ahead 60 minutes (the U.S. standard for DST).

If DST begins and ends on a certain day and week of a month, use the command with the recurring keyword. To start and stop DST, you can give the week number (including the words "first" and "last"), the name of the day, the name of the month, and time hh:mm in 24-hour format. If no arguments are given, the U.S. standard of beginning at 2:00 a.m. on the first Sunday in April, and ending at 2:00 a.m. on the last Sunday in October is used. The offset value can be given to set the number of minutes that are added during DST (default 60 minutes).

Otherwise, you can use the date keyword to specify the exact date and time that DST begins and ends in a given year.

3.

(Optional) Set the system clock (IOS clock):

COS

 set time [day] [mm/dd/yy] [hh:mm:ss] 

IOS

[View full width]

 (exec) clock set hh:mm:ss [day month | month day]   year 


The clock is set when this command is executed. The time is given in 24-hour format; day is the day number, month is the name of the month, and year is the full four-digit year for IOS switches; and the date is in the international format for COS switches.

4.

(Optional) Set the system calendar (hardware clock):

COS

N/A

IOS

[View full width]

 (exec) calendar set hh:mm:ss [day month | month  day] year 


The hardware clock is set to the given time (24-hour format) and date. The month is the name of the month, day is the day number, and year is the full four-digit year. As an alternative, you can set the system calendar from the system clock using the (EXEC) clock update-calendar command.

Setting the System Time Through NTP

1.

Define one or more NTP peer associations:

COS

 set ntp server ip-addr [key public-keynum] set ntp client enable 

IOS

[View full width]

 (global) ntp peer ip-address [version number] [key  keyid] [source interface] [prefer] 


The NTP peer is identified at ip-address. The NTP version can be given with the version keyword (1 to 3, default is version 3). If NTP authentication is used, the key keyword identifies the authentication key to use (see Step 3b in this section). If desired, you can take the source address used in NTP packets from an interface by using the source keyword. Otherwise, the router uses the source address from the outbound interface. The preferred keyword forces the local router to provide time synchronization, if contention exists between peers.

2.

(Optional) Configure NTP broadcast service:

COS

 set ntp broadcastclient enable set ntp broadcastdelay microseconds 

IOS

 (global) ntp broadcast client (global) ntp broadcastdelay microseconds 


By default, NTP sends and receives unicast packets with peers. Broadcasts can be used instead, if several NTP peers are located on a common network. The ntp broadcast command enables sending broadcast packets. The ntp broadcast client command enables the reception of broadcast packets. The ntp broadcastdelay command sets the round-trip delay for receiving client broadcasts (1 to 999,999 microseconds, default is 3000 microseconds).

3.

(Optional) Restrict access to NTP using authentication.

a. Enable NTP authentication:

COS

 set ntp client enable 

IOS

 (global) ntp authenticate 


b. Define an authentication key:

COS

[View full width]

 set ntp key public-key [trusted | untrusted] md5  secret-key 

IOS

 (global) ntp authentication-key key-number md5 value 


An MD5 authentication key numbered key-number is created. The key is given a text-string value of up to eight clear-text characters. After the configuration has been written to NVRAM, the key value displays in its encrypted form.

c. Apply one or more key numbers to NTP:

COS

 set ntp server ip-addr [key public-key] 

IOS

 (global) ntp trusted-key key-number 


Remote NTP peers must authenticate themselves using the authentication key numbered key-number. You can use this command multiple times to apply all desired keys to NTP.

Example

This example shows a switch that is configured for the U.S. eastern time zone and daylight savings time. The time is manually set.

An example of the COS configuration follows:

 Console (enable)> set timezone EST -5 Console (enable)> set summertime recurring 1 Sunday april 2:00 last Sunday   October 2:00 Console (enable)> set time Saturday 08/11/90 15:30:00 

An example of the Supervisor IOS configuration follows:

 Switch(config)# clock timezone EST 5 Switch(config)# clock summer-time EST recurring 1 sunday april 2:00   last sunday october 2:00 Switch(config)#end Switch# clock set 15:30:00 August 11 1990 Switch#copy running-config startup-config 

In this configuration, NTP is enabled and NTP is configured for authentication. One key, source1key, authenticates a peer at 172.17.76.247, while another key, source2key, authenticates a peer at 172.31.31.1.

An example of the COS configuration follows:

 Console (enable)> set ntp client enable Console (enable)> set ntp key 1 trusted md5 sourcekey1 Console (enable)> set ntp key 2 trusted md5 sourcekey2 Console (enable)> set ntp server 172.17.76.247 key 1 Console (enable)> set ntp server 172.31.31.1 key 2 

An example of the Supervisor IOS configuration follows:

 Switch(config)# ntp authenticate Switch(config)# ntp authentication-key 1 md5 sourceA Switch(config)# ntp authentication-key 2 md5 sourceB Switch(config)# ntp trusted-key 1 Switch(config)# ntp trusted-key 2 Switch(config)# ntp peer 172.17.76.247 key 1 Switch(config)# ntp peer 172.31.31.1 key 2 



Cisco Field Manual. Catalyst Switch Configuration
Cisco Field Manual. Catalyst Switch Configuration
ISBN: 1587050439
EAN: N/A
Year: 2001
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net