Projekt

Allgemein

Profil

Aktionen

Setup ntp server » Historie » Revision 2

« Zurück | Revision 2/3 (Vergleich) | Weiter »
Jeremias Keihsler, 17.04.2024 10:13


Install Procedure for ntp-server

Requirements

To install ntpd you will need the following:
  • a installed and supported operating system (e.g. CentOS 9.x)
  • root-access
  • a fast internet connection

Preliminary Note

This procedure is based on a documentation supplied by

Install

Install ntp:

yum install ntpsec

Configure ntp Server

vim /etc/ntp.conf

Use external ntp-Server as reference
Basically the ntp.conf is ready configured, so there is nothing to change

If there is need to use additional or different ntp-server then add it to the server section

server 10.13.109.241 iburst

Use internal clock as reference

This is only necessary if there is no reliable time-source or ntp-server available at all

server 127.127.1.0     # local clock
fudge  127.127.1.0 stratum 4          # set stratum to any value from 0 to 16, the higher the safer, defaults to 10, 4 is working with WinXP and Win7

restrict access from outside

restrict default nomodify noquery
# enable all access for localhost
restrict 127.0.0.1
restrict ::1
# enable access from subnet
restrict 10.13.109.1/24 nomodify
restrict 10.13.108.0/24

Start ntp Server

manually start ntp Server:

systemctl start ntpd

automatically start the service at boot time:

systemctl enable ntpd

you can check by

systemctl is-enabled ntpd

configure firewall

When you are not running the CentOS Firewall yet, then start it:

systemctl enable firewalld
systemctl start firewalld

add chronyd to the firewall if you are going to serve ntp

firewall-cmd --add-service=ntp --permanent
firewall-cmd --reload

Usage

try to connect via windows machine and enter as a internet-time-source the ip-adress of the new ntp-server. (e.g. 192.168.2.53)

try to connect via linux machine and use to sync time:

ntpdate 192.168.2.53

ntpq -p

Von Jeremias Keihsler vor 7 Monaten aktualisiert · 2 Revisionen