Skip to contentSkip to conversation

Need for HW-clock independent timestamps

DISCUSSION reiner otto 2 participants 2 messages May 13, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Having implemented this solution already, I consider it some type of hack, = as the standard time sync unfortunately happens very late in the start of t= he services, after rc.local called. And the sync might take quite some tim= e.

Which means, I had to "hack" the time sync immediately after WAN up, and t=
o be done in a single shot, before starting WG.

It might be a reasonable workaround, as a standard new option in openwrt, t=
o allow immediate time sync after WAN up, instead of the graceful sync much= later.

However, as a real RTC is rather cheap, it might be a good idea, in case of=
commercial apps, to ask the supplier of the device to be used for the inc=
lusion of a RTC.
The more requests, the better the chances to find more devices with RTC inc= luded.

--------------------------------------------
Toke H=C3=B8iland-J=C3=B8rgensen <[email protected]> schrieb am So, 13.5.2018:

=20
=20
The analogue for a wireguard deployment would
be to run NTP on the
unsecured links and not
configure the wireguard tunnels until NTP has
synced. This has different security
implications for a VPN than for
dnssec, of
course, but it could be doable.=20
=20

#2 lore raw
Quoted 7 lines · reiner otto

Having implemented this solution already, I consider it some type of hack, as the standard time sync unfortunately happens very late in the start of the services, after rc.local called. And the sync might take quite some time.

Which means, I had to "hack" the time sync immediately after WAN up, and to be done in a single shot, before starting WG.

Yeah, messing init script order is going to be hackish. You'd want to add a hotplug script to react to when the NTP daemon syncs and apply config after that. See the dnsmasq hotplug script for an example:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/network/services/dnsmasq/files/dnsmasqsec.hotplug;h=781d5337348bb8e927bd15f1caac94a5e7a9ba63;hb=HEAD

For WG it should be necessary to wait to configure the wg interfaces; they just won't validate correctly until time is fixed. So you could configure the interfaces in /etc/config/network and just have the hotplug script add the default route (or whatever your needs are).

Quoted 4 lines

However, as a real RTC is rather cheap, it might be a good idea, in case of commercial apps, to ask the supplier of the device to be used for the inclusion of a RTC. The more requests, the better the chances to find more devices with RTC included.

Sure, for people who are building their own hardware. Most people aren't, though...

-Toke