Clock and NTP Configuration
Clock and NTP Configuration
Section titled “Clock and NTP Configuration”TL;DR (Quick Start)
Section titled “TL;DR (Quick Start)”For the impatient: enable NTP to keep your router’s clock accurate.
/system/ntp/client/set enabled=yes/system/ntp/client/servers/add address=pool.ntp.org/system/clock/set time-zone-name=America/New_YorkVerify with:
/system/ntp/client/printLook for status: synchronized with a synced server.
Overview
Section titled “Overview”What this does: Configures the router’s system clock for accurate time, timezone settings, and automatic synchronization via NTP (Network Time Protocol).
When to use this:
- Every router deployment (accurate time is essential)
- Scheduled tasks and time-based firewall rules
- Certificate validation (SSL/TLS requires correct time)
- Log analysis and troubleshooting
- Any feature that depends on timestamps
Prerequisites:
- Internet connectivity (for external NTP servers)
- DNS configured (if using hostnames like pool.ntp.org)
- Firewall allowing outbound UDP port 123
Configuration Steps
Section titled “Configuration Steps”Step 1: Set Time Zone
Section titled “Step 1: Set Time Zone”Configure your local time zone for correct local time display:
/system/clock/set time-zone-name=America/New_YorkCommon time zones:
America/New_York(US Eastern)America/Los_Angeles(US Pacific)Europe/London(UK)Europe/Berlin(Central Europe)Asia/Tokyo(Japan)Australia/Sydney(Australia Eastern)
Or enable automatic detection:
/system/clock/set time-zone-autodetect=yesStep 2: Enable NTP Client
Section titled “Step 2: Enable NTP Client”Enable NTP for automatic time synchronization:
/system/ntp/client/set enabled=yesStep 3: Add NTP Servers
Section titled “Step 3: Add NTP Servers”Add reliable NTP servers (recommended: use multiple for redundancy):
/system/ntp/client/servers/add address=pool.ntp.org/system/ntp/client/servers/add address=time.google.com/system/ntp/client/servers/add address=time.cloudflare.comStep 4: Verify Synchronization
Section titled “Step 4: Verify Synchronization”Check that NTP is working:
/system/ntp/client/printExpected output:
enabled: yes mode: unicast status: synchronized synced-server: 216.239.35.0 synced-stratum: 1 system-offset: 0.005 sKey indicators: status: synchronized with a valid synced-server.
Common Scenarios
Section titled “Common Scenarios”Scenario: Use Specific NTP Servers Only
Section titled “Scenario: Use Specific NTP Servers Only”Disable DHCP-provided NTP servers and use only your configured servers:
# Disable NTP from DHCP/ip/dhcp-client/set [find] use-peer-ntp=no
# Add your preferred servers/system/ntp/client/servers/add address=time.nist.gov/system/ntp/client/servers/add address=time.google.comScenario: View Current Time
Section titled “Scenario: View Current Time”Check the current date, time, and timezone:
/system/clock/printOutput:
time: 14:32:45 date: jan/15/2026 time-zone-name: America/New_York gmt-offset: -05:00 dst-active: noScenario: Manual Time Zone (Custom UTC Offset)
Section titled “Scenario: Manual Time Zone (Custom UTC Offset)”For locations not in the TZ database:
/system/clock/set time-zone-name=manual/system/clock/manual/set time-zone=+05:30Scenario: Configure Daylight Saving Time Manually
Section titled “Scenario: Configure Daylight Saving Time Manually”If using manual timezone with DST:
/system/clock/manual/set dst-delta=+01:00 \ dst-start="mar/08/2026 02:00:00" \ dst-end="nov/01/2026 02:00:00"Scenario: Set Time Manually (No Internet)
Section titled “Scenario: Set Time Manually (No Internet)”For isolated networks without NTP access:
/system/clock/set date=jan/15/2026 time=14:30:00Note: Manual time is NOT saved in configuration exports.
Scenario: Router as NTP Server
Section titled “Scenario: Router as NTP Server”Serve time to network clients:
/system/ntp/server/set enabled=yesWith local clock fallback (when no upstream NTP):
/system/ntp/server/set enabled=yes use-local-clock=yes local-clock-stratum=10Scenario: Monitor NTP Peers
Section titled “Scenario: Monitor NTP Peers”View detailed NTP peer information:
/system/ntp/monitor-peersShows offset, delay, jitter, and stratum for each server.
Verification
Section titled “Verification”Confirm your clock configuration is working:
Check 1: Verify Time and Timezone
Section titled “Check 1: Verify Time and Timezone”/system/clock/printExpected: Correct date, time, and timezone.
Check 2: Verify NTP Synchronization
Section titled “Check 2: Verify NTP Synchronization”/system/ntp/client/printExpected: status: synchronized with synced-server IP.
Check 3: Check NTP Servers
Section titled “Check 3: Check NTP Servers”/system/ntp/client/servers/printExpected: Servers listed; check resolved-address for FQDN entries.
Check 4: Monitor NTP Quality
Section titled “Check 4: Monitor NTP Quality”/system/ntp/monitor-peersExpected: Low offset (< 100ms), low jitter, stratum < 5.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Solution |
|---|---|---|
| Status stuck on “waiting” | Firewall blocking UDP 123 | Allow outbound UDP 123 in firewall |
| Status stuck on “waiting” | DNS not configured | Add DNS servers: /ip/dns/set servers=8.8.8.8 |
| Status stuck on “waiting” | No route to NTP server | Verify internet connectivity |
| Time resets to 1970 after reboot | No RTC battery on device | Enable NTP with iburst=yes for fast sync at boot |
| Wrong time displayed | Timezone not set | Set correct time-zone-name |
| Certificate errors | Clock set to wrong date | Fix NTP sync before using HTTPS/SSL |
| SNTP menu missing (v7) | v7 merged SNTP into NTP | Use /system/ntp/client instead |
| ”Server IP mismatch” errors | Load-balanced NTP servers | Add multiple servers; some will work |
| Clock jumps frequently | Poor NTP server or hardware drift | Use reliable servers; increase min-poll |
Debug: Check NTP Log Messages
Section titled “Debug: Check NTP Log Messages”/log/print where topics~"ntp"Look for “change time” messages (normal during initial sync) or error messages.
Common Mistakes
- Don’t forget timezone - UTC is used if not configured; logs will show wrong local time
- Don’t rely on manual time - It’s not exported with configuration and resets on reboot
- Don’t block UDP 123 - NTP requires outbound access on this port
- Don’t use local clock as primary - Internal clock is unreliable; always sync with NTP
- Don’t set low stratum for local clock - Use stratum 10+ to prevent clients preferring it over real NTP
NTP Client Status Reference
Section titled “NTP Client Status Reference”| Status | Description |
|---|---|
synchronized | Successfully synced with NTP server |
waiting | Attempting to contact NTP servers |
stopped | NTP client is disabled |
using-local-clock | No external sync; using internal clock |
Related Topics
Section titled “Related Topics”Time Synchronization
Section titled “Time Synchronization”- NTP Client - automatic time synchronization
- NTP Server - serve time to network clients
- IP Cloud - alternative time sync via MikroTik Cloud
Time-Dependent Features
Section titled “Time-Dependent Features”- Scheduler - time-based task execution
- Firewall Basics - time-based firewall rules
- Certificates - SSL/TLS requires accurate time
- Logging - log timestamps depend on clock
Network Services
Section titled “Network Services”- DHCP Server - distribute NTP server address
- DNS Server - DoH requires correct time
Reference
Section titled “Reference”- MikroTik Clock Documentation
- MikroTik NTP Documentation
- Version changes:
- v7.0: SNTP integrated into NTP client
- v6.43: Time zone autodetect added
Key Properties Reference
Section titled “Key Properties Reference”Clock Properties (/system/clock)
Section titled “Clock Properties (/system/clock)”| Property | Type | Default | Description |
|---|---|---|---|
time | HH:MM:SS | - | Current local time |
date | mmm/DD/YYYY | - | Current date |
time-zone-name | string | manual | TZ database timezone name |
time-zone-autodetect | yes/no | yes | Auto-detect via MikroTik Cloud |
gmt-offset | time | - | Read-only: current GMT offset |
dst-active | yes/no | - | Read-only: DST currently active |
NTP Client Properties (/system/ntp/client)
Section titled “NTP Client Properties (/system/ntp/client)”| Property | Type | Default | Description |
|---|---|---|---|
enabled | yes/no | no | Enable NTP client |
mode | enum | unicast | broadcast/manycast/multicast/unicast |
status | string | - | Read-only: synchronization status |
synced-server | IP | - | Read-only: current NTP server |
system-offset | time | - | Read-only: offset from NTP server |
NTP Server Properties (/system/ntp/client/servers)
Section titled “NTP Server Properties (/system/ntp/client/servers)”| Property | Type | Default | Description |
|---|---|---|---|
address | IP/FQDN | - | NTP server address |
min-poll | 3-17 | 6 | Min poll interval (2^n seconds) |
max-poll | 3-17 | 10 | Max poll interval (2^n seconds) |
iburst | yes/no | yes | Rapid burst at startup |
Command Reference
Section titled “Command Reference”| Command | Description |
|---|---|
/system/clock/print | Display current date, time, and timezone |
/system/clock/set | Set time, date, or timezone |
/system/clock/manual/set | Configure manual timezone offset and DST |
/system/ntp/client/print | Show NTP client status |
/system/ntp/client/set | Enable/configure NTP client |
/system/ntp/client/servers/add | Add an NTP server |
/system/ntp/client/servers/print | List configured NTP servers |
/system/ntp/client/servers/remove | Remove an NTP server |
/system/ntp/monitor-peers | Real-time NTP peer monitoring |
/system/ntp/server/set | Configure router as NTP server |
/system/ntp/server/print | Show NTP server configuration |
Summary
Section titled “Summary”Clock and NTP configuration ensures accurate system time for logging, certificates, and scheduled tasks:
- Set timezone with
/system/clock/set time-zone-name=<zone>or enable auto-detection - Enable NTP client with
/system/ntp/client/set enabled=yes - Add NTP servers with
/system/ntp/client/servers/add address=pool.ntp.org - Verify with
/system/ntp/client/printforstatus: synchronized
Key points:
- Always use NTP for production systems - internal clock is unreliable
- Many MikroTik devices lack RTC battery; time resets to 1970 on power loss
- Set timezone correctly or logs will show wrong local time
- Firewall must allow outbound UDP port 123 for NTP
- Manual time settings are NOT exported in configuration backups
- Use multiple NTP servers for redundancy (pool.ntp.org, time.google.com, time.cloudflare.com)
- v7 integrated SNTP into NTP client; replace
/system/sntp/clientwith/system/ntp/client