MikroTik NTP Server and Client Configuration
Table of Contents
Prerequisites
- A MikroTik router with the latest stable version of RouterOS installed.
- Basic familiarity with MikroTik’s WinBox or CLI interface.
- Access to a reliable upstream NTP server (if setting up a client).
MikroTik NTP Server Configuration
Follow these steps to configure your MikroTik router as an NTP server:
Step 1: Enable the NTP Server Package
First, ensure the NTP server package is installed and enabled. For RouterOS 7.x, the NTP server feature is built into the system:
/system/ntp/server/set enabled=yes
Step 2: Configure NTP Server Options
You can optionally define which interfaces should accept NTP requests and specify access restrictions. Example:
/system/ntp/server/set enabled=yes
/system/ntp/server/set multicast=yes
/system/ntp/server/set broadcast-addresses=192.168.88.255
Replace 192.168.88.255
with the broadcast address of your network.
MikroTik NTP Client Configuration
To configure your MikroTik device as an NTP client, follow these steps:
Step 1: Set Up the NTP Client
Use the following command to enable the NTP client and specify upstream servers:
/system/ntp/client/set enabled=yes
/system/ntp/client/servers/add address=pool.ntp.org
/system/ntp/client/servers/add address=0.europe.pool.ntp.org
Replace pool.ntp.org
with the address of a reliable NTP server if needed.
Step 2: Configure Time Zone
Set your local time zone using the following command:
/system/clock/set time-zone-name=Europe/London
Replace Europe/London
with your appropriate time zone.
Verification and Troubleshooting
Check the Current Time
Run the following command to ensure the time is synchronized correctly:
/system/clock/print
Check NTP Status
To verify the NTP client status:
/system/ntp/client/print
Common Issues
- Incorrect Time: Ensure the upstream NTP server is reachable.
- Firewall Rules: Verify that UDP port 123 is not blocked by any firewall rule.
Conclusion
By configuring your MikroTik router as an NTP server or client, you ensure accurate time synchronization across your network. This improves logging accuracy, network reliability, and device coordination. Feel free to experiment and adapt these configurations to your specific network needs.