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

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

# We won't allow *anything* from hosts not listed in the configuration
# This means you need a restrict line for each server
restrict default ignore
restrict -6 default ignore# Allow just about anything from localhost, IPv4.
restrict 127.0.0.1 mask 255.0.0.0 restrict 127.0.0.1
restrict -6 ::1driftfile /var/tmp/ntp.drift
logfile /var/log/ntpd.log# Log everything, even from ntpd (which otherwise defaults to "all =sync")
logconfig =all +allserver 127.127.1.0
fudge 127.127.1.0 stratum 5server 182.92.12.11 minpoll 6 maxpoll 10
restrict 182.92.12.11 nomodify notrap nopeer noquery

/etc/ntp.common.conf

# Common elements of NTP configuration
#
# Do not edit: changes will be lost following reboot.
# For site-specific NTP configuration, see the instructions in /etc/ntp.conf
## We won't allow *anything* from hosts not listed in the configuration
# This means you need a restrict line for each server
restrict default ignore
restrict -6 default ignore# Allow just about anything from localhost, IPv4.
restrict 127.0.0.1 mask 255.0.0.0 restrict 127.0.0.1
restrict -6 ::1driftfile /var/tmp/ntp.drift
logfile /var/log/ntpd.log# Log everything, even from ntpd (which otherwise defaults to "all =sync")
logconfig =all +allserver 127.127.1.0
fudge 127.127.1.0 stratum 5

/etc/ntp.conf

includefile /etc/ntp.common.conf
server 218.75.4.130 minpoll 6 maxpoll 10
restrict 218.75.4.130 nomodify notrap nopeer noquery

常用的Ntp服务器:

203.107.6.88
ntp.aliyun.com
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com
ntp8.aliyun.com

FreeBSD NTP 简单使用相关推荐

  1. Linux同步时间chrony替换NTP简单好用

    Linux同步时间chrony替换NTP简单好用 1.介绍 Chrony是一个开源自由的网络时间协议 NTP 的客户端和服务器软软件.它能让计算机保持系统时钟与时钟服务器(NTP)同步,因此让你的计算 ...

  2. linux撤销以硬件时钟作为UTC,linux时钟基本概念、CST与UTC、以及NTP简单设置

    1,安装linux的时候在设置时间的时候有一个选项: system clock uses UTC,那么这个UTC是什么意思呢? 世界协调时间(Universal Time Coordinated,UT ...

  3. 使用css伪类选择器,css的伪类选择器的使用

    伪类选择器,在不同情况下显示的css,伪类选择器在处理页面的美观是很大帮助.其实很多美丽的按钮或者页面都是有这些基础的知识实现的,掌握好基础很重要. 名字 实例 说明 :link a:link 选择所 ...

  4. 小白装openstack(二) 安装NTP服务

    NTP简单介绍 度娘说: NTP是网络时间协议(Network Time Protocol),它是用来同步网络中各个计算机的时间的协议. 官方安装文档说: You must install NTP t ...

  5. ntp VS chrony

    对比 NTP(Network Time Protocol)和Chrony都是用于同步计算机时钟的协议,它们都可以在计算机集群中实现时间同步.但是,它们有一些不同之处: 算法:NTP使用一种复杂的算法来 ...

  6. FreeBSD软件安装(转)

    1.FreeBSD应用软件管理的基本原理: 1.FreeBSD应用系统的组成 FreeBSD应用系统由FreeBSD操作系统和移植(ports)到FreeBSD的各种应用软件组成 FreeBSD操作系 ...

  7. freebsd系统能用的C语言工具,FreeBSD的软件管理

    1.FreeBSD应用系统的组成 FreeBSD应用系统由FreeBSD操作系统和移植(ports)到FreeBSD的各种应用软件组成 FreeBSD操作系统本身,是由内核和基本系统组成,基本系统由系 ...

  8. 端口基础常识大全+常用端口对照

    端口基础常识大全+常用端口对照 [color=Red][size=4][b]端口基础常识大全[/b][/size][/color] [color=Green]1) 公认端口(Well Known Po ...

  9. port常用和不常用端口一览表

    1 tcpmux tcp port service multiplexer 传输控制协议端口服务多路开关选择器 2 compressnet management utility compressnet ...

最新文章

  1. golang中的strings.Index
  2. WHERE WILL BUSINESS PHD GO?
  3. Qt5.5.0环境下的mingw编译dcmtk 3.6.1_20150924
  4. python 字典程序_Python 字典(Dictionary)操作详解
  5. 中石油训练赛 - Racing Gems(最长不下降子序列)
  6. Google怎么做(1.相关提示)
  7. 计算机在管理会计应用中的作用,信息化在管理会计中的作用
  8. 7-11 找最长的字符串 (15 分)
  9. Vue路由Hash模式分析
  10. AI论文解读:基于Transformer的多目标跟踪方法TrackFormer
  11. python入门经典代码-【python】编程语言入门经典100例--12
  12. Windows下使用命令打开远程桌面
  13. 最新QQ勋章墙+防撤回V9.6.1版本+实测可用
  14. 锌合金铸件压铸方案的优化与应用 | 智铸超云案例分享
  15. 数字人实业应用场景,远远不止屏幕互动
  16. kotlin插件禁用导致的Android studio无法打开-mac
  17. 史蒂夫·乔布斯的故事:启示录还是警世钟?
  18. 用VC++5.0播放AVI文件的两种方法
  19. 如何保证代码的健壮性和可读性
  20. CTSCAPIO 2017游记

热门文章

  1. 10款最好的免费在线工具进行网站设计与开发
  2. 解决rsync 同步auth failed on module问题
  3. 反射的本质——元数据
  4. 高考成绩查询2021艺术类6,2021年高考成绩6月26日左右可查!
  5. python函数返回多个变量_Python 3:通过多个函数返回变量
  6. 动画库NineOldAndroids
  7. Unity 2D游戏开发快速入门第1章创建一个简单的2D游戏
  8. python读取数据的函数详解_你了解文件缓存机制吗?磁盘文件如何读写?Python中open函数详解...
  9. 新的服务器装Ubuntu系统(如何在windows下制作启动盘以及如何安装Ubuntu系统)
  10. JAVA实现链表的反转(《剑指offer》)