Posted: Tue Feb 23, 2016 8:57 Post subject: Add NTP server to DD-WRT or not?
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
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:
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.
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
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.
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
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
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.
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
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
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
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.