Setting the time zone, date and time requires root privileges; use
Setting the Time Zone
To see the current time zone, list the contents of
Edit the file to add your desired time zone. A list of valid time zones can be found at the following link.
Use the following command to apply the new time zone immediately.
Alternative: Use the Guided Wizard to Find and Apply a Time Zone
To set the time zone, run
dpkg-reconfigure tzdata as root:
Then navigate the menus to enable the time zone you want. The following example selects the US/Pacific time zone:
For more info see the Debian System Administrator’s Manual – Time.
Setting the Date and Time
The switch contains a battery backed hardware clock that maintains the time while the switch is powered off and in between reboots. When the switch is running, the Cumulus Linux operating system maintains its own software clock.
During boot up, the time from the hardware clock is copied into the operating system’s software clock. The software clock is then used for all timekeeping responsibilities. During system shutdown the software clock is copied back to the battery backed hardware clock.
You can set the date and time on the software clock using the
date command. First, determine your current time zone:
If you need to reconfigure the current time zone, refer to the instructions above.
Then, to set the system clock according to the time zone configured:
man date(1) for if you need more information.
You can write the current value of the system (software) clock to the hardware clock using the
man hwclock(8) if you need more information.
Setting Time Using NTP and NCLU
ntpd daemon running on the switch implements the NTP protocol. It synchronizes the system time with time servers listed in
/etc/ntp.conf. It is started at boot by default. See
man ntpd(8) for
/etc/ntp.conf contains some default time servers. You can specify the NTP server or servers you want to use with NCLU; include the
iburst option to increase the sync speed.
These commands add the NTP server to the list of servers in
To set the initial date and time via NTP before starting the
ntpd daemon, use
ntpd -q. This is same as
ntpdate, which is to be retired and no longer available. See
man ntp.conf(5) for details on configuring
ntpd -qcan hang if the time servers are not reachable.
To verify that
ntpd is running on the system:
To check the NTP peer status:
Specifying the NTP Source Interface
You can change the source interface that NTP uses if you want to use an interface other than eth0, the default.
These commands create the following configuration snippet in the
NTP Default Configuration
The default NTP configuration comprises the following servers, which are listed in the
- server 0.cumulusnetworks.pool.ntp.org iburst
- server 1.cumulusnetworks.pool.ntp.org iburst
- server 2.cumulusnetworks.pool.ntp.org iburst
- server 3.cumulusnetworks.pool.ntp.org iburst
If you need to restore the default NTP configuration, its contents are listed below.