Eu tenho um servidor: 192.168.0.40 e 4 clientes: 192.168.0.61-192.168.0.64. Os clientes são Raspberry Pis e, portanto, não têm relógio em tempo real. Portanto, o tempo está sempre errado.
Eu segui as instruções aqui para criar arquivos ntp.conf:
servidor:
restrict default nomodify notrap noquery
restrict 127.0.0.1
# -- CLIENT NETWORK -------
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
# --- OUR TIMESERVERS -----
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 127.127.1.0
# --- NTP MULTICASTCLIENT ---
# --- GENERAL CONFIGURATION ---
# Undisciplined Local Clock.
fudge 127.127.1.0 stratum 9
# Drift file.
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
# Keys file.
keys /etc/ntp/keys
cliente:
restrict default nomodify notrap noquery
restrict 127.0.0.1
# -- CLIENT NETWORK -------
# --- OUR TIMESERVERS -----
# 192.168.1.2 is the address for my timeserver,
# use the address of your own, instead:
server 192.168.0.40 iburst
server 127.127.1.0
# --- NTP MULTICASTCLIENT ---
# --- GENERAL CONFIGURATION ---
# Undisciplined Local Clock.
fudge 127.127.1.0 stratum 12
# Drift file.
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
# Keys file.
keys /etc/ntp/keys
No entanto, o tempo nos clientes ainda está errado (inalterado de antes). Quando tento conectar especificamente ao servidor, o cliente não consegue encontrá-lo. Eles são 100% na mesma sub-rede e os endereços IP estão corretos, pois eu não posso ter problemas.
O resultado do ntpq -c lpeer é:
localhost: timed out, nothing received
***Request timed out
Editar:
sudo ntpdate -u 192.168.0.40:
12 Dec 07:45:09 ntpdate[12815]: no server suitable for synchronization found
Editar 2:
Os clientes estão em uma sub-rede na ethernet e o servidor está conectado em wi-fi. O sistema funciona quando o wifi está desativado. Existe uma maneira de contornar isso?