Commands For Ntp

13.2 Commands for NTP

13.2.1 clock timezone

Command: clock timezone <WORD> {add | subtract} <0-23> [<0-59>] no clock timezone WORD
Function: This command configures the time zone in global mode. The no command deletes the configured time zone.
Parameters:

  • <WORD>: time zone name. The length should not exceed 16 characters.
  • add | subtract: specifies the action desired.
  • <0-23>: hour value.
  • <0-59>: minute value.

Command mode: Global Mode
Default: None.
Usage guide: The time zone name is invalid if?left blank. The hour and minute value must be in the valid range.
Example: Configure to add the eighth time zone globally.

active500EM(config)#clock timezone aaa add 8

 

13.2.2 debug ntp adjust

Command: debug ntp adjust
no debug ntp adjust
Function: Enable or disable the debug switch display information adjusted for local time.
Parameters: None.
Command mode: Admin Mode
Default: Disabled.
Usage guide: Enable or disable the debug switch display information adjusted for local time.
Example: Enable the debug switch to display information adjusted for local time.

active500EM#debug ntp adjust

 

13.2.3 debug ntp authentication

Command: debug ntp authentication
no debug ntp authentication
Function: Display NTP authentication information. The no command disables the display of NTP authentication information.
Parameters: None.
Command mode: Admin Mode
Default: Disabled.
Usage guide: If the switch is enabled and if the packets carry authentication information when the packet is in the sending or receiving process, then the key identifier will be displayed.
Example: Enable the switch to display NTP authentication information.

active500EM#debug ntp authentication

 

13.2.4 debug ntp events

Command: debug ntp events
no debug ntp events
Function: Enable or disable the debug switch to display an NTP event.
Parameters: None.
Command mode: Admin Mode
Default: Disabled.
Usage guide: If a server changes from available to unavailable or from unavailable to available, the received illegal packet events will be displayed if this command is enabled.
Example: Enable the debug switch to display NTP event information.

active500EM#debug ntp events

 

13.2.5 debug ntp packet

Command: debug ntp packet [send | receive] no debug ntp packet [send | receive]
Function: Enable or disable the debug switch to display NTP packet information.
Parameters:

  • send: selects the debug switch sending a NTP packet.
  • receive: selects the debug switch receiving a NTP packet.
  • If no parameter is set, both sending and receiving switches will be enabled.

Command mode: Admin Mode
Default: Disabled.
Usage guide: Enable or disable the debug switch to display NTP packet information.
Example: Enable the debug switch to display NTP packet information.

active500EM#debug ntp packet

 

13.2.6 debug ntp sync

Command: debug ntp sync
no debug ntp sync
Function: Enable or disable the debug switch to display local time synchronization information.
Parameters: None
Command mode: Admin Mode
Default: Disabled.
Usage guide: Enable or disable the debug switch to display local time synchronization information.
Example: Enable the debug switch to display local time synchronization information.

active500EM#debug ntp sync

 

13.2.7 ntp access-group

Command: ntp access-group server <acl>
no ntp access-group server <acl>
Function: Configure or cancel the access control list of the NTP Server.
Parameters:

  • <acl>: ACL number. The valid range is from 1 to 99.

Command mode: Global Mode
Default: Not configured.
Usage guide: Configure or cancel the access control list of the NTP Server.
Example: Configure access control list 2 on the switch.

active500EM(config)#ntp access-group server 2

 

13.2.8 ntp authenticate

Command: ntp authenticate
no ntp authenticate
Function: Enable or cancel an NTP authentication function.
Parameters: None
Command mode: Global Mode
Default: Disabled
Usage guide: Enable or cancel a NTP authentication function.
Example: Enable a NTP authentication function.

active500EM(config)#ntp authenticate

 

13.2.9 ntp authentication-key

Command: ntp authentication-key <key-id> md5 <value>
no ntp authentication-key <key-id>
Function: Enable or cancel a NTP authentication function and defined NTP authentication key.
Parameters:

  • <key-id>: id of the key. The valid range is from 1 to 4294967295.
  • <value>: value of the key. The valid range is between 1 and 16 in ASCII code.

Command mode: Global Mode
Default: None.
Usage guide: Enable or cancel a NTP authentication function and defined NTP authentication key.
Example: Define the authentication key of a NTP authentication with key-id 20, md5 abc.

active500EM(config)#ntp authentication-key 20 md5 abc

 

13.2.10 ntp broadcast client

Command: ntp broadcast client
no ntp broadcast client
Function: Configure or cancel reception of NTP broadcast packets at a specified port.
Parameters: None.
Command mode: VLAN configuration mode
Default: Disabled.
Usage guide: Configure or cancel reception of NTP broadcast packets at a specified port.
Example: Enable a VLAN1 interface to receive NTP broadcast packets.

active500EM(config)#interface vlan 1
active500EM(config-if-vlan1)#ntp broadcast client

 

13.2.11 ntp broadcast server count

Command: ntp broadcast server count <number>
no ntp broadcast server count
Function: Set the maximum number of broadcast or multicast servers supported by the NTP client. The no command cancels the configuration and restores to default.
Parameters:

  • <number>: maximum number of broadcast servers. The valid range is from 1 to 100.

Command mode: Global Mode
Default: 50.
Usage guide: Set the maximum number of broadcast or multicast servers supported by the NTP client.
Example: Configure the maximum number of broadcast servers to 70 on the switch.

active500EM(config)#ntp broadcast server count 70

 

13.2.12 ntp disable

