
* Cảnh báo vài ý trước khi vào nội dung chính mình cần chia sẻ :
- 1. Bài viết này mang tính chất là dành cho cá nhân để lưu trữ kiến thức cũng như kinh nghiệm bản thân đã trải qua. || This article is intended for individuals to store knowledge as well as personal experiences.
- 2. Bài viết chia sẻ phi lợi nhuân. || Post sharing non-profit.
- 3. Bài viết có thể làm vài bạn sẽ biểu môi rằng đơn giản thế này ai chẳng biết, post lên làm gì ==> thì nhìn lại mục “1” nhé. || The article can do some of you will demonstrate that this simple one does not know, what to post ==> then look at the “1” section.
- 4. Bài viết có lấy hình ảnh và một vài nội dung trên internet, nên nếu có gì vi phạm, cảm phiền các bạn báo lại giúp mình. || The article has taken pictures and some content on the internet, so if something breaks, please report it for me.
NTP : Configuration NTP Server
*** NOTED: Cấu hình máy chủ thành một NTP Server để đồng bộ thời gian với các thiết bị khác trong hệ thống. || Configure NTP Server to provide time sync services to Clients or Other Devices.
Bước 1: khởi chạy PowerShell với quyền quản trị và cấu hình như bên dưới
Step 1: Run PowerShell with Administrator Privilege and Configuration as following:
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
# confirm current setting (follows are default settings)
PS C:\Users\Administrator> Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer"
InputProvider : 0
AllowNonstandardModeCombinations : 1
EventLogFlags : 0
ChainEntryTimeout : 16
ChainMaxEntries : 128
ChainMaxHostEntries : 4
ChainDisable : 0
ChainLoggingRate : 30
RequireSecureTimeSyncRequests : 0
DllName : C:\Windows\SYSTEM32\w32time.DLL
Enabled : 0
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Serv
ices\w32time\TimeProviders\NtpServer
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Serv
ices\w32time\TimeProviders
PSChildName : NtpServer
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
# enable NTP Server feature
PS C:\Users\Administrator> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer" -Name "Enabled" -Value 1
# set [AnnounceFlags] to 5
# number means
# 0x00 : Not a time server
# 0x01 : Always time server
# 0x02 : Automatic time server
# 0x04 : Always reliable time server
# 0x08 : Automatic reliable time server
PS C:\Users\Administrator> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Config" -Name "AnnounceFlags" -Value 5
# restart Windows Time service
PS C:\Users\Administrator> Restart-Service w32Time
# if Windows Firewall is running, allow NTP port
PS C:\Users\Administrator> New-NetFirewallRule `
-Name "NTP Server Port" `
-DisplayName "NTP Server Port" `
-Description 'Allow NTP Server Port' `
-Profile Any `
-Direction Inbound `
-Action Allow `
-Protocol UDP `
-Program Any `
-LocalAddress Any `
-LocalPort 123
Bước 2: Máy trạm cần kết nối đồng bộ thời gian với máy chủ NTP như là một thành viên NTP trong hệ thống.
Step 2: NTP Host also needs to Sync time with other clients as an NTP Clients
Done 🙂 – Have a good day and enjoy !!!

Leave a Reply