Management – Clock

clock dhcp timezone

To specify that the timezone and the Summer Time (Daylight Saving Time) of the system can be taken from the DHCP Timezone option, use the clock dhcp timezone command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax clock dhcp timezone no clock dhcp timezone

Parameters

N/A

Default Configuration

Disabled

Command Mode

Global Configuration mode

User Guidelines

The TimeZone taken from the DHCP server has precedence over the static TimeZone.

The Summer Time taken from the DHCP server has precedence over static SummerTime.

The TimeZone and SummerTime remain effective after the IP address lease time has expired.

The TimeZone and SummerTime that are taken from the DHCP server are cleared after reboot.

The no form of the command clears the dynamic Time Zone and Summer Time from the DHCP server are cleared.

In case of multiple DHCP-enabled interfaces, the following precedence is applied:

  • information received from DHCPv6 precedes information received from

DHCPv4

  • information received from DHCP client running on lower interface precedes information received from DHCP client running on higher interfac

Disabling the DHCP client from where the DHCP-TimeZone option was taken, clears the dynamic Time Zone and Summer Time configuration.

Example

switchxxxxxx(config)# clock dhcp timezone

clock set

To set the system clock manually, use the clock set command in Privileged EXEC mode.

Syntax

clock set hh:mm:ss {[day month] | [month day]} year

Parameters

  • hh:mm:ss—Specifies the current time in hours (military format), minutes, and seconds. (Range: hh: 0-23, mm: 0-59, ss: 0-59)
  • day—Specifies the current day of the month. (Range: 1-31)
  • month—Specifies the current month using the first three letters of the month name. (Range: Jan–Dec)
  • year—Specifies the current year. (Range: 2000–2037)

Default Configuration

The time of the image creation.

Command Mode

Privileged EXEC mode

User Guidelines

After boot the system clock is set to the time of the image creation.

Example

The following example sets the system time to 13:32:00 on March 7th, 2005.

switchxxxxxx# clock set 13:32:00 7 Mar 2005

clock source

To configure an external time source for the system clock, use the clock source command in Global Configuration mode. To disable the external time source, use the no form of this command.

Syntax

clock source sntp no clock source sntp

Parameters

  • sntp—(Optional) Specifies that an SNTP server is the external clock source.

Default Configuration

There is no external clock source.

Command Mode

Global Configuration mode

User Guidelines

After boot the system clock is set to the time of the image creation.

If no parameter is specified, SNTP will be configured as the time source.

Example

The following example configures an SNTP server as an external time source for the system clock.

switchxxxxxx(config)# clock source sntp
switchxxxxxx(config)# exit
switchxxxxxx# show clock
 
*10:46:48 UTC May 28 2013
 
Time source is sntp

clock summer-time

To configure the system to automatically switch to summer time (Daylight Saving Time), use the clock summer-time command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax

clock summer-time zone recurring {usa | eu | {week day month hh:mm week day

month hh:mm}} [offset]

clock summer-time zone date day month year hh:mm date month year hh:mm

[offset]

clock summer-time zone date month day year hh:mm month day year hh:mm

[offset]

no clock summer-time

Parameters

  • zone—The acronym of the time zone to be displayed when summer time is in effect. (Range: up to 4 characters)
  • recurring—Indicates that summer time starts and ends on the corresponding specified days every year.
  • date—Indicates that summer time starts on the first date listed in the command and ends on the second date in the command.
  • usa—The summer time rules are the United States rules.
  • eu—The summer time rules are the European Union rules.
  • week—Week of the month. Can be 1–5, first to last.
  • day—Day of the week (first three characters by name, such as Sun).
  • date—Date of the month. (Range: 1–31)
  • month—Month (first three characters by name, such as Feb).
  • year—year (no abbreviation). (Range: 2000–2097)
  • hh:mm—Time (military format) in hours and minutes. (Range: hh:mmhh: 0-23, mm: 0-59)
  • offset—(Optional) Number of minutes to add during summer time (default is 60). (Range: 1440)