Command: ntp disable
no ntp disable
Function: Disable or enable the NTP function on a port.
Parameters: None
Command mode: VLAN Configuration Mode
Default: Enabled.
Usage guide: Disable or enable the NTP function on a port.
Example: Disable the NTP function on the VLAN1 interface.

active500EM(config)#interface vlan 1
active500EM(config-if-vlan1)#ntp disable

 

13.2.13 ntp enable

Command: ntp enable
ntp disable
Function: Enable or disable NTP globally.
Parameters: None
Command mode: Global Mode
Default: Disabled.
Usage guide: Enable or disable NTP globally.
Example: Enable NTP.

active500EM(config)#ntp enable

 

13.2.14 ntp ipv6 multicast client

Command: ntp ipv6 multicast client
no ntp ipv6 multicast client
Function: Configure the specified interface to receive IPv6 NTP multicast packets. The no command cancels the specified interface?s receipt of IPv6 NTP multicast packets.
Parameters: None.
Command mode: VLAN Mode
Default: Interface does not receive IPv6 NTP multicast packets.
Usage guide: Configure the specified interface to receive IPv6 NTP multicast packets.
Example: Enable the receiving of IPv6 NTP multicast packets on the VLAN1 interface.

active500EM(config)#interface vlan 1
active500EM(config-if-vlan1)#ntp ipv6 multicast client

 

13.2.15 ntp multicast client

Command: ntp multicast client
no ntp multicast client
Function: Configure the specified interface to receive NTP multicast packets. The no command cancels the receipt of NTP multicast packets.
Parameters: None.
Command mode: VLAN mode
Default: Interface does not receive NTP multicast packets.
Usage guide: Configure the specified interface to receive NTP multicast packets.
Example: Enable the receiving of NTP multicast packets on the VLAN1 interface.

active500EM(config)#interface vlan 1
active500EM(config-if-vlan1)#ntp multicast client

 

13.2.16 ntp server

Command: ntp server {<ip-address> | <ipv6-address>} [version <version-no>] [key <key-id>] no ntp server {<ip-address>|<ipv6-address>}
Function: Enable a specified time server of a time source. The no command cancels the specified time server of a time source.
Parameters:

  • <ip-address>: IPv4 address of the time server.
  • <ipv6-address>: IPv6 address of the time server.
  • version: version information configured for the server.
  • <version-no>: version number of the server. The valid range is from 1 to 4 with a default of 4.
  • key: selects a key to configure for the server.
  • <key-id>: key ID.

Command mode: Global Mode
Default: Disabled.
Usage guide: Enable a specified time server of a time source.
Example: Configure the time server address as 1.1.1.1 on the switch.

active500EM(config)#ntp server 1.1.1.1

 

13.2.17 ntp syn-interval

Command: ntp syn-interval <1-3600>
no ntp syn-interval
Function: Configure the request packet sending interval of a NTP client. The no command restores to default.
Parameters:

  • <1-3600>: time interval in seconds.

Command mode: Global Mode
Default: 64s.
Usage guide: In a high latency network, the NTP client will select the time interval with the smallest latency for the system time synchronization after sending 8 NTP time requisitions. In the default configuration, the NTP client sends the requisition packet once every 64s. After 8 time requisitions, it will adjust the interval. This adjustment can happen every 8 minutes. If a user wants to configure the interval to one hour, the user should adjust the packet sending interval to 450s(3600/8).
Example: Configure the interval to an hour, with a packet sending time of 450s.

active500EM(config)#ntp syn-interval 450

 

13.2.18 NTP Trusted-Key

Command: ntp trusted-key <key-id>
no ntp trusted-key <key-id>
Function: Configure the trusted key. The no command cancels the trusted key.
Parameters:

  • <key-id>: ID of the key. The valid range is from 1 to 4294967295.

Command mode: Global Mode
Default: Not configured.
Usage guide: Configure the trusted key.
Example: Configure the specified key 20 as a trusted key.

active500EM(config)#ntp trusted-key 20

 

13.2.19 show ntp status

Command: show ntp status
Function: Display time synchronization status including layers and address of the time server regardless of synchronization.
Parameters: None.
Command mode: Admin and Configuration Mode
Default: None.
Usage guide: Display time synchronization status including layers and address of the time source regardless of synchronization.
Example: Display time synchronization status including layers and address of the time source regardless of synchronization.

active500EM#show ntp status
Clock status: synchronized
Clock stratum: 3
Reference clock server: 1.1.1.2
Clock offset: 0.010 s
Root delay: 0.012 ms
Root dispersion: 0.000 ms
Reference time: TUE JAN 03 01:27:24 2006

 

13.2.20 show ntp session

Command: show ntp session [<ip-address> | <ipv6-address>] Function: Display the information of all NTP sessions or one specific session, including server ID, server layer, and the local offset according to the server. (The symbol * means this server is the selected local time source).
Parameters:

  • <ip-address>: IPv4 address of a specific, configured time server.
  • <ipv6-address>: IPv6 address of a specific, configured time server.
  • If no parameter is specified, the session-relative information of all servers will be displayed, including broadcast and multicast servers.

Command mode: Admin Mode and Configuration Mode
Default: None.
Usage guide: Display the information of all NTP sessions or one specific session, including server ID, server layer, and the local offset according to the server.
Example: Display the information of all NTP sessions or one specific session, including server ID, server layer, and the local offset according to the server.

active500EM#show ntp session
   server       stream      type      rootdelay     rootdispersion    trustlevel
*  1.1.1.2        2         unicast    0.010s        0.002s            10
   2.2.2.2        3         unicast    0.005s        0.000s            10

 


Return to Controller Wired CLI Table of Contents