solaris的ntp时间同步

solaris的ntp时间同步
1.修改ntp配置文件
[root@unknown ntpstats]#cat /etc/inet/ntp.conf
server time.windows.com prefer
server time.windows.com
#fudge time.windows.com stratum 0
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

2.重新启动服务
   svcadm enable ntp
   svcadm restart ntp

3.修改系统时间
   date 071416022009

4.抓包查看能否进行数据同步
snoop -x udp port 123

serv.lrq.com -> 207.46.197.32 NTP   client [st=0] (2009-07-14 16:17:25.38047 )
 
           0: 000f 1f9d 735b 000c 2993 537e 0800 4500    ....s[..).S~..E.
          16: 004c fac9 4000 ff11 0000 c0a8 003b cf2e    .L..@........;..
          32: c520 007b 007b 0038 557c db00 04fa 0001    . .{.{.8U|......
          48: 0000 0001 0000 0000 0000 0000 0000 0000    ................
          64: 0000 0000 0000 0000 0000 0000 0000 0000    ................
          80: 0000 ce06 bd95 6166 6000                   ......af`.
 
207.46.197.32 -> serv.lrq.com    NTP  server [st=3] (2009-07-15 16:24:29.78357 )
 
           0: 000c 2993 537e 000f 1f9d 735b 0800 4500    ..).S~....s[..E.
          16: 004c 5ffa 0000 6d11 9874 cf2e c520 c0a8    .L_...m..t... ..
          32: 003b 007b 007b 0038 64ee 1c03 04fa 0000    .;.{.{.8d.......
          48: 14a1 0000 1370 4812 cd9d ce08 0e4e 24c0    .....pH......N$.
          64: bc1d ce06 bd95 6166 6000 ce08 10bd c897    ......af`.......
          80: c65a ce08 10bd c897 c65a                   .Z.......Z
 
serv.lrq.com -> 207.46.197.32 NTP  client [st=0] (2009-07-15 16:25:05.67451 )
 
           0: 000f 1f9d 735b 000c 2993 537e 0800 4500    ....s[..).S~..E.
          16: 004c facb 4000 ff11 0000 c0a8 003b cf2e    .L..@........;..
          32: c520 007b 007b 0038 557c db00 06ef 0000    . .{.{.8U|......
          48: 0000 0001 001a 0000 0000 0000 0000 0000    ................
          64: 0000 0000 0000 0000 0000 0000 0000 0000    ................
          80: 0000 ce08 10e1 acac 2000                   ........ .

到第三个包的时候服务器已经完成时间同步了.

solaris客户端
用crontab
0-59/15 /usr/sbin/ntpdate time.windows.com >> /var/ntp/ntp.log 2>&1
没15分钟同步一次
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值