一、NTP服务器配置
1.安装ntp软件包
[root@localhost ~]# dnf -y install ntp ntpdate
2.编辑ntp服务配置文件
[root@localhost ~]# vi /etc/ntp.conf
注释掉下面行
#server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst |
添加
restrict 192.168.63.0 mask 255.255.255.0 nomodify notrap server 127.127.1.0 iburst |
3.启动ntpd服务
[root@localhost ~]# systemctl start ntpd
4.查看ntpd服务状态
[root@localhost ~]# systemctl status ntpd
● ntpd.service - Network Time Service Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled) Active: active (running) since 二 2019-05-14 13:34:37 CST; 1min 31s ago Process: 1802 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS) Main PID: 1803 (ntpd) CGroup: /system.slice/ntpd.service └─1803 /usr/sbin/ntpd -u ntp:ntp -g 5 |