顯示具有 ntp 標籤的文章。 顯示所有文章
顯示具有 ntp 標籤的文章。 顯示所有文章

2018年1月8日 星期一

ntp server , centos7

https://www.phpini.com/linux/rhel-centos-7-setup-ntp-sync-time

https://www.server-world.info/en/note?os=CentOS_7&p=ntp

root@dlp ~]# 
yum -y install ntp
[root@dlp ~]# 
vi /etc/ntp.conf
# line 18: add the network range you allow to receive requests

restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap
# change servers for synchronization

#
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
server ntp1.jst.mfeed.ad.jp iburst
server ntp2.jst.mfeed.ad.jp iburst
server ntp3.jst.mfeed.ad.jp iburst
[root@dlp ~]# 
systemctl start ntpd 

[root@dlp ~]# 
systemctl enable ntpd 


[root@dlp ~]# 
firewall-cmd --add-service=ntp --permanent 

success
[root@dlp ~]# 
firewall-cmd --reload 

success

Verify it works normally like follows.
[root@dlp ~]# 
ntpq -p

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ntp1.jst.mfeed. 172.29.1.100     2 u   29   64    1   18.826   -0.126   0.000
+ntp2.jst.mfeed. 172.29.2.50      2 u   28   64    1   21.592    0.018   0.000
*ntp3.jst.mfeed. 133.243.236.18   2 u   28   64    1   22.666   -1.033   0.000

可以用 ntpstat 看同步了沒  不然會有 尚未時間同步之伺服器不被信任!!
網路斷掉要 retry 幾次才會上同步




2015年6月25日 星期四

NTP 種種

在 windows xp 下開 ntp Service 的方式

http://www.timetools.co.uk/2013/07/23/configuring-a-windows-time-server/
http://www.ichiayi.com/wiki/tech/winxp_ntpd


1. 開始>執行,輸入”regedit”
2. 找到 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters]
3. 修改或新增一個DWORD,名為”LocalNTP”,值為”1”(0 = disabled, 1 = enabled)
4. XP 的防火牆開啟 UDP 123 port

ntpdate -d 可以看查詢的詳細內容