Skip to content
Contents
GuidesOpenWrt

Does LuCI use UTC or local time for scheduled OpenWrt firewall rules?

Should an 8 pm block in UTC+8 start at noon in LuCI? On OpenWrt 25.12.6 both settings matched the rules marked 20:00 at local 8 pm. Check counters before converting the schedule.

Should an 8 pm block in UTC+8 start at noon in LuCI? On OpenWrt 25.12.6 both settings matched the rules marked 20:00 at local 8 pm. Check counters before converting the schedule.

Match the form to the router clock

Open Network → Firewall → Traffic Rules, edit the rule and select Time Restrictions. Record the name and original settings. Over SSH compare both clocks, match the saved fields by section and inspect the generated hours. Correct clock sync or configuration errors first.

date
date -u
uci show firewall | grep -E 'name=|utc_time=|start_time=|stop_time=|weekdays='
fw4 check
fw4 print | grep 'meta hour'

The screenshot shows Time in UTC selected. The fw4 sources for 24.10.3 and 25.12.6 parse the flag but the traffic rule template uses the supplied hours directly. Only the latter release was tested with packets.

LuCI · Time Restrictions · Time in UTC

Why the same rule shows two times

Match ports and comments in the loaded table. The second command changes the display zone for that invocation only. If a generated rule is missing live, check apply errors and the system log.

nft list table inet fw4 | grep 'meta hour'
TZ=UTC0 nft list table inet fw4 | grep 'meta hour'

In an isolated x86/64 VM set to UTC+8 it was about 20:00 locally and 12:00 UTC. We opened a fresh IPv4 TCP connection from LAN to each router port. In UTC the first two drop rules displayed 12:00–12:10 with unchanged counts. The screenshot precedes the probes.

TCP    utc_time   LuCI          packets
19001      0      20:00–20:10   0 → 1
19002      1      20:00–20:10   0 → 1
19003      0      12:00–12:10   0 → 0
19004      1      12:00–12:10   0 → 0

LuCI · input_lan · TCP 19001–19004

Check your own schedule

Keep management access and leave the clock alone. Temporarily block one spare client from a reachable test port. Use LAN to WAN forwarding for internet access or input for the router itself. Apply a two-minute window starting soon with no weekday filter. Open fresh connections before, during and after it and read counters. Repeat in the next window with the box toggled.

Expect failure and a counter increase only inside the window. For zero hits check address family, direction and earlier rules. A zero UTC offset cannot distinguish the clocks. Test midnight, weekdays and daylight saving separately. Remove the test rule, restore settings, apply and reconnect.

Why does LuCI show UTC after an OpenWrt upgrade when the clock is right?

Explore hardware

Comments