NTPD USAGE
root@OpenWrt-2:/# ntpd
BusyBox v1.19.4 (2013-03-06 20:07:44 UTC) multi-call binary.Usage: ntpd [-dnqNwl] [-S PROG] [-p PEER]…
NTP client/server
-d Verbose
-n Do not daemonize
-q Quit after clock is set
-N Run at high priority
-w Do not set time (only query peers), implies -n
-l Run as server on port 123
-S PROG Run PROG after stepping time, stratum change, and every 11 mins
-p PEER Obtain time from PEER (may be repeated)root@OpenWrt-2:/#
### NTP SERVER CONFIGURATION ###
START NTP SERVICE
root@OpenWrt-2:/# ntpd -l
root@OpenWrt-2:/#
VERIFY NTP SERVICE (UDP/123) IS UP AND RUNNING
root@OpenWrt-2:/# ps | grep ntpd
1422 root 1248 S /usr/sbin/ntpd -n -p 0.openwrt.pool.ntp.org -p 1.ope
7613 root 1240 S ntpd -l
7642 root 1240 S grep ntpdroot@OpenWrt-2:/#
root@OpenWrt-2:/# nmap localhost -sU
Starting Nmap 6.01 ( http://nmap.org ) at 2013-09-06 12:08 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000070s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
53/udp open domain
123/udp open ntpNmap done: 1 IP address (1 host up) scanned in 0.05 seconds
root@OpenWrt-2:/#
### NTP CLIENT CONFIGURATION ###
1. Download ntpdate
opkg update && opkg install ntpdate
TO VERIFY CLIENT/SERVER CONFIGURATION
1. Change date on the client side
root@OpenWrt1:~# date 20:00
Fri Sep 6 20:00:00 UTC 2013
root@OpenWrt1:~#
2. Compare date with the server
root@OpenWrt-2:/# date
Fri Sep 6 12:18:19 UTC 2013
root@OpenWrt-2:/#
3. Run ntpdate to get new time from the server
root@OpenWrt1:~# ntpdate 192.168.10.12
6 Sep 12:18:12 ntpdate[11630]: step time server 192.168.10.12 offset -27726.790601 sec
root@OpenWrt1:~#
4. Verify both date in client & server
root@OpenWrt1:~# date
Fri Sep 6 12:22:04 UTC 2013
root@OpenWrt1:~#root@OpenWrt-2:/# date
Fri Sep 6 12:22:04 UTC 2013
root@OpenWrt-2:/#
PERFECT!!!
REFERENCE
Is it expected that the BusyBox version of ntpd doesn’t respond to ntpq queries on local host or from LAN peers? I ended up installing a separate NTP package via opkg because I wanted my wrt54g to sync with 4 other ntpd servers on my LAN.