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 ::1 driftfile /var/tmp/ntp.drift
logfile /var/log/ntpd.log # Log everything, even from ntpd (which otherwise defaults to "all =sync")
logconfig =all +all server 127.127.1.0
fudge 127.127.1.0 stratum 5 server 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 ::1 driftfile /var/tmp/ntp.drift
logfile /var/log/ntpd.log # Log everything, even from ntpd (which otherwise defaults to "all =sync")
logconfig =all +all server 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时钟基本概念、CST与UTC、以及NTP简单设置

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

  2. linux时钟概念CST与UTC、以及NTP简单设置

    1.世界协调时间(Universal Time Coordinated,UTC): GPS 系统中有两种时间区分,一为UTC,另一为LT(地方时)两者的区别为时区不同,UTC就是0时区的时间,地方时为 ...

  3. 【玩转开源】BananaPi R2 —— 第三篇 基于Openwrt开发一个简单的路由器

    上一篇讲解了R2的网口配置,这一篇我们以BananaPi R2为例子来实现一个简单的路由器:那么一个简单的路由器应该具备什么样的功能呢?最简单的说就是wan+lan+ap这三个功能. 首先wan+la ...

  4. openStack kilo 手动Manual部署随笔记录

    一 ,基于neutron网络资源主机(控制节点,网络节点,计算节点)网络规划配置 1, controller.cc 节点 网络配置截图

  5. TCP常用网络和木马使用端口对照表,常用和不常用端口一览表

    [开始-运行- CMD , 输入 netstat -an 然后回车就可以查看端口] 端口: 服务:Reserved 说明:通常用于分析操作系统.这一方法能够工作是因为在一些系统中“”是无效端口,当你试 ...

  6. FreeBSD简单配置SSH并用root远程登陆方法

    FreeBSD简单配置SSH并用root远程登陆方法 前言:最近下载了FreeBSD,在虚拟机上安装,第一步先要开启SSH服务,用终端putty软件可以实现在windows系统进行远程管理, 初级 = ...

  7. CentOS, FreeBSD, Ubuntu LTS 维护风格的简单比较

    https://jackqq.wordpress.com/2014/06/24/centos-vs-freebsd-vs-ubuntu-lts/ 看到周围的人好多在用或者学 CentOS,忍不住也想看 ...

  8. 简单的FreeBSD 的内核编译

    简单的FreeBSD 的内核编译 删除并重新下载内核源码 删除自带的内核源码rm -rf /usr/src 下载内核源码wget https://download.freebsd.org/ftp/re ...

  9. freebsd升级时出错,没有ntp用户解决

    freebsd升级出错,没有ntp用户 终端执行命令 pw groupadd ntpd -g 123 pw useradd ntpd -u 123 -g ntpd -h - -d /var/db/nt ...

随机推荐

  1. JS获取元素属性和自定义属性

    获取元素的属性分为两种类型: 1-获取元素常见的属性(class,id,type,value……) 2-获取自定义的元素的属性(data-value,data-mess…….) 获取元素的属性,设置元 ...

  2. C#基础-面向对象-多态

    多态,不同对象对同一方法的不同实现 使用abstract关键字表示抽象类 // 表示是一个抽象类 public abstract class Animal { private string name; ...

  3. TFS 2015服务端安装与客户端签入项目步骤

    一.参考如下3篇文章搭建TFS2015环境 1.参考文章如下: TFS 2015(Visual Studio Team Foundation Server)的下载和安装http://www.cnblo ...

  4. html ajax请求 php 下拉 加载更多数据 (也可点击按钮加载更多)

    <input type="hidden" class="total_num" id="total" value="{$tot ...

  5. Laravel Nginx 除 `/` 外所有路由 404

    解决方法 在nginx配置添加以下设置: location / { try_files $uri $uri/ /index.php?$query_string; } 详见Laravel官方文档:htt ...

  6. source tree 使用心得

    SourceTree 是 Windows 和Mac OS X 下免费的 Git 和 Hg 客户端管理工具,同时也是Mercurial和Subversion版本控制系统工具.支持创建.克隆.提交.pus ...

  7. SpringMVC使用注解@RequestMapping映射请求

    pringMVC通过使用@RequestMapping注解,实现指定控制器可以处理哪些URL请求. 控制器的类定义及方法定义处都可以标注@RequestMapping: 类定义处:提供初步的请求映射信 ...

  8. 常用 Git 命令清单【转--阮一峰】

    常用 Git 命令清单 感谢作者 --> 原文链接 我每天使用 Git ,但是很多命令记不住. 一般来说,日常使用只要记住下图6个命令,就可以了.但是熟练使用,恐怕要记住60-100个命令. 下 ...

  9. 我理解中的Hadoop HDFS分布式文件系统

    一,什么是分布式文件系统,分布式文件系统能干什么 在学习一个文件系统时,首先我先想到的是,学习它能为我们提供什么样的服务,它的价值在哪里,为什么要去学它.以这样的方式去理解它之后在日后的深入学习中才能 ...

  10. 一步一步学Linq to sql(一):预备知识

    什么是Linq to sql Linq to sql(或者叫DLINQ)是LINQ(.NET语言集成查询)的一部分,全称基于关系数据的 .NET 语言集成查询,用于以对象形式管理关系数据,并提供了丰富 ...