Default Configuration

Summer time is disabled.

Command Mode

Global Configuration mode

User Guidelines

In both the date and recurring forms of the command, the first part of the command specifies when summer time begins, and the second part specifies when it ends. All times are relative to the local time zone. The start time is relative to standard time. The end time is relative to summer time. If the starting month is chronologically after the ending month, the system assumes that you are in the southern hemisphere.

USA rules for Daylight Saving Time:

  • From 2007:
    • Start: Second Sunday in March
    • End: First Sunday in November
    • Time: 2 AM local time
  • Before 2007:
    • Start: First Sunday in April
    • End: Last Sunday in October
    • Time: 2 AM local time

EU rules for Daylight Saving Time:

  • Start: Last Sunday in March
  • End: Last Sunday in October
  • Time: 1.00 am (01:00) Greenwich Mean Time (GMT)

Example

switchxxxxxx(config)# clock summer-time abc date apr 1 2010 09:00 aug 2 2010 09:00

clock timezone

To set the time zone for display purposes, use the clock timezone command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax

clock timezone zone hours-offset [minutes-offset] no clock timezone

Parameters

  • zone—The acronym of the time zone. (Range: Up to 4 characters)
  • hours-offset—Hours difference from UTC. (Range: (-12)–(+13))
  • minutes-offset—(Optional) Minutes difference from UTC. (Range: 0–59)

Default Configuration

Coordinated Universal Time (UTC) or Greenwich Mean Time (GMT), which is the same:

  • Offsets are 0.
  • Acronym is empty.

Command Mode

Global Configuration mode

User Guidelines

The system internally keeps time in UTC, so this command is used only for display purposes and when the time is manually set.

Example

switchxxxxxx(config)# clock timezone abc +2 minutes 32

sntp anycast client enable

To enable the SNTP Anycast client, use the sntp anycast client enable command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax

sntp anycast client enable [both | ipv4 | ipv6]

Parameters

  • both—(Optional) Specifies the IPv4 and IPv6 SNTP Anycast clients are enabled. If the parameter is not defined it is the default value.
  • ipv4—(Optional) Specifies the IPv4 SNTP Anycast clients are enabled.
  • ipv6—(Optional) Specifies the IPv6 SNTP Anycast clients are enabled.

Default Configuration

The SNTP anycast client is disabled.

Command Mode

Global Configuration mode

User Guidelines

Use this command to enable the SNTP Anycast client.

Example

The following example enables SNTP Anycast clients.

switchxxxxxx(config)# sntp anycast client enable

sntp authenticate

To enable authentication for received SNTP traffic from servers, use the sntp authenticate command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax

sntp authenticate no sntp authenticate

Parameters

N/A

Default Configuration

Authentication is disabled.

Command Mode

Global Configuration mode

Examples

The following example enables authentication for received SNTP traffic and sets the key and encryption key.

switchxxxxxx(config)# sntp authenticate
switchxxxxxx(config)# sntp authentication-key 8 md5 ClkKey
switchxxxxxx(config)# sntp trusted-key 8

sntp authentication-key

To define an authentication key for Simple Network Time Protocol (SNTP), use the sntp authentication-key command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax sntp authentication-key key-number md5 key-value no sntp authentication-key key-number

Parameters

  • key-number—Specifies the key number. (Range: 1–4294967295)
  • key-value—Specifies the key value. (Length: 1–8 characters)

Default Configuration

No authentication key is defined.

Command Mode

Global Configuration mode

Examples

The following example defines the authentication key for SNTP.

switchxxxxxx(config)# sntp authentication-key 8 md5 ClkKey
switchxxxxxx(config)# sntp authentication-key 8 md5 ClkKey
switchxxxxxx(config)# sntp trusted-key 8
switchxxxxxx(config)# sntp authenticate

sntp broadcast client enable

To enable SNTP Broadcast clients, use the sntp broadcast client enable command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax

sntp broadcast client enable [both | ipv4 | ipv6] no sntp broadcast client enable

