Configuring and Using SNTP

  1. Identify the host(s) that are configured as NTP server(s). Additionally, identify the preferred method for obtaining NTP updates. The options are for the NTP server to send out broadcasts, or for switches using NTP to query the NTP server(s) directly. A combination of both methods is possible. You must identify the method that should be used for the switch being configured.
  2. Configure the Greenwich Mean Time (GMT) offset and Daylight Saving Time preference. The command syntax to configure GMT offset and usage of Daylight Saving Time is as follows:
    configure timezone {name tz_name} GMT_offset {autodst {name dst_timezone_ID} {dst_offset} begins [every floatingday | on absoluteday] {at time_of_day_hour time_of_day_minutes} {ends [every floatingday | on absoluteday] {at time_of_day_hour time_of_day_minutes}}}
    By default beginning in 2007, Daylight Saving Time is assumed to begin on the second Sunday in March at 2:00 AM, and end the first Sunday in November at 2:00 AM and to be offset from standard time by one hour.
    1. If this is the case in your time zone, you can set up automatic daylight saving adjustment with the command:
      configure timezone GMT_offset autodst
    2. If your time zone uses starting and ending dates and times that differ from the default, you can specify the starting and ending date and time in terms of a floating day, as follows:
      configure timezone name MET 60 autodst name MDT begins every last sunday march 
      at 1 30 ends every last sunday october at 1 30
    3. You can also specify a specific date and time, as shown in the following command:
      configure timezone name NZST 720 autodst name NZDT 60 begins every first sunday october 
      at 2 00 ends on 3 16 2004 at 2 00
      The optional time zone IDs are used to identify the time zone in display commands such as show switch {detail}.
      Time Zone Configuration Command Options describes the time zone command options in detail.
      Click to expand in new window

      Time Zone Configuration Command Options

      tz_name Specifies an optional name for this timezone specification. May be up to six characters in length. The default is an empty string.
      GMT_offset Specifies a Greenwich Mean Time (GMT) offset, in + or - minutes.
      autodst Enables automatic Daylight Saving Time.
      dst_timezone_ID Specifies an optional name for this Daylight Saving Time specification. May be up to six characters in length. The default is an empty string.
      dst_offset Specifies an offset from standard time, in minutes. Value is from 1–60. The default is 60 minutes.
      floatingday Specifies the day, week, and month of the year to begin or end Daylight Saving Time each year. Format is week day month where:
      • week is specified as [first | second | third | fourth | last]
      • day is specified as [sunday | monday | tuesday | wednesday | thursday | friday | saturday]
      • month is specified as [january | february | march | april | may | june | july | august | september | october | november | december]
      Default for beginning is second sunday march; default for ending is first sunday november.

      absoluteday

      Specifies a specific day of a specific year on which to begin or end DST. Format is month day year where:
      • month is specified as 1–12
      • day is specified as 1–31
      • year is specified as 1970–2035
      The year must be the same for the begin and end dates.
      time_of_day_hour Specifies the time of day to begin or end Daylight Saving Time. May be specified as an hour (0–23). The default is 2.
      time_of_day_minutes Specify the minute to begin or end Daylight Saving Time. May be specified as a minute (0–59).
      noautodst Disables automatic Daylight Saving Time.
  3. Automatic Daylight Saving Time changes can be enabled or disabled.
    The default setting is enabled. To disable automatic Daylight Saving Time, use the command:
    configure timezone {name tz_name} GMT_offset noautodst
  4. Enable the SNTP client using the following command:
    enable sntp-client
    After SNTP has been enabled, the switch sends out a periodic query to the NTP servers defined in the next step (if configured) or listens to broadcast NTP updates from the network. The network time information is automatically saved into the onboard real-time clock.
  5. If you would like this switch to use a directed query to the NTP server, configure the switch to use the NTP server(s). An NTP server can be an IPv4 address or an IPv6 address or a hostname. If the switch listens to NTP broadcasts, skip this step. To configure the switch to use a directed query, use the following command:
    configure sntp-client [primary | secondary] host-name-or-ip {vr vr_name}

    The following two examples use an IPv6 address as an NTP server and a hostname as an NTP server:

    configure sntp-client primary fd98:d3e2:f0fe:0:54ae:34ff:fecc:892
    configure sntp-client primary ntpserver.mydomain.com
    NTP queries are first sent to the primary server. If the primary server does not respond within one second, or if it is not synchronized, the switch queries the secondary server (if one is configured). If the switch cannot obtain the time, it restarts the query process. Otherwise, the switch waits for the sntp-client update interval before querying again.
  6. Optionally, the interval for which the SNTP client updates the real-time clock of the switch can be changed using the following command:
    configure sntp-client update-interval update-interval

    The default sntp-client update-interval value is 64 seconds.

  7. Verify the configuration.
    1. show sntp-client
      This command provides configuration and statistics associated with SNTP and its connectivity to the NTP server.
    2. show switch {detail}
      This command indicates the GMT offset, the Daylight Saving Time configuration and status, and the current local time.
NTP updates are distributed using GMT time.
To properly display the local time in logs and other time-stamp information, the switch should be configured with the appropriate GMT offset to GMT based on geographical location.