Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisione Revisione precedente Prossima revisione | Revisione precedente | ||
|
software:ntp [2017/05/06 11:03] stefano |
software:ntp [2023/04/17 14:25] (versione attuale) |
||
|---|---|---|---|
| Linea 34: | Linea 34: | ||
| Fermare il servizio per effettuare le modifiche\\ | Fermare il servizio per effettuare le modifiche\\ | ||
| - | Una volta completata l' | + | |
| - | Noi però, dopo aver apportato modifiche al file di configurazione, | + | |
| - | < | + | |
| - | # service ntp stop | + | |
| - | Stopping NTP server: ntpd. | + | |
| - | # ntpdate | + | sincronizzare con il comando: |
| - | 9 Nov 19:15:46 ntpdate[3204]: | + | ntpdate |
| - | # service ntp start | + | Riavviare il servizio: |
| - | Starting NTP server: ntpd. | + | |
| - | </ | + | |
| - | Per accertarci | + | Verificare |
| - | < | + | ntpq -pn |
| - | # ntpq -pn | + | |
| - | | + | |
| - | ============================================================================== | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | +88.149.158.46 | + | |
| - | +194.116.87.4 | + | |
| - | -93.62.188.182 | + | |
| - | *212.45.144.88 | + | |
| - | </ | + | |
| - | Gli IP dei server NTP contattati e i dati relativi a ritardo/ | + | Gli IP dei server NTP contattati e i dati relativi a ritardo/ |
| - | == Impostazioni Client == | + | Per i client della nostra lan\\ |
| - | Anche nel client si dovranno installare | + | |
| - | === Configurazione di ntp === | + | installare come prima i pacchetti:\\ |
| - | Il file / | + | |
| - | < | + | |
| - | # /etc/ntp.conf, file di configurazione for ntpd | + | |
| - | # File nel quale scrivere la frequenza | + | e modificare il file di configurazione |
| - | driftfile | + | server 192.168.1.xxx |
| - | # Statistiche | + | fermare di nuovo il servizio\\ |
| - | statsdir / | + | |
| - | statistics loopstats peerstats clockstats | + | |
| - | filegen loopstats file loopstats type day enable | + | |
| - | filegen peerstats file peerstats type day enable | + | |
| - | filegen clockstats file clockstats type day enable | + | |
| - | # Questo è l' | + | sincronizzare |
| - | # NTP server | + | |
| - | server | + | |
| - | # pool.ntp.org è un cluster di timeserver che forniscono un servizio | + | riavviare il servizio\\ |
| - | server 0.debian.pool.ntp.org iburst | + | |
| - | server 1.debian.pool.ntp.org iburst | + | |
| - | server 2.debian.pool.ntp.org iburst | + | |
| - | server 3.debian.pool.ntp.org iburst | + | |
| - | # È permesso " | + | di nuovo per verificare\\ |
| - | restrict -4 default kod notrap nomodify nopeer noquery | + | ntpq -pn |
| - | restrict -6 default kod notrap nomodify nopeer noquery | + | |
| - | + | ||
| - | # Utenti locali | + | |
| - | restrict 127.0.0.1 | + | |
| - | restrict ::1 | + | |
| - | </ | + | |
| - | + | ||
| - | In pratica stiamo configurando il client affinché si sincronizzi col server NTP della nostra rete e non con uno esterno. | + | |
| - | + | ||
| - | === Avvio del Servizio === | + | |
| - | Come fatto per il server, per avviare correttamente il servizio, ci basteranno pochi semplici passi. L' | + | |
| - | < | + | |
| - | # service ntp stop | + | |
| - | Stopping NTP server: ntpd. | + | |
| - | + | ||
| - | # ntpdate 192.168.1.4 | + | |
| - | 9 Nov 19:17:24 ntpdate[3497]: | + | |
| - | + | ||
| - | # service ntp start | + | |
| - | Starting NTP server: ntpd. | + | |
| - | </ | + | |
| - | + | ||
| - | La solita query sui peer di sincronizzazione ci confermerà che tutto è andato | + | |
| - | < | + | |
| - | # ntpq -pn | + | |
| - | | + | |
| - | ============================================================================== | + | |
| - | | + | |
| - | *217.194.13.90 | + | |
| - | -93.62.188.182 | + | |
| - | +2.229.10.127 | + | |
| - | +77.242.176.254 | + | |
| - | </ | + | |
| - | Come si può notare il primo dei peer contattati è adesso il server NTP ''' | + | |
| - | + | ||
| - | == Nota == | + | |
| - | Si tenga presente che quando il servizio ntp è attivo... ntpdate non funziona: | + | |
| - | + | ||
| - | < | + | |
| - | # ntpdate time.ien.it | + | |
| - | 9 Nov 19:29:03 ntpdate[3250]: | + | |
| - | + | ||
| - | # service ntp stop | + | |
| - | Stopping NTP server: ntpd. | + | |
| - | + | ||
| - | # ntpdate time.ien.it | + | |
| - | 9 Nov 19:29:16 ntpdate[3263]: | + | |
| - | + | ||
| - | # service ntp start | + | |
| - | Starting NTP server: ntpd. | + | |
| - | </ | + | |
| + | Nota\\ | ||
| + | Si tenga presente che quando il servizio ntp è attivo... ntpdate non funziona:\\ | ||
| == Reti protette da Firewall == | == Reti protette da Firewall == | ||
| Linea 160: | Linea 84: | ||
| Esso infatti utilizza porte non privilegiate ed è quindi ''" | Esso infatti utilizza porte non privilegiate ed è quindi ''" | ||
| + | ===== per centos ===== | ||
| + | |||
| + | verificare zona impostata con\\ | ||
| + | timedatactl | ||
| + | |||
| + | accertarsi di aver impostato la zona giusta es. Europe/Rome /CEST, 0.200 | ||
| + | |||
| + | |||
| + | ===== chrony ===== | ||
| + | |||
| + | alternativa | ||
| + | |||
| + | vedere anche questo sito: https:// | ||