Timezone Options for DHCP: RFC 4833

Here is a quick guide to configuring an OpenWrt DHCP server to send Timezone Options for DHCP as defined by the RFC 4833 standard.

There is facility within DHCP to publish timezone (TZ) information to DHCP clients. This information includes:

  • Network Time Server (NTP) server IP address, eg 10.0.0.1
    • OpenWrt does not enable the NTP server by default. See more notes below.
  • Timezone database name, eg “Australia/Sydney”
  • Timezone definition (POSIX 1003.1 timezone strings), eg "AEST-10AEDT,M10.1.0/02:00,M4.1.0/03:00"

Timezone names and definitions have specific format:

I recommend searching online for a definition that matches your timezone.

The steps below can be applied to any interface that has an enabled DHCP server. This configuration guide only shows the LAN interface as the most common example.

Step 1: Configure the NTP server DHCP option on the LAN interface

Step 2: Set the DHCP options for Timezone name and detail. On the command line, as root, configure via UCI:

uci add_list dhcp.lan.dhcp_option_force='100,"AEST-10AEDT,M10.1.0/02:00,M4.1.0/03:00"'
uci add_list dhcp.lan.dhcp_option_force='101,"Australia/Sydney"'

DHCP clients often do not request the timezone options so these options need to be forced into the DHCP server reply.

NTP Server

OpenWrt does not enable the NTP server by default. Having an NTP server on your network is important for keeping the time of your devices in sync. OpenWRT comes with a built-in NTP server that can be enabled from the System menu, Time Synchronization tab.

References:

  1. https://www.rfc-editor.org/rfc/rfc4833.html
  2. https://di-mgt.com.au/wclock/help/wclo_tzexplain.html
  3. https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  4. Original solution provided by: https://serverfault.com/questions/1163979/how-do-i-set-timezone-in-dhcp-per-rfc-4833-in-openwrt
6 Likes

Thanks for the guide, very informative.

I think OpenWrt does not enable the NTP server by default, however. Perhaps it should be added a note about enabling it, too.

4 Likes

Just that it is to set up timezone on diskless workstations of past century.

Question is... how many clients support this way of TZ configuration. Systemd? Nope. Windows? Nope.
Another question is how reliable your router (most likely comes without RTC) in storing precise time?

3 Likes

... what about IPv6 NTP options? Is this TZ information compatible with servers supplied via rfc5908?

2 Likes

Very good questions, thanks.

If/when they are able, the info is there :slight_smile:

I do not have any high precision time requirements. I'm happy just so long as I can look at any device and get the same time. My router (NanoPi R2S) is stable enough to provide that to my local devices.
It might not surprise you to know that I am not using the default NTP server but have installed luci-app-chrony and dependancy packages for a more configurable service. With two stratum 1 servers and a pool, I believe I have good times :slight_smile:

I've been IPv4 networking since 1995. If I'm very lucky, I can keep ignoring IPv6 for another 25years :anguished_face:

1 Like

My first PC was Intel 386SX with 4MB of RAM and yet I like to know what DHCPv6 option can be used to share TZ information. There is none to my knowledge... but I'm might be wrong.

DHCPv6 Options No. 41 and 42. See: https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml

3 Likes

Don't be shy. Stratum 1 server doesn't get into your configuration by itself.

2 Likes

So option 42 in DHCPv4 is used to share NTP servers and in DHCPv6 it is for TZ information! Genius!

BTW, where do I specify DHCPv6 option 42?

Canonically defined in RFC 4833, section 3. See: https://www.rfc-editor.org/rfc/rfc4833.html#section-3

(The IANA chart listed the RFC, BTW.)

Good question. Given this is the first person I've ever noticed give concern to DHCP Options for time zone, it's not too common. Although, Option 56 is available.

3 Likes

So now we have at least: DHCPv4 options 100, 101 and DHCPv6 options 41, 42, plus 802.11v with optional TZ information... - that's messy.

1 Like

I'm a bit OCD with time - all my devices should have the same time, and I should be able to trust that time. So all the upstream servers are from reliable national institutes and the pool is local to my country (au.pool.ntp.org). I'm having a good Aussie time :laughing:

1 Like

Also, it gets messier. Most OSs that can use TZ via DHCP, use/used DHCPv4 Option No. 2 (Time Offset). I'm still not clear on what OSes obtain thier time zone via DHCP in 2025.

GPS was the easiest way to get precise time but I'm in Russia and GPS can randomly throw people to Belgium, Ukraine or somewhere else, so NTP from local timekeeping institution is the only cheap option to get Stratum 1.

1 Like

GPS was originally a military technology.

Prayerfully, it remains only the imaginary cursor that's thrown anywhere. Stay safe. :folded_hands:

1 Like

man dnsmasq says: --dhcp-option=option6:ntp-server,[1234::56], so technically it is possible to specify it directly via options. Maybe even via existing UI...

P.S. Since we already have NTPv6 option in UI, it would be logical to add TZ selector, don't you think? Yeah, and the same for NTPv4...

1 Like

I though DHCPv6 was via odhcpd?

I saw only Option 56 in the web GUI.

Not really, TBH:

And further:

The GUI already exposes the ability to add DHCPv4 Options.

But, I guess it doesn't hurt. :man_shrugging:

In my spare long-time hobby of reviewing DHCP handshakes :nerd_face: , I've only seen a request for DHCPv4 Option No. 2 - Time Offset, never for TZ.

I believe this is still a "Proposed" Standard.

1 Like

https://openwrt.org/docs/techref/odhcpd says enable_tz option is already there... and it is enabled.

2 Likes