Skip to content
spamcop edited this page Oct 22, 2025 · 6 revisions

Setting Timezone via DHCP

Introduction

Dynamic Host Configuration Protocol (DHCP) can deliver timezone information to clients, improving time synchronization without manual setup. This uses vendor-specific options defined in RFC 4833.

DHCP Options

  • Option 100 (PCode): POSIX timezone string (e.g., "EST5EDT").
  • Option 101 (TCode): IANA TZ database name (e.g., "America/New_York").

Clients request these via Parameter-Request List (option 55). Servers include them in DHCP Offers and ACKs if requested.

Server Configuration

Configure on DHCP servers like MikroTik, pfSense, or OpenWRT:

  • Define options (e.g., code 100 value "EST5EDT", code 101 value "America/New_York").
  • Assign to network/subnet.
  • Example (MikroTik):
    /ip dhcp-server option add code=100 name=pcode value="'EST5EDT'"
    /ip dhcp-server option add code=101 name=tcode value="'America/New_York'"
    /ip dhcp-server network set 0 dhcp-option="pcode,tcode"
    
  • Example (Openwrt - /etc/config/dhcp):
    config dhcp 'lan'
      option interface 'lan'
      option start '100'
      option limit '150'
      option leasetime '12h'
      option dhcpv4 'server'
      list dhcp_option '42,192.168.10.1'
      list dhcp_option '101,"Europe/Berlin"'
    

Renew client leases to apply.

Client Support

Embedded Linux (udhcpc) requests with -O 100 -O 101. Thingino uses udhcpc as dhcp client. Windows and Raspberry Pi support via APIs. Verify with tcpdump or Wireshark.

  • Thingino gets ntp server from DHCP Option 42 ($ntpsrv) and sets this server in /etc/ntp.conf
  • Thingino gets timezone from DHCP Option 101 ($tzdbstr) and uses tzselect to setup this timezone
  • Thingino currently doesnt do anything with DHCP Option 100 ($tzstr) from dhcp server

Configuration Examples

Using dnsmasq

# Option 100 - POSIX TZ Code
dhcp-option=100,"NZST-12NZDT,M9.5.0/2,M4.1.0/3"
# Option 101 - TCode
dhcp-option=101,"Pacific/Auckland"

Using Junos Apply groups

set groups default-dhcp-attributes routing-instances <*> access address-assignment pool <*> family inet dhcp-attributes option 100 string NZST-12NZDT,M9.5.0/2,M4.1.0/3
set groups default-dhcp-attributes routing-instances <*> access address-assignment pool <*> family inet dhcp-attributes option 101 string Pacific/Auckland

Using ISC DHCP server

option PCode code 100 = text;
option TCode code 101 = text;
option PCode "NZST-12NZDT,M9.5.0/2,M4.1.0/3";
option TCode "Pacific/Auckland";

Using RouterOS DHCP server

/ip dhcp-server option add code=100 name=pcode value="'EST5EDT'"
/ip dhcp-server option add code=101 name=tcode value="'America/New_York'"
/ip dhcp-server network set 0 dhcp-option="pcode,tcode"
  1. Wiki Home
  2. About the Project
    1. Contributions
    2. Features
    3. Project Philosophy
    4. Releases
  3. Getting Started
    1. FAQ
    2. Hardware Identification
    3. Ingenic USB Cloner
      1. OTG Booting
    4. PPSTRONG
    5. Installation: General
    6. Installation: No Tools Methods
    7. Resources and Links
    8. Support Community
    9. Troubleshooting
    10. UART Connection
    11. Updating Firmware
    12. Unbricking
    13. Web UI
  4. Supported Cameras
    1. Cameras
    2. 360 AP1PA3
    3. AliExpress LTIA‐37FJZ (Vanhua Z55 module)
    4. AOQEE C1
    5. Aosu C5L
    6. Cinnado
      1. Cinnado D1 2K
      2. Cinnado D1 3K
    7. Dekco DC5L
    8. Eufy
      1. Eufy E210 Outdoor Cam
      2. Eufy E220
    9. Galayou/Wansview
      1. Galayou G2
      2. Galayou G7
      3. Wansview W6
      4. Wansview W7/Galayou Y4
    10. Hualai (Wyze/Atom/Neos/Personal)
      1. Dafang Upgrading for Wyze v2
      2. NEOS conversion
      3. Personalcam
      4. Wyze Cam Pan V1
      5. Wyze Doorbell (V1)
        1. Chime Reverse Engineering
      6. Wyze v2/Neos SmartCam/ATOM Cam 1
      7. Wyze v3
      8. Wyze Accessories
    11. iFlytek XFP301‐M
    12. Jienuo JN-107-AR-E-WIFI
    13. Jooan A6M
    14. LaView L2
    15. LongPlus X07
    16. LSC 3215672
    17. Sannce I21AG
    18. Sonoff Cam‐S2
    19. TP-Link Tapo C100/C110/C111
    20. Wuuk Y0510
    21. Xiaomi
      1. Xiaomi Mijia1080p (SXJ02ZM)
      2. Xiaomi MJSXJ03HL
      3. Xiaomi Outdoor Camera AW200 (MJSXJ05HL)
  5. Configuration
    1. Administration
    2. Automation
    3. Cron jobs
    4. General
    5. LED Indicators
    6. Lighting
    7. Media Streaming Endpoints
    8. Network Storage
    9. Networking
      1. Wireless Networking
      2. USB Direct w CDC
      3. USB Ethernet Networking
      4. Remote Access
      5. VPN
        1. Tailscale
        2. Wireguard
        3. Zerotier
      6. Wi-Fi
        1. Self Hosted AP
        2. Tips and Tricks
      7. WWAN (Cellular)
    10. Night Mode
    11. ONVIF
    12. OSD (On-screen Display)
    13. Plugins
      1. Motion Guard
      2. Yandex Disk
    14. SSH Access Keys
    15. Wi-Fi Access
    16. Provisioning
    17. Streamer Bitrate Control
  6. Integration
    1. Home Assistant
    2. Frigate
    3. Ingenic A1/$15 NVR
    4. Mobile Apps
    5. MQTT Integration
    6. Virtual Webcam on Linux
    7. Mainsail (Klipper)
  7. Development
    1. Booting
      1. Boot: MMC SD
      2. Boot: NFS
    2. CH341A Programmer
    3. RTSP Players
    4. Flash Chips
    5. go2rtc
    6. Porting Guide
    7. Ingenic Platform Capability Matrix
    8. Ingenic Image Processor
    9. ISP Reserved Memory (RMEM)
    10. Debugging
    11. Software
      1. Building From Sources
      2. Buildroot
      3. Toolchain
      4. Choice of JSON library
    12. SSL and TLS Web UI in thingino
    13. Tech Info
      1. Hardware
      2. PWM Info
      3. Supported Hardware
      4. T23 GPIOs
      5. T31 GPIOs
    14. U-Boot Cheatsheet
    15. Zeratul/Atlas/Tassadar
    16. Resources

Clone this wiki locally