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
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.drift5.开机对时,/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 简单使用的更多相关文章
- linux时钟基本概念、CST与UTC、以及NTP简单设置
1,安装linux的时候在设置时间的时候有一个选项:system clock uses UTC,那么这个UTC是什么意思呢? 世界协调时间(Universal Time Coordinated,UTC ...
- linux时钟概念CST与UTC、以及NTP简单设置
1.世界协调时间(Universal Time Coordinated,UTC): GPS 系统中有两种时间区分,一为UTC,另一为LT(地方时)两者的区别为时区不同,UTC就是0时区的时间,地方时为 ...
- 【玩转开源】BananaPi R2 —— 第三篇 基于Openwrt开发一个简单的路由器
上一篇讲解了R2的网口配置,这一篇我们以BananaPi R2为例子来实现一个简单的路由器:那么一个简单的路由器应该具备什么样的功能呢?最简单的说就是wan+lan+ap这三个功能. 首先wan+la ...
- openStack kilo 手动Manual部署随笔记录
一 ,基于neutron网络资源主机(控制节点,网络节点,计算节点)网络规划配置 1, controller.cc 节点 网络配置截图
- TCP常用网络和木马使用端口对照表,常用和不常用端口一览表
[开始-运行- CMD , 输入 netstat -an 然后回车就可以查看端口] 端口: 服务:Reserved 说明:通常用于分析操作系统.这一方法能够工作是因为在一些系统中“”是无效端口,当你试 ...
- FreeBSD简单配置SSH并用root远程登陆方法
FreeBSD简单配置SSH并用root远程登陆方法 前言:最近下载了FreeBSD,在虚拟机上安装,第一步先要开启SSH服务,用终端putty软件可以实现在windows系统进行远程管理, 初级 = ...
- CentOS, FreeBSD, Ubuntu LTS 维护风格的简单比较
https://jackqq.wordpress.com/2014/06/24/centos-vs-freebsd-vs-ubuntu-lts/ 看到周围的人好多在用或者学 CentOS,忍不住也想看 ...
- 简单的FreeBSD 的内核编译
简单的FreeBSD 的内核编译 删除并重新下载内核源码 删除自带的内核源码rm -rf /usr/src 下载内核源码wget https://download.freebsd.org/ftp/re ...
- freebsd升级时出错,没有ntp用户解决
freebsd升级出错,没有ntp用户 终端执行命令 pw groupadd ntpd -g 123 pw useradd ntpd -u 123 -g ntpd -h - -d /var/db/nt ...
随机推荐
- JQuery 过滤选择器 与属性修改的方法演示比较
文本匹配 在表单输入项里面输入值,根据输入值,点击判断按钮,让对应的复选框选中 <html> <head> <meta http-equiv="Content- ...
- LeetCode-177:第N高的薪水
第N高的薪水与第二高的薪水,解题思路是一样的,只要对LeetCode-176的SQL做一下变形,便可以满足这题,详见:https://www.cnblogs.com/zouqf/p/10282392. ...
- vue学习--Props
Props: props用以从父组件接收数据: 使用: Vue.component('child',{ ...
- busybox编译 fatal error: curses.h: 没有那个文件或目录解决办法
执行make menuconfig时出现如下错误@ubuntu:/home/dev/busybox-1.19.3# make menuconfig HOSTCC scripts/kconfig/lxd ...
- B1086 就不告诉你 (15分)
B1086 就不告诉你 (15分) 做作业的时候,邻座的小盆友问你:"五乘以七等于多少?"你应该不失礼貌地围笑着告诉他:"五十三."本题就要求你,对任何一对给定 ...
- TouTiao开源项目 分析笔记8 图解分析数据加载方式
1.整体构架 1.1.以一个段子页面为例,列出用到的主要的类,以图片的方式展示. 1.2.基础类 这里最基础的接口有: IBaseView<T>==>定义了5个方法. 然后最基础 ...
- 我教你怎么玩转git
我教你怎么玩转git 1.想要练习解决冲突? 很好办.创建本地分支,a,b, a上面,这样改.b上面那样改. 然后你就解决冲突就可以了. 可以merge 或者cheerypick 2.想要玩一个不要历 ...
- Android Stadio 相关
这几天,电脑坏了.重装系统,慢慢的学到了很多Android stadio 的相关知识.总结一下吧: 1.gradle 编译工具:在工程的gradle/wrapper/gradle–wrapper.pr ...
- 剑指Offer - 九度1507 - 不用加减乘除做加法
剑指Offer - 九度1507 - 不用加减乘除做加法2013-11-29 20:00 题目描述: 写一个函数,求两个整数之和,要求在函数体内不得使用+.-.*./四则运算符号. 输入: 输入可能包 ...
- 《Cracking the Coding Interview》——第1章:数组和字符串——题目1
2014-03-18 01:25 题目:给定一个字符串,判断其中是否有重复字母. 解法:对于可能有n种字符的字符集,用一个长度为n的数组统计每个字符的出现次数,大于1则表示有重复. 代码: // 1. ...