How can we help?

Command line - Fortinet FortiGate firewall example

Follow

Log into the device with Telnet or SSH. Enter privileged mode by typing enable and entering your enable password.

Enable DNS lookup

You need to make sure DNS lookups are enabled on your device so it can be synced to an NTP server. Run the following command. Replace 8.8.8.8 8.8.4.4 with the DNS servers you’d like to use.

config system dns
set primary 8.8.8.8
set secondary 8.8.4.4
set domain <local domain_str>
end

Set the clock, time zone, and NTP server

The commands below set the time zone on your device.

config system global
  set timezone 12
  set dst (enable | disable)
end
execute time <time_str>
execute date <date_str>

# <timezone 12> is the index number of the timezone in the FortiWeb appliance. 
To view the list of valid time zones, and the associated index numbers, enter ? # dst (enable | disable) is a choice between enabling or disabling daylight
savings time clock adjustments. # <time_str> is the time for the time zone in which the FortiWeb appliance is
located according to a 24-hour clock. Which is formatted as, hh:mm:ss (00:00:00) # <date_str> is the date for the timezone in which the FortiWeb appliance is
located. Which is formatted as, yyyy-mm-dd (2019-01-01)

These next commands set the NTP synchronization server. We’re using GMT-5 (Eastern Time zone in North America) in this example. Update timezone 12 to match your time zone.

config system global
 set ntpsync enable
  set timezone 12
   set ntpserver pool.ntp.org
end
Confirm the NTP settings

To make sure the settings took effect, run the following command:

get system status 
Synchronize with an NTP server

To make sure the unit has synchronized with an NTP server, run the following command:

config system global
set cfg save automatic
end

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request