Add NTP server to DD-WRT or not?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page 1, 2, 3, 4  Next

Do you want your router to serve NTP?
Yes, I really WANT this feature.
55%
 55%  [ 16 ]
Well, now you mention it. Yes!
13%
 13%  [ 4 ]
No, public NTP is fine with me.
31%
 31%  [ 9 ]
Uhh... It's already there ;-)
0%
 0%  [ 0 ]
Total Votes : 29

Author Message
Acumen
DD-WRT User


Joined: 15 Nov 2014
Posts: 221

PostPosted: Tue Feb 23, 2016 8:57    Post subject: Add NTP server to DD-WRT or not? Reply with quote
I am wondering if there are more DD-WRT enthusiasts who would like to see the router serve as a NTP server.
My personal reason is that I have several devices that do not need to access the anything outside my LAN, except for time-syncing.
Right now I fixed this with an IP tables rule, but I prefer to just reject all 'forwarded' traffic.

How about you?

_________________
Netgear WNDR4300v1 DD-WRT v3.0 BS r29837 | Netgear R6400 DD-WRT v3.0 KB r33525M | Tickets: 5429
IPv4 & IPv6-PD | ProFTP & Samba to USB thumb | DNSMasq DHCPv6 | Pi-Hole on RasPi

Found a bug, report it so the it can be fixed: http://svn.dd-wrt.com/
Sponsor
Doppel-D
DD-WRT User


Joined: 13 Jul 2014
Posts: 215
Location: Germany

PostPosted: Thu Mar 03, 2016 11:07    Post subject: Reply with quote
I agree 100% ;-)
hurleyp
DD-WRT User


Joined: 10 Sep 2009
Posts: 425
Location: Ottawa, Ontario, Canada

PostPosted: Thu Mar 03, 2016 13:47    Post subject: Reply with quote
I'd like to have the router be my local NTP server, as long as it's a compact, low impact addition.

Good idea. Smile

_________________
Netgear R7000: v3.0-r54248 std (11/29/23)
EdgeRouter-X: EdgeOS v2.0.9-hotfix 7
cmsigler
DD-WRT User


Joined: 01 Sep 2015
Posts: 108

PostPosted: Thu Mar 03, 2016 16:03    Post subject: Reply with quote
UPDATE: I may be more noise than signal here Sad Please see this:

https://www.dd-wrt.com/wiki/index.php/OpenNTPD

No info for configuring OpenNTPD as a time server but I'm assuming standard configuration will work.

In addition, ntpd is installed as /sbin/ntpd. Does this work as expected? It's a symlink to /sbin/rc, so....

Original post -->

In case this isn't supported by dd-wrt long-term -- and I understand there's a major problem of firmware image size versus package bloat in dd-wrt beta releases -- one might consider installing OpenWRT's ntpd package via ipkg:

https://www.dd-wrt.com/wiki/index.php/Using_ipkg_to_install_OpenWRT_packages

https://www.dd-wrt.com/wiki/index.php/Ipkg_%28tutorial%29

FYI, it appears that Optware for Broadcom routers is no longer being actively developed:

https://www.dd-wrt.com/wiki/index.php/OTRW2_%28Optware_the_right_way_Take_2%29

HTH.

Clemmitt
dasPaul
DD-WRT Novice


Joined: 28 Nov 2012
Posts: 17
Location: Dresden, Germany

PostPosted: Sat Mar 05, 2016 18:37    Post subject: Reply with quote
I also want to have my DD-WRT router serving my Raspberry Pi's with ntp. I would try
http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/
but those packages are very outdated and vulnerable.
alfred
DD-WRT Novice


Joined: 15 Feb 2012
Posts: 5

PostPosted: Tue Mar 08, 2016 14:51    Post subject: Reply with quote
I strongly vote for this. I tried without success to install a NTP server on my DD-WRT router. I probably lack of knowledge on Linux and DD-WRT programing.

I am now using a Raspberry PI as my LAN NTP server and it is working fine but I think it as to be done by the router.

I know that routers do not have a real time clock, but most of us do not need extremely high accuracy, just be able to set the time to a few seconds is enough.

On the Raspberry PI, one can install a real time clock, but by default it use a fake real time clock. The actual time is regularly saved on a file and reloaded after a reboot. This way, NTP is able to acquire the precise time faster.

Thanks
bobs
DD-WRT User


Joined: 24 Jan 2016
Posts: 98

PostPosted: Sat Mar 12, 2016 22:45    Post subject: Reply with quote
Nope.

For these kind of services, get a SoC, Raspberry Pi or something and run them on there.

Possible uses for RPi

OpenVPN on small flash routers
NTP server
RADIUS for fine grained AAA services

etc, etc

None of this needs to be on the router, in fact, should it even be on the router? I don't believe it should since the router should be doing routing and not these other non-routing related services.

Router for routing, SoC/appliance for services.

SoC boards are cheap as pie Smile

The more services you put onto a router, the less processing power is available for routing tasks.

You really want to spread the loading of tasks. Having one magic box to rule them all, is just a big box of failure waiting to happen, once that goes down, everything goes down. You want reliability and availability.
bdg2
DD-WRT User


Joined: 18 Apr 2013
Posts: 319

PostPosted: Tue Mar 15, 2016 13:49    Post subject: Reply with quote
bobs wrote:
Nope.

For these kind of services, get a SoC, Raspberry Pi or something and run them on there....

Some people prefer one box rather than a cobbled together fragile collection of SoC boards patch cables and USB power supplies.
bdg2
DD-WRT User


