-
-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time Server Issue in China #7010
Comments
The Great Firewall looks so arbitrary, contradicting and often nonsensical to me 😄. As the China NTP pool obviously is blocked as well, for whatever reason, you (your customer) need to find and use an NTP server which does work. This can be also the LAN router (or the ISP NTP server directly), which often uses the ISP NTP server, which is then probably the only non-blocked NTP server. EDIT: It might be also just overloaded: https://community.ntppool.org/t/cn-pool-collapse-a-few-hours-every-day/3225 |
Ever tested with Alibaba Cloud NTP server? |
Sounds like something which should work, but I have no experience with NTP servers in China. When I was there, I just kept using what the OS offered. |
Of course you can set the router/gateway as NTP server within DietPi. We offer this option already. At least as long as the router supports NTP server function. |
Cool 👍 |
My goal is to ask the router first and if this did not work ask the debian NTP servers. Hope this will work in Mainland China too as the debian NTP servers and also the Pool only delibver timeout. |
The first one in
or G_CONFIG_INJECT 'CONFIG_NTP_MIRROR=' 'CONFIG_NTP_MIRROR=gateway' /boot/dietpi.txt
/boot/dietpi/func/dietpi-set_software ntpd-mode But not every router supports this. The Debian NTP pool servers are used by default as fallback, but the fallback is only effective when other NTP servers are applied per-interface via systemd-networkd only, not when defining any NTP server via |
I replaced the line in the dietpi.txt. Please take a look at my protocols.
|
I wonder that I can't see any attempt getting the time from the router... |
Note that editing Actually, choosing "Default", respectively leaving the NTP settings completely untouched (removing the
If no DHCP is used, I see no way to have a fallback functionality, but it must be tested manually. |
Great, thank you 👍
|
Then the router does not provide any NTP server via DHCP. It would be listed in: cat /var/lib/dhcp/dhclient.*.leases |
But I use DHCP to get the IP for my Raspberry... |
The |
You could explicitly set router IP as NTP target. This would work around any DHCP features |
Indeed, but then the fallback feature does not work anymore, i.e. it is not a good default when providing images for customers 🤔. |
This is empty. But the installation gets IP by DHCP. Maybe I use a different client? Can't remember. But as far as I understood after deleting My Rouder did not provide NTP so I expected to see a timeout before debian got asked. If I enter a fixed IP of the Router I get a timeout and no debian request. |
Without the file, the NTP provided by the router via DHCP is used, if present in the lease, else the Debian NTP pool is used. There is no fallback after timeout, it is always only 1 single server or pool tried. But this only works if either E.g. ps aux | grep '[d]hcp' ... actually, not a fallback, but another way would be to add a pool + the router IP to the same |
Ok, |
You could do this via dietpi.txt, but you must know the router IP first: CONFIG_NTP_MIRROR=192.168.1.1 debian.pool.ntp.org If this turns out to work nicely, and does not call all 4 pool servers on every sync, despite the router answering first/fast, I'll add some native setting for this, so that you can use: CONFIG_NTP_MIRROR=gateway debian.pool.ntp.org Uff, I see this section's comments are pretty outdated, talking about |
Creating a bug report/issue
Required Information
DietPi version |
cat /boot/dietpi/.version
-G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=10
G_DIETPI_VERSION_RC=2
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
Distro version |
echo $G_DISTRO_NAME $G_RASPBIAN
bullseye 0
Kernel version |
uname -a
Linux rooExtend 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux
SBC model |
echo $G_HW_MODEL_NAME
or (EG: RPi3)RPi 4 Model B (aarch64)
Power supply used | (EG: 5V 1A RAVpower)
5V 1A
SD card used | (EG: SanDisk ultra)
Sandisk Ultra
Additional Information (if applicable)
Fresh
Yes
echo $G_HW_UUID
Steps to reproduce
One of my customers live in China and the time in his system was wrong as the debian time servers can not be accessed.
I added Chinese time servers in /etc/systemd/timesyncd.conf.
In the attached dialog you can see that this did not help.
Any idea would be appreciated :-)
Expected behaviour
Actual behaviour
Extra details
The text was updated successfully, but these errors were encountered: