Fortinet white logo
Fortinet white logo

CLI Reference

system ntp

system ntp

Use this command to manage the connection to an NTP server.

To use this command, your administrator account’s access control profile must have rw permission to the netgrp area. For details, see Permissions.

Syntax

config system ntp

set ntpsync {enable|disable}

set syncinterval <integer>

config ntp-server

edit <no.>

set server <server_name>

set authentication {enable|disable}

set key-type {aes128|aes256|sha1|sha256}

set key <key>

set key-id <key_id>

set ip-type {v4|v6|both}

next

end

end

Variable Description

Default

ntpsync

Enable/disable use of NTP.
When ntpsync is enabled, config ntp-server becomes configurable.

Enable

syncinterval

Specify how often the system synchronizes its time with the NTP server. The default is 60 minutes. The valid range is 1-1440.

60

config ntp-server

server

Specify the IP address or domain name of an NTP server or pool, such as pool.ntp.org.

To find an NTP server, go to http://www.ntp.org.

No default

authentication

Enable to apply authentication keys to secure the NTP server. This is disabled by default.

disable

key-type

The key-type option is available if authentication is enabled.

Select the key type from the following:

  • aes128
  • aes256
  • sha1
  • sha256

The default option is sha1.

sha1

key

The key option is available if authentication is enabled.

Specify the Key in hexadecimal format. The maximum length is 127 digits or characters.

No default

key-id

The key-id option is available if authentication is enabled.

Specify the Key ID. The valid range is 0-65536

No default

ip-type

Select the IP type from the following:

  • v4
  • v6
  • both

The default option is v4.

v4

Example

config system time ntp
   set ntpsync enable
   set syncinterval 1
   config  ntp-server
      edit 1
         set server 10.159.0.114
         set authentication enable
         set key-type aes256
         set key ENC
         set key-id 7
         set ip-type v4
      next
   end
end

system ntp

system ntp

Use this command to manage the connection to an NTP server.

To use this command, your administrator account’s access control profile must have rw permission to the netgrp area. For details, see Permissions.

Syntax

config system ntp

set ntpsync {enable|disable}

set syncinterval <integer>

config ntp-server

edit <no.>

set server <server_name>

set authentication {enable|disable}

set key-type {aes128|aes256|sha1|sha256}

set key <key>

set key-id <key_id>

set ip-type {v4|v6|both}

next

end

end

Variable Description

Default

ntpsync

Enable/disable use of NTP.
When ntpsync is enabled, config ntp-server becomes configurable.

Enable

syncinterval

Specify how often the system synchronizes its time with the NTP server. The default is 60 minutes. The valid range is 1-1440.

60

config ntp-server

server

Specify the IP address or domain name of an NTP server or pool, such as pool.ntp.org.

To find an NTP server, go to http://www.ntp.org.

No default

authentication

Enable to apply authentication keys to secure the NTP server. This is disabled by default.

disable

key-type

The key-type option is available if authentication is enabled.

Select the key type from the following:

  • aes128
  • aes256
  • sha1
  • sha256

The default option is sha1.

sha1

key

The key option is available if authentication is enabled.

Specify the Key in hexadecimal format. The maximum length is 127 digits or characters.

No default

key-id

The key-id option is available if authentication is enabled.

Specify the Key ID. The valid range is 0-65536

No default

ip-type

Select the IP type from the following:

  • v4
  • v6
  • both

The default option is v4.

v4

Example

config system time ntp
   set ntpsync enable
   set syncinterval 1
   config  ntp-server
      edit 1
         set server 10.159.0.114
         set authentication enable
         set key-type aes256
         set key ENC
         set key-id 7
         set ip-type v4
      next
   end
end