Joined: 18 Apr 2013
Posts: 319

PostPosted: Tue Mar 15, 2016 13:52    Post subject: Reply with quote
If a NTP server were implemented in dd-wrt it would also need to be fully configurable to, for instance, sync to multiple NTP servers for reliability.
Acumen
DD-WRT User


Joined: 15 Nov 2014
Posts: 221

PostPosted: Fri Mar 18, 2016 8:27    Post subject: Reply with quote
bdg2 wrote:
bobs wrote:
Nope.

For these kind of services, get a SoC, Raspberry Pi or something and run them on there....

Some people prefer one box rather than a cobbled together fragile collection of SoC boards patch cables and USB power supplies.

My idea. And yes, it is because it can. There are multiple solutions/fulfillment to any problem/wish, but personally I like to see the router as a center of my network. It sounds like a a nice feature to me, but the poll is to check if more people think of it that way. And so far there are.
bdg2 wrote:
If a NTP server were implemented in dd-wrt it would also need to be fully configurable to, for instance, sync to multiple NTP servers for reliability.

Since the router only syncs time after its boot, I have a small (cron) script that does this more frequent. You could make a script that first pings the NTP server and if the result is OK, uses it for a time-sync.

_________________
Netgear WNDR4300v1 DD-WRT v3.0 BS r29837 | Netgear R6400 DD-WRT v3.0 KB r33525M | Tickets: 5429
IPv4 & IPv6-PD | ProFTP & Samba to USB thumb | DNSMasq DHCPv6 | Pi-Hole on RasPi

Found a bug, report it so the it can be fixed: http://svn.dd-wrt.com/
bobs
DD-WRT User


Joined: 24 Jan 2016
Posts: 98

PostPosted: Sun Mar 20, 2016 19:41    Post subject: Reply with quote
bdg2 wrote:
bobs wrote:
Nope.

For these kind of services, get a SoC, Raspberry Pi or something and run them on there....

Some people prefer one box rather than a cobbled together fragile collection of SoC boards patch cables and USB power supplies.


Not all routers have enough flash memory space.

You can always put them into a box to keep them together Smile

SoC boards are not "fragile" as you would imply, they are quite robust and solid. You can also run OpenVPN and other services that cannot fit onto many routers (due to flash memory constraints).

The advantage of separate boxes, if that "big box" that does "everything" fails, everything fails.

You can power it off another USB device, not just a power supply, for example, you could power it from the router/nas/etc USB ports.
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 371

PostPosted: Sat Jan 21, 2017 17:05    Post subject: Reply with quote
In case anyone else likes the idea of dd-wrt acting as a local ntp server it can be done this way as long as you have the UTC time bug fix.

1) Install Entware-ng
2) Set Administration->Commands->Save Startup : "/opt/etc/init.d/rc.unslung start"
3) Set Administration->Commands->Save Shutdown : "/opt/etc/init.d/rc.unslung stop"
4) Install ntpd with: "opkg install ntpd"
5) Tell all your LAN devices to use your dd-wrt time server

Useful troubleshooting:
Install ntpq with: "opkg install ntp-utils"
ntpq -c peers

Prepopulated default config file:
/opt/etc/ntp.conf

In my case my internet connection is so bad (most likely doesn't apply to you) that ntpd often fails to get internet time so I tell the ntp server to prefer the local clock by appending this to ntp.conf (the fudge stratum part pretends that the local clock is of better quality than it really is so clients still accept my server's time):
server 127.127.1.0 prefer # local clock
fudge 127.127.1.0 stratum 10

To update the local clock every eight hours because my internet connection is so bad (most likely doesn't apply to you) using ntpdate Administration->Management->Cron:
0 */8 * * * root /opt/bin/updateclock.sh

Install ntpdate "opkg install ntpdate"

Content of updateclock.sh

#!/bin/sh
OUTFILE=/tmp/var/tmp/updateclock.log
/bin/date >> $OUTFILE
/opt/etc/init.d/S77ntpdate start >> $OUTFILE
/bin/echo '------------' >> $OUTFILE[url][/url]

Finally the file /opt/etc/init.d/S77ntpd was modified to only start serving time after dd-wrt has initialized the local clock to a valid time. The added lines are:

BADYEARLIMIT=2016
while [ $(date +%Y) -le $BADYEARLIMIT ]
do
sleep 15
done


Last edited by yoyoma2 on Mon Mar 06, 2017 14:12; edited 1 time in total
Bazilefs
DD-WRT Novice


Joined: 14 Feb 2017
Posts: 1

PostPosted: Thu Feb 16, 2017 2:03    Post subject: Reply with quote
Sorry for my English. I can not vote in the poll. But I would have voted YES.
johnnyNobody999
DD-WRT User


Joined: 10 Jan 2014
Posts: 499

PostPosted: Mon Aug 07, 2017 19:27    Post subject: Reply with quote
I don't have ipkg or opkg on any of my routers. So, how does one install additional packages without them? I looked at Entware-ng but there's got to be a simpler/easier/better way to install packages instead of wading through all that Entware configuration.
veekay
DD-WRT User


Joined: 09 Mar 2009
Posts: 77

PostPosted: Sat Jan 15, 2022 19:56    Post subject: Reply with quote
Hate to necro such an old thread, but this is still the top and basically only post on running an NTP server.

Does this method still work on modern builds?
Goto page 1, 2, 3, 4  Next Display posts from previous:    Page 1 of 4
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum