Setting a local NTP server and client

You want to synchronize your solaris servers? don’t have access to an atomic clock?
You must pick one of your solaris servers to be the time server, in this case i picked a sun server called “server”. You
will trust in this server’s clock to be correct most of the time.
At “server” do:
root@server# cd /etc/inet
root@server# vi ntp.conf
And paste this inside:
server 127.127.1.0 prefer
fudge 127.127.1.0 stratum 0
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 enable
keys /etc/inet/ntp.keys
trustedkey 0
requestkey 0
controlkey 0
Then, start ntp:
root@server# /etc/rc2.d/S74xntpd start
Verify its status by checking the process and querying the server:
root@server# ps -ef | grep ntp
root 8339 6236 0 11:39:16 pts/6 0:00 grep ntp
root 6725 1 0 11:15:48 x y z 0:00 /usr/lib/inet/xntpd
root@server# ntpq -pn
remote refid st t when poll reach delay offset disp
==============================================================================
*127.127.1.0 .LCL. 0 l 1 64 377 0.00 0.000 10.01
224.0.1.1 0.0.0.0 16 – – 64 0 0.00 0.000 16000.0
now ON THE CLIENT MACHINE:
root@client# cd /etc/inet
root@client# vi ntp.conf
Paste the contents:
driftfile /var/lib/ntp/ntp.drift
server 150.250.250.18
Notice that 150.250.250.18 is the ip of the timeserver called “server”.
Now nitialize the ntp daemon:
295/433
root@client# /etc/rc2.d/S74xntpd start
Check if it’s running:
root@client # ps -ef | grep ntp
root 23579 1 0 11:20:12 x y z 0:00 /usr/lib/inet/xntpd
root 1054 18332 0 11:41:34 pts/8 0:00 grep ntp
root@client # ntpq -pn
remote refid st t when poll reach delay offset disp
==============================================================================
*150.250.250.18 .LCL. 1 u 4 64 377 18.83 0.473 1.80
That’s it!
now type the “date” command, and see the results!
296/

Leave a Reply

Your email address will not be published. Required fields are marked *