The Network time Protocol (NTP) is an internet protocol which is useful to synchronize system clocks to
coordinate with Universal Time (UTC) over the network. One System can be a NTP Server or NTP client. NTP client uses the NTP protocol to synchronize its clock timing with NTP server which is sync with public internet which is widely available for NTP time synchronization purpose.
NTP Client --> Sync with NTP server --> Sync with Public Network
NTP clients can function with NTP servers in 3 ways:
Important NTP files
NTP Server Configuration Steps
coordinate with Universal Time (UTC) over the network. One System can be a NTP Server or NTP client. NTP client uses the NTP protocol to synchronize its clock timing with NTP server which is sync with public internet which is widely available for NTP time synchronization purpose.
NTP Client --> Sync with NTP server --> Sync with Public Network
NTP clients can function with NTP servers in 3 ways:
- in a client-server basis
- in a peer to peer mode
- sending the time using broadcast/multicast
Files
|
Descriptions
|
/etc/ntp.conf
|
Default configuration file.
|
/etc/ntp.drift
|
Default drift file which contains latest estimate of clock frequency error. (i.e difference between your clock and the data provided by NTP server)
|
/etc/ntp.keys
|
Default key file which contains authentication keys
|
NTP Server Configuration Steps
Let we can configure NTP server with using the pubilc network NTP time synchronization services
which are following "server 3.in.pool.ntp.org , server 3.asia.pool.ntp.org, server 2.asia.pool.ntp.org"bash-3.00# cp /etc/inet/ntp.server /etc/inet/ntp.conf bash-3.00# vi /etc/inet/ntp.conf
# Either a peer or server. Replace "XType" with a value from the # table above. server 3.in.pool.ntp.org server 3.asia.pool.ntp.org server 2.asia.pool.ntp.org broadcast 224.0.1.1 ttl 4 enable auth monitor driftfile /var/ntp/ntp.drift statsdir /var/ntp/ntpstats/ filegen peerstats file peerstats type day enable filegen loopstats file loopstats type day enable filegen clockstats file clockstats type day enablethen we have to create the drift file and start the NTP services
bash-3.00# touch /var/ntp/ntp.drift bash-3.00# bash-3.00# svcs ntp STATE STIME FMRI disabled Jul_25 svc:/network/ntp:default bash-3.00# svcadm enable svc:/network/ntp:default bash-3.00# bash-3.00# svcs ntp STATE STIME FMRI online 23:47:06 svc:/network/ntp:default bash-3.00#
bash-3.00# ntpq -pn remote refid st t when poll reach delay offset disp ============================================================================== 224.0.1.1 0.0.0.0 16 u - 64 0 0.00 0.000 16000.0 *120.88.47.10 128.4.1.1 2 u 481 512 377 28.06 -40.717 9.61 +220.130.158.72 220.130.158.70 2 u 507 512 375 121.20 -32.876 14.24 +78.111.50.52 212.87.0.71 3 u 47 512 277 222.41 -58.496 9.20 bash-3.00#"*" indicates the server to which you are currently synchronized.
"+" indicates the server which take the leading role if the current server becomes unavailable for some reason.
Fields | Descriptions |
---|---|
remote | The IP address or DNS name of the remote server |
refid | An identification of the reference clock and type |
st | The "stratum" or level of the server: for almost all systems, 2 is great. Your local system will have a higher number. |
t | The type of service. "I" indicates your local system or "u" indicates for communicating with remote servers |
when | Last sync timing which is in seconds format, |
poll | Current polling interval in seconds, Note:- "when" should be no greater than "poll". |
reach | indicating whether responses have been received to your local server's eight most recent requests.The value starts at 0. If your local server is receiving responses to all its requests, it will go to 1, then 3, then 7.The display is in octal, so 377 is the maximum value |
delay | Recent average roundtrip time in milliseconds from request to response |
offset | Estimated differential between your system clock and this time server's clock, in milliseconds |
disp | A measure of the variability of the delays between request and receipt of a response, in milliseconds |
Let we can start the configuration for NTP client, First copy the ntp.client sources file as ntp.conf and add nfs server name
bash-3.00# cp /etc/inet/ntp.client /etc/inet/ntp.conf bash-3.00# vi /etc/inet/ntp.confCreate a drift file and start the ntp services
bash-3.00# touch /var/ntp/ntp.drift bash-3.00# bash-3.00# svcs ntp STATE STIME FMRI disabled Jul_25 svc:/network/ntp:default bash-3.00# svcadm enable svc:/network/ntp:default bash-3.00# bash-3.00#Now we can see the status by executing ntpq -p command
No comments:
Post a Comment