After i had installed my new Unifi Dream Router i discovered after a while that the time of some of the devices in my network was screwed up. After a bit of research i found that the UDR (in contrast to my previous Unifi Gateway) doesn’t feature NTP. Hence i had a pretty timeless setup.

Setup of podman

The NTP server is setup in a container , hence it is important to first setup podman on the UDR.

Setup of the NTP Container

To automatically start the container, the respective file has to be created. This is done through the following command:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
cat > /data/on_boot.d/20-ntp.sh <<EOF
#!/bin/sh
CONTAINER=ntp
if podman container exists ${CONTAINER}; then
  podman start ${CONTAINER}
else
  podman run --device=/dev/net/tun --publish=123:123/udp --cap-add=SYS_TIME --name ${CONTAINER} -d tusc/chrony-udm
fi
EOF
chmod a+x /data/on_boot.d/20-ntp.sh

Now pull the container:

1
podman pull tusc/chrony-udm

And start the container:

1
/data/on_boot.d/20-ntp.sh

Sources