Parameters

  • both—(Optional) Specifies the IPv4 and IPv6 SNTP Broadcast clients are enabled. If the parameter is not defined it is the default value.
  • ipv4—(Optional) Specifies the IPv4 SNTP Broadcast clients are enabled.
  • ipv6—(Optional) Specifies the IPv6 SNTP Broadcast clients are enabled.

Default Configuration

The SNTP Broadcast client is disabled.

Command Mode

Global Configuration mode

User Guidelines

Use the sntp broadcast client enable Interface Configuration mode command to enable the SNTP Broadcast client on a specific interface.

After entering this command, you must enter the clock source command with the sntp keyword for the command to be run. If this command is not run, the switch will not synchronize with Broadcast servers.

Example

The following example enables SNTP Broadcast clients.

s

switchxxxxxx(config)# sntp broadcast client enable

sntp client enable

To enable the SNTP Broadcast and Anycast client, use the sntp client enable command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax

sntp client enable interface-id no sntp client enable interface-id

Parameters

  • interface-id—Specifies an interface ID, which can be one of the following types: Ethernet port, Port-channel or VLAN.

Default Configuration

The SNTP client is disabled.

Command Mode

Global Configuration mode

User Guidelines

Use the sntp client enable command to enable SNTP Broadcast and Anycast clients.

Example

The following example enables the SNTP Broadcast and Anycast clients on VLAN 100:

switchxxxxxx(config)# sntp client enable vlan 100

sntp client enable (interface)

To enable the SNTP Broadcast and Anycast client on an interface, use the sntp client enable command in Interface Configuration mode. To restore the default configuration, use the no form of this command.

Syntax

sntp client enable no sntp client enable

Parameters

N/A

Default Configuration

The SNTP client is disabled on an interface.

Command Mode

Interface Configuration mode

User Guidelines

This command enables the SNTP Broadcast and Anycast client on an interface. Use the no form of this command to disable the SNTP client.

Example

The following example enables the SNTP broadcast and anycast client on an interface.

switchxxxxxx(config)# interface vlan 100
switchxxxxxx(config-if)# sntp client enable
switchxxxxxx(config-if)# exit

sntp server

To configure the device to use the SNTP to request and accept Network Time Protocol (NTP) traffic from a specified server (meaning to accept system time from an SNTP server), use the sntp server command in Global Configuration mode. To remove a server from the list of SNTP servers, use the no form of this command.

Syntax

sntp server {ip-address | hostname} [poll] [key keyid] no sntp server [ip-address | hostname]

Parameters

  • ip-address—Specifies the server IP address. This can be an IPv4, IPv6 or IPv6z address.
  • hostname—Specifies the server hostname. Only translation to IPv4 addresses is supported. (Length: 1–158 characters. Maximum label length for each part of the hostname: 63 characters)
  • poll—(Optional) Enables polling.
  • key keyid—(Optional) Specifies the Authentication key to use when sending packets to this peer. (Range:1–4294967295)

Default Configuration

No servers are defined.

Command Mode

Global Configuration mode

User Guidelines

Use the sntp server {ip-address | hostname} [poll] [key keyid] command to define a SNTP server. The switch supports up to 8 SNTP servers.

Use the no sntp server ip-address | hostname command to remove one SNTP server.

Use the no sntp server to remove all SNTP servers.

Example

The following example configures the device to accept SNTP traffic from the server on 192.1.1.1 with polling.

switchxxxxxx(config)# sntp server 192.1.1.1 poll

sntp source-interface

To specify the source interface whose IPv4 address will be used as the source IPv4 address for communication with IPv4 SNTP servers, use the sntp source-interface command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax

sntp source-interface interface-id

no sntp source-interface

Parameters

  • interface-id—Specifies the source interface.

Default Configuration

The source IPv4 address is the IPv4 address defined on the outgoing interface and belonging to next hop IPv4 subnet.

Command Mode

Global Configuration mode

User Guidelines

