FreeBSD NTP 简单使用
Posted 云水
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了FreeBSD NTP 简单使用相关的知识,希望对你有一定的参考价值。
FreeBSD NTP 简单使用
来源 https://blog.csdn.net/stevexk/article/details/1349506
1.ntptrace xxx.xxx.xxx.xxx
查找要对时的服务器状态,可以trace到一级时钟服务器,
2.ntpq -p 或者 ntpq -pn
显示当前时钟服务器状态
3.ntpdata xxx.xxx.xxx.xxx 或者 ntpdata -d xxx.xxx.xxx.xxx (Debug模式)
与时钟服务器对时,着先时钟服务器要先对时,才能用来提钟时钟服务
4.ntpd
既可以自动对时,又可对外提供时钟服务,先要配置/etc/ntp.conf
![技术分享图片](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![技术分享图片](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![技术分享图片](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![技术分享图片](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![技术分享图片](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
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
以上是关于FreeBSD NTP 简单使用的主要内容,如果未能解决你的问题,请参考以下文章