Fortinet Document Library

Version:


Table of Contents

CLI Reference

6.0.6
Download PDF
Copy Link

system ntp

Use this command to configure Network Time Protocol (NTP) servers. The Network Time Protocol enables you to keep the FortiGate time in sync with other network systems. By enabling NTP on the FortiGate, FortiOS will check with the NTP server you select at the configured intervals. This will also ensure that logs and other time-sensitive settings on the FortiGate are correct.

The FortiGate maintains its internal clock using a built-in battery. At start up, the time reported by the FortiGate will indicate the hardware clock time, which may not be accurate. When using NTP, the system time might change after the FortiGate has successfully obtained the time from a configured NTP server.

config system ntp
    set ntpsync {enable | disable}   Enable/disable setting the FortiGate system time by synchronizing with an NTP Server.
    set type {fortiguard | custom}   Use the FortiGuard NTP server or any other available NTP Server.
            fortiguard  Use the FortiGuard NTP server.
            custom      Use any other available NTP server.
    set syncinterval {integer}   NTP synchronization interval (1 - 1440 min). range[1-1440]
    config ntpserver
        edit {id}
        # Configure the FortiGate to connect to any available third-party NTP server.
            set id {integer}   NTP server ID. range[0-4294967295]
            set server {string}   IP address or hostname of the NTP Server. size[63]
            set ntpv3 {enable | disable}   Enable to use NTPv3 instead of NTPv4.
            set authentication {enable | disable}   Enable/disable MD5 authentication.
            set key {password_string}   Key for MD5 authentication. size[59]
            set key-id {integer}   Key ID for authentication. range[0-4294967295]
        next
    set source-ip {ipv4 address}   Source IP address for communication to the NTP server.
    set source-ip6 {ipv6 address}   Source IPv6 address for communication to the NTP server.
    set server-mode {enable | disable}   Enable/disable FortiGate NTP Server Mode. Your FortiGate becomes an NTP server for other devices on your network. The FortiGate relays NTP requests to its configured NTP server.
    config interface
        edit {interface-name}
        # FortiGate interface(s) with NTP server mode enabled. Devices on your network can contact these interfaces for NTP services.
            set interface-name {string}   Interface name. size[64] - datasource(s): system.interface.name
        next
end

Additional information

The following section is for those options that require additional explanation.

system ntp

Use this command to configure Network Time Protocol (NTP) servers. The Network Time Protocol enables you to keep the FortiGate time in sync with other network systems. By enabling NTP on the FortiGate, FortiOS will check with the NTP server you select at the configured intervals. This will also ensure that logs and other time-sensitive settings on the FortiGate are correct.

The FortiGate maintains its internal clock using a built-in battery. At start up, the time reported by the FortiGate will indicate the hardware clock time, which may not be accurate. When using NTP, the system time might change after the FortiGate has successfully obtained the time from a configured NTP server.

config system ntp
    set ntpsync {enable | disable}   Enable/disable setting the FortiGate system time by synchronizing with an NTP Server.
    set type {fortiguard | custom}   Use the FortiGuard NTP server or any other available NTP Server.
            fortiguard  Use the FortiGuard NTP server.
            custom      Use any other available NTP server.
    set syncinterval {integer}   NTP synchronization interval (1 - 1440 min). range[1-1440]
    config ntpserver
        edit {id}
        # Configure the FortiGate to connect to any available third-party NTP server.
            set id {integer}   NTP server ID. range[0-4294967295]
            set server {string}   IP address or hostname of the NTP Server. size[63]
            set ntpv3 {enable | disable}   Enable to use NTPv3 instead of NTPv4.
            set authentication {enable | disable}   Enable/disable MD5 authentication.
            set key {password_string}   Key for MD5 authentication. size[59]
            set key-id {integer}   Key ID for authentication. range[0-4294967295]
        next
    set source-ip {ipv4 address}   Source IP address for communication to the NTP server.
    set source-ip6 {ipv6 address}   Source IPv6 address for communication to the NTP server.
    set server-mode {enable | disable}   Enable/disable FortiGate NTP Server Mode. Your FortiGate becomes an NTP server for other devices on your network. The FortiGate relays NTP requests to its configured NTP server.
    config interface
        edit {interface-name}
        # FortiGate interface(s) with NTP server mode enabled. Devices on your network can contact these interfaces for NTP services.
            set interface-name {string}   Interface name. size[64] - datasource(s): system.interface.name
        next
end

Additional information

The following section is for those options that require additional explanation.