If the source interface is the outgoing interface, the interface IP address belonging to next hop IPv4 subnet is applied.

If the source interface is not the outgoing interface, the minimal IPv4 address defined on the interface is applied.

If there is no available IPv4 source address, a SYSLOG message is issued when attempting to communicate with an IPv4 SNTP server.

OOB cannot be defined as a source interface.

Example

The following example configures the VLAN 10 as the source interface.

switchxxxxxx(config)# sntp source-interface vlan 10

sntp source-interface-ipv6

To specify the source interface whose IPv6 address will be used ad the Source IPv6 address for communication with IPv6 SNTP servers, use the sntp source-interface-ipv6 command in Global Configuration mode. To restore the default configuration, use the no form of this command.

Syntax

sntp source-interface-ipv6 interface-id

no sntp source-interface-ipv6

Parameters

  • interface-id—Specifies the source interface.

Default Configuration

The IPv6 source address is the IPv6 address defined of the outgoing interface and selected in accordance with RFC6724.

Command Mode

Global Configuration mode

User Guidelines

The outgoing interface is selected based on the SNTP server’s IP address. If the source interface is the outgoing interface, the IPv6 address defined on the interfaces and selected in accordance with RFC 6724.

If the source interface is not the outgoing interface, the minimal IPv4 address defined on the interface and with the scope of the destination IPv6 address is applied.

If there is no available IPv6 source address, a SYSLOG message is issued when attempting to communicate with an IPv6 SNTP server.

Example

The following example configures the VLAN 10 as the source interface.

switchxxxxxx(config)# sntp source-interface-ipv6 vlan 10

sntp trusted-key

To define the trusted key, use the sntp trusted-key command in Global

Configuration mode. To restore the default configuration, use the no form of this command.

Syntax sntp trusted-key key-number no sntp trusted-key key-number Parameters

  • key-number—Specifies the key number of the authentication key to be trusted. (Range: 1–4294967295).

Default Configuration No keys are trusted.

Command Mode

Global Configuration mode

User Guidelines

The trusted key is used for authentication of all servers not having personal keys assigned by the sntp server command.

Examples

The following example authenticates key 8.

switchxxxxxx(config)# sntp trusted-key 8
switchxxxxxx(config)# sntp authentication-key 8 md5 ClkKey
switchxxxxxx(config)# sntp trusted-key 8
switchxxxxxx(config)# sntp authenticate

sntp unicast client enable

To enable the device to use Simple Network Time Protocol (SNTP) Unicast clients, use the sntp unicast client enable command in Global Configuration mode. To disable the SNTP Unicast clients, use the no form of this command.

Syntax

sntp unicast client enable no sntp unicast client enable

Parameters

N/A

Default Configuration

The SNTP unicast clients are disabled.

Command Mode

Global Configuration mode

User Guidelines

Use the sntp server Global Configuration mode command to define SNTP servers.

Example

The following example enables the device to use SNTP Unicast clients.

switchxxxxxx(config)# sntp unicast client enable

sntp unicast client poll

To enable polling for the SNTP Unicast clients, use the sntp unicast client poll command in Global Configuration mode. To disable the polling, use the no form of this command.

Syntax

sntp unicast client poll no sntp unicast client poll

Parameters

N/A

Default Configuration Polling is disabled.

Command Mode

Global Configuration mode

User Guidelines

The polling interval is 1024 seconds.

Example

The following example enables polling for SNTP unicast clients.

switchxxxxxx(config)# sntp unicast client poll

show clock

To display the time and date from the system clock, use the show clock command in User EXEC mode.

Syntax

show clock [detail]

Parameters

  • detail—(Optional) Displays the time zone and summer time configuration.

Command Mode

User EXEC mode

User Guidelines

Before the time, there is displayed either a star (*), period (.), or blank:

  • star (*)—The clock is invalid.
  • period (.)—The clock was set manually.
  • blank—The clock was set by SNTP.

Examples

Example 1 – The following example displays the system time and date.

switchxxxxxx# show clock
 
