Hello,
GL.iNet firmware has introduced Chrony (chronyd) as the system time-synchronization service, including support for NTS (Network Time Security).
Availability depends on the router model and firmware version.
For example, Flint 2 uses sysntpd on v4.8.3 and requires v4.8.4 or later for this guide.
This guide explains how to allow LAN clients to synchronize time with the router and redirect their IPv4 and IPv6 NTP requests to the router’s Chrony service.
Before continuing, check whether your firmware includes Chrony:
ls /etc/init.d/chronyd
And please back up your current router configuration: How to Export/Import Backup Configuration Files via LuCI
If your firmware uses sysntpd, refer to the previous NTP guide.
Tutorial:
-
Check whether the router system time is correct
date # If the time is incorrect, you can trigger it manually: /etc/init.d/chronyd restart -
Edit the Chrony configuration to enable the time server, please modify [Router LAN IP] according to your LAN IP
# Allow clients on the LAN interface to access the router’s NTP service. On supported firmware, the configuration below generates access rules for the interface’s IPv4 and IPv6 subnets: uci set chrony.allow_lan='lan_ntp' uci set chrony.allow_lan.interface='lan' uci commit chrony #This applies to the main LAN only. Guest networks and additional VLANs require their own access configuration. -
Restart Chrony to apply the above new configuration
/etc/init.d/chronyd restart -
Check the port 123 status
netstat -uln | grep 123 #If you intend to serve IPv6 clients, also verify that Chrony is listening on IPv6 UDP port 123, usually displayed as :::123.
-
Configure the firewall to redirect time requests from LAN clients to the router's time server.
There are two kinds of firewall implementations: some useiptables, some usenft(fw4).# Check which firewall implementation your firmware uses command -v fw4 command -v fw3Check whether fw4 or fw3 is printing any return output based on the content. If only fw3 printed, that uses
iptables; if both fw4 and fw3 printed, that usesnftables.- For fw3 / iptables:
cat >> /etc/firewall.user <<'EOF' # Redirect LAN clients' IPv4 NTP requests to this router iptables -t nat -A PREROUTING -i br-lan -p udp --dport 123 -j REDIRECT --to-ports 123 # Redirect LAN clients' IPv6 NTP requests to this router ip6tables -t nat -A PREROUTING -i br-lan -p udp --dport 123 -j REDIRECT --to-ports 123 EOF /etc/init.d/firewall restartWhen restarting the firewall you may see print such as "invalid"; as long as they don't mention "error," that's normal.
Check if the rule is written to the firewall:
iptables -t nat -L PREROUTING -n -v --line-numbers ip6tables -t nat -L PREROUTING -n -v --line-numbersDo not repeatedly append or manually execute these rules. Repeated execution without clearing the existing rules can create duplicates.
- For fw4 / ntfables
uci set firewall.redirect_lan_ntp='redirect' uci set firewall.redirect_lan_ntp.name='Redirect-LAN-NTP' uci set firewall.redirect_lan_ntp.src='lan' uci set firewall.redirect_lan_ntp.family='any' uci set firewall.redirect_lan_ntp.proto='udp' uci set firewall.redirect_lan_ntp.src_dport='123' uci set firewall.redirect_lan_ntp.dest_port='123' uci set firewall.redirect_lan_ntp.target='DNAT' uci set firewall.redirect_lan_ntp.reflection='0' uci commit firewall /etc/init.d/firewall restartWhen restarting the firewall you may see print such as "invalid"; as long as they don't mention "error," that's normal.
Check if the rule is written to the firewall:
nft list chain inet fw4 dstnat_lan -
Verify the redirection
Run these tests from a computer connected to the router’s LAN or main Wi-Fi. Disconnect any client-side VPN first.# IPv4 w32tm /stripchart /computer:192.0.2.123 /dataonly /samples:3 # IPv6 w32tm /stripchart /computer:2001:db8::123 /dataonly /samples:3- Optional: Capture packets using the
tcpdumpto verify that the LAN client's time requests are being redirected by the router to own host, where time synchronization is provided by Chrony.
#opkg manager: opkg update && opkg install tcpdump tcpdump -i any port 123 -n #apk manager: apk update && apk add tcpdump tcpdump -i any port 123 -n(The router LAN subnet in this example is 192.168.8.0/24, test PC IP is 192.168.8.239)
Windows time Sync service:
- Optional: Capture packets using the
-
Remove the NTP redirection
- For fw3:
Remove the two NTP redirect lines added to
/etc/firewall.user, then restart the firewall:/etc/init.d/firewall restart- For fw4
Delete the redirect and reload the firewall:
uci -q delete firewall.redirect_lan_ntp uci commit firewall /etc/init.d/firewall reload- Optional: Disable LAN access to Chrony
If you also want to stop using the router as a LAN NTP server, remove the access section added by this guide:
uci -q delete chrony.allow_lan uci commit chrony /etc/init.d/chronyd restartDo not uninstall Chrony: it remains the router’s normal time-synchronization service.
-end
Addition: Configure custom NTP servers
Chrony’s persistent configuration is stored in /etc/config/chrony.
Keep the first Cloudflare pool entry disabled:
Some firmware versions have a kmwan time-sync handler that checks the first Chrony pool entry before time synchronization is marked as valid.
If its hostname is not time.cloudflare.com, the handler may restore the default time sources.
As a temporary workaround:
- Keep the original first pool entry with
hostname='time.cloudflare.com'. - Disable that entry using
disabled='1'. - Configure your preferred time sources separately.
See our staff explanation and workaround for background.
The following commands assume that the original default pool entry is still present. Replace the three example hostnames with your actual NTP servers before running them:
# Preserve the original first pool, but disable it
uci set chrony.@pool[0].hostname='time.cloudflare.com'
uci set chrony.@pool[0].disabled='1'
# Remove the other default time sources
uci -q delete chrony.time_nl
uci -q delete chrony.netnod
uci -q delete chrony.ptb
uci -q delete chrony.dfm
uci -q delete chrony.cifelli
# Custom NTP server 1
uci set chrony.custom_ntp_1='server'
uci set chrony.custom_ntp_1.hostname='ntp1.example.net'
uci set chrony.custom_ntp_1.iburst='yes'
uci set chrony.custom_ntp_1.nts='yes'
# Custom NTP server 2
uci set chrony.custom_ntp_2='server'
uci set chrony.custom_ntp_2.hostname='ntp2.example.net'
uci set chrony.custom_ntp_2.iburst='yes'
uci set chrony.custom_ntp_2.nts='yes'
# Custom NTP server 3 (time.nl) as a sample
uci set chrony.time_nl='server'
uci set chrony.time_nl.hostname='ntppool1.time.nl'
uci set chrony.time_nl.iburst='yes'
uci set chrony.time_nl.nts='yes'
uci commit chrony
/etc/init.d/chronyd restart
To use NTS, choose endpoints that explicitly support it and set nts='yes' for those endpoints.
Do not enable NTS for ordinary NTP servers or pool.ntp.org pools.
Verify the custom configuration:
chronyc sources -v
Once synchronized, one of the intended sources should be marked ^*.
-end







