FreeBSD NTP 简单使用

1.ntptrace xxx.xxx.xxx.xxx
查找要对时的服务器状态,可以trace到一级时钟服务器,
2.ntpq -p
显示当前时钟服务器状态
3.ntpdata xxx.xxx.xxx.xxx
与时钟服务器对时,着先时钟服务器要先对时,才能用来提钟时钟服务
4.ntpd
既可以自动对时,又可对外提供时钟服务,先要配置/etc/ntp.conf
restrict  0.0 . 0.0  mask  0.0 . 0.0  notrust nomodify notrap  // 控制访问
server xxx.xxx.xxx.xxx   // 对时的外部服务器
server  127.127 . 1.0   
fudge 
127.127 . 1.0  stratum  10
driftfile 
/ etc / ntpd.drift

5.开机对时,/etc/rc.conf中添加
 ntpdate_enable="YES"
 ntpdate_program="/usr/sbin/ntpdate"
 ntpdate_flags="-b"

6.每天(好像是每天)对时且对外提供时钟服务,  在/etc/rc.conf中添加

 xntpd_enable="YES"
 xntpd_program="/usr/sbin/ntpd"
 xntpd_flags="-p /var/run/ntpd.pid"

7.端口
 时钟服务器端口为123,udp , netstat  -an
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值