15:29:03 PDT(UTC-7) Jun 17 2002
 
Time source is SNTP

Example 2 – The following example displays the system time and date along with the time zone and summer time configuration.

switchxxxxxx# show clock detail
 
15:22:55 SUN Apr 23 2012
 
Time source is sntp
 
Time zone (DHCPv4 on VLAN1):
 
Acronym is RAIN
 
Offset is UTC+2
 
Time zone (Static):
 
Offset is UTC+0
 
Summertime (DHCPv4 on VLAN1):
 
Acronym is SUN
 
Recurring every year.
 
Begins at first Sunday of Apr at 02:00.
 
Ends at first Tuesday of Sep at 02:00.
 
Offset is 60 minutes.
 
Summertime (Static):
 
Acronym is GMT
 
Recurring every year.
 
Begins at first Sunday of Mar at 10:00.
 
Ends at first Sunday of Sep at 10:00.
 
Offset is 60 minutes.                               
 
DHCP timezone: Enabled

show sntp configuration

To display the SNTP configuration on the device, use the show sntp configuration command in Privileged EXEC mode.

Syntax

show sntp configuration

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Examples

The following example displays the device’s current SNTP configuration.

switchxxxxxx# show sntp configuration
 
SNTP port : 123
 
Polling interval: 1024 seconds
 
MD5 Authentication Keys
 
-----------------------------------
 
John123
Alice456
 
-----------------------------------
 
Authentication is not required for synchronization.
 
No trusted keys
 
Unicast Clients: enabled
 
Unicast Clients Polling: enabled
 
Server: 1.1.1.121
 
Polling: disabled
 
Encryption Key: disabled
 
Server: 3001:1:1::1
 
Polling: enabled
 
Encryption Key: disabled
 
Server: dns_server1.comapany.com
 
Polling: enabled
 
Encryption Key: disabled
 
Server: dns_server2.comapany.com
 
Polling: enabled
 
Encryption Key: disabled
 
Broadcast Clients: enabled for IPv4 and IPv6
 
Anycast Clients: disabled
 
No Broadcast Interfaces
 
Source IPv4 interface: vlan 1
 
Source IPv6 interface: vlan 10

show sntp status

To display the SNTP servers status, use the show sntp status command in Privileged EXEC mode.

Syntax

show sntp status

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

The following example displays the SNTP servers status:

switchxxxxxx# show sntp status
 
Clock is synchronized, stratum 4, reference is 176.1.1.8, unicast
 
Reference time is afe2525e.70597b34 (00:10:22.438 PDT Jul 5 1993) Unicast servers:
 
Server: 176.1.1.8
 
Source: DHCPv4 on VLAN 1
 
Status: Up
 
Last response: 19:58:22.289 PDT Feb 19 2005
 
Stratum Level: 1
 
Offset: 7.33mSec
 
Delay: 117.79mSec
 
Server: dns_server.comapany.com
 
Source:  static
 
Status: Unknown
 
Last response: 12:17.17.987 PDT Feb 19 2005
 
Stratum Level: 1
 
Offset: 8.98mSec
 
Delay: 189.19mSec
 
Server: 3001:1:1::1
 
Source: DHCPv6 on VLAN 2
 
Status: Unknown   Last response:
 
Offset: mSec
 
Delay: mSec
 
Server: dns1.company.com
 
Source: DHCPv6 on VLAN 20
 
Status: Unknown   Last response:
 
Offset: mSec
 
Delay: mSec
 
Anycast servers:
 
Server: 176.1.11.8
 
Interface:  VLAN 112
 
Status: Up
 
Last response: 9:53:21.789 PDT Feb 19 2005
 
Stratum Level: 10   Offset: 9.98mSec
 
Delay: 289.19mSec Broadcast servers: Server: 3001:1::12
 
Interface:  VLAN 101
 
Last response: 9:53:21.789 PDT Feb 19 2005
 
Stratum Level: 255

Was this article helpful?

Related Articles

Leave A Comment?