NTP配置手册
Linux客户端Ntp时间同步配置手册1、NTP服务开机自动加载:1.1首先查看ntpd的服务是否在客户端开机时自动重启:chkconfig --list |grep ntpd //查看ntpd服务开启情况1.2设置NTP服务在下一次开机运行状态:chkconfig ntpd on //开机自动运行chkconfig ntpd off //关闭开机自动运行ntp服务2、修改/etc/ntp.conf文件:2.1通过命令more /etc/ntp.conf查看ntp.conf文件下的内容2.2指定时间同步服务器:restrict 10.150.210.72 mask 255.255.255.0 nomodify notrap noquery server 10.150.210.72备注:此命令必须加载到server 127.127.1.0 # local clock之前。
2.3指定NTP服务器日志文件:logfile /var/log/ntp2.4注销如下命令行:#server #server #server 3、修改/etc/ntp/step-tickers文件3.1通过more /etc/ntp/step-tickers查看文件内容;3.2通过vi /etc/ntp/step-tickers进行编辑文件,增加如下内容10.150.210.72 //ntp服务器地址127.127.1.0 //Linux客户端本地地址4、修改/etc/sysconfig/ntpd文件,允许BIOS与系统时间同步4.1通过vi etc/sysconfig/ntpd进行编辑,更改如下内容:SYNC_HWCLOCK=no改为yes5、通过service ntpd start开启ntpd服务;6、测试NTP时间同步6.1通过ntpq –p 查看偏移量6.2通过ntpdate –d 10.150.210.72进行测试如果出现transmit(10.150.210.72)receive(10.150.210.72) 则配置正确。
备注:如果不能同步可通过service ntpd restart命令重启ntpd服务。
7、附录(配置log文件):[root@zqnyx-web-01 ~]# chkconfig --list |grep ntpdntpd 0:关闭1:关闭2:关闭3:关闭4:关闭5:关闭6:关闭[root@zqnyx-web-01 ~]# more /etc/ntp.conf# Permit time synchronization with our time source, but do not# permit the source to query or modify the service on this system.restrict default kod nomodify notrap nopeer noqueryrestrict -6 default kod nomodify notrap nopeer noquery# Permit all access over the loopback interface. This could# be tightened as well, but to do so would effect some of# the administrative functions.restrict 127.0.0.1restrict -6 ::1# Hosts on local network are less restricted.#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap# Use public servers from the project.# Please consider joining the pool (/join.html).server server server #broadcast 192.168.1.255 key 42 # broadcast server#broadcastclient # broadcast client#broadcast 224.0.1.1 key 42 # multicast server#multicastclient 224.0.1.1 # multicast client#manycastserver 239.255.254.254 # manycast server#manycastclient 239.255.254.254 key 42 # manycast client# Undisciplined Local Clock. This is a fake driver intended for backup # and when no outside source of synchronized time is available. server 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10# Drift file. Put this in a directory which the daemon can write to.# No symbolic links allowed, either, since the daemon updates the file # by creating a temporary in the same directory and then rename()'ing # it to the file.driftfile /var/lib/ntp/drift# Key file containing the keys and key identifiers used when operating # with symmetric key cryptography.keys /etc/ntp/keys# Specify the key identifiers which are trusted.#trustedkey 4 8 42# Specify the key identifier to use with the ntpdc utility.#requestkey 8# Specify the key identifier to use with the ntpq utility.#controlkey 8[root@zqnyx-web-01 ~]# date2012年03月12日星期一16:19:41 CST以下为修改后/etc/ntp.conf文件:[root@zqnyx-web-01 ~]# more /etc/ntp.conf# Permit time synchronization with our time source, but do not# permit the source to query or modify the service on this system. restrict default kod nomodify notrap nopeer noqueryrestrict -6 default kod nomodify notrap nopeer noquery# Permit all access over the loopback interface. This could# be tightened as well, but to do so would effect some of# the administrative functions.restrict 127.0.0.1restrict -6 ::1# Hosts on local network are less restricted.#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap# Use public servers from the project.# Please consider joining the pool (/join.html). #server #server #server #broadcast 192.168.1.255 key 42 # broadcast server#broadcastclient # broadcast client#broadcast 224.0.1.1 key 42 # multicast server#multicastclient 224.0.1.1 # multicast client#manycastserver 239.255.254.254 # manycast server#manycastclient 239.255.254.254 key 42 # manycast clientrestrict 10.150.210.72 mask 255.255.255.0 nomodify notrap noquery server 10.150.210.72# Undisciplined Local Clock. This is a fake driver intended for backup# and when no outside source of synchronized time is available. server 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10# Drift file. Put this in a directory which the daemon can write to.# No symbolic links allowed, either, since the daemon updates the file # by creating a temporary in the same directory and then rename()'ing # it to the file.driftfile /var/lib/ntp/drift# Key file containing the keys and key identifiers used when operating # with symmetric key cryptography.keys /etc/ntp/keys# Specify the key identifiers which are trusted.#trustedkey 4 8 42# Specify the key identifier to use with the ntpdc utility.#requestkey 8# Specify the key identifier to use with the ntpq utility.#controlkey 8logfile /var/log/ntp[root@zqnyx-web-01 ~]# cd /var/log/[root@zqnyx-web-01 log]# ls -l |grep ntp[root@zqnyx-web-01 log]# pwd/var/log[root@zqnyx-web-01 log]# touch ntp[root@zqnyx-web-01 log]# more /etc/ntp/step-tickers[root@zqnyx-web-01 log]# vi /etc/ntp/step-tickers~~~"/etc/ntp/step-tickers" 2L, 26C written[root@zqnyx-web-01 log]# more /etc/ntp/step-tickers10.150.210.72127.127.1.0[root@zqnyx-web-01 log]# vi /etc/sysconfig/ntpd# Drop root to id 'ntp:ntp' by default.OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"# Set to 'yes' to sync hw clock after successful ntpdateSYNC_HWCLOCK=no# Additional options for ntpdateNTPDATE_OPTIONS=""~~~"/etc/sysconfig/ntpd" 8L, 210C written[root@zqnyx-web-01 log]# more /etc/sysconfig/ntpd# Drop root to id 'ntp:ntp' by default.OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"# Set to 'yes' to sync hw clock after successful ntpdateSYNC_HWCLOCK=yes# Additional options for ntpdateNTPDATE_OPTIONS=""[root@zqnyx-web-01 log]# service ntpd startntpd: 同步时间服务器:[确定]同步硬件时钟到系统时钟[确定]启动ntpd:[确定][root@zqnyx-web-01 log]# date2012年03月12日星期一16:28:01 CST[root@zqnyx-web-01 log]# more /var/log/ntp[root@zqnyx-web-01 log]# more /var/log/ntp[root@zqnyx-web-01 log]# watch ntpq -p[root@zqnyx-web-01 log]# ntpdate -d 10.150.210.7212 Mar 16:29:00 ntpdate[22796]: ntpdate 4.2.2p1@1.1570-o Thu May 14 13:01:42 UTC 2009 (1)Looking for host 10.150.210.72 and service ntphost found : 10.150.210.72transmit(10.150.210.72)receive(10.150.210.72)transmit(10.150.210.72)receive(10.150.210.72)transmit(10.150.210.72)receive(10.150.210.72)transmit(10.150.210.72)receive(10.150.210.72)transmit(10.150.210.72)server 10.150.210.72, port 123stratum 1, precision -19, leap 00, trust 000refid [GPS], delay 0.02585, dispersion 0.00000transmitted 4, in filter 4reference time: d3083244.45d6c56d Mon, Mar 12 2012 16:28:52.272originate timestamp: d308324d.04e5950a Mon, Mar 12 2012 16:29:01.019 transmit timestamp: d308324d.063a0839 Mon, Mar 12 2012 16:29:01.024filter delay: 0.02603 0.02585 0.02585 0.025850.00000 0.00000 0.00000 0.00000filter offset: -0.00524 -0.00532 -0.00533 -0.005330.000000 0.000000 0.000000 0.000000delay 0.02585, dispersion 0.00000offset -0.00532912 Mar 16:29:01 ntpdate[22796]: adjust time server 10.150.210.72 offset -0.005329 sec [root@zqnyx-web-01 log]# ntpdate -s[root@zqnyx-web-01 log]# ntpdate -s 10.150.210.72[root@zqnyx-web-01 log]# more /var/log/ntp。
linux NTP配置方法
Linux NTP配置方法一、配置Linux异构网络下的ntp时间服务器1. 软件下载安装以源代码为例#/tmp/wget/ntp_chinese/down/server/ntp-4.2.0.tar.gz # tar -zxvf ntp-4.2.0.tar.gz –C /usr/local/src;cd/usr/local/src/ntp-4.2.02. 开始设定参数、编译与安装:#./configure --prefix=/usr/local/ntp --enable-all-clocks--enable-parse-clocksmake clean ; makemake checkmake install安装完成。
注:其实在我们安装Linux系统的时候,已经自带了ntp软件包,我们可以通过rpm -q ntp命令来查询例如:[root@Oracle ~]# rpm -q ntpntp-4.2.0.a.20040617-4.EL4.1二、理解NTP服务的配置文件1.NTP软件包的结构和相关命令NTP服务的配置文件包括四个文件如表2 。
表2 NTP服务的配置文件与 NTP 及系统时间有关的执行文件包括几个文件如表3 。
表3 与 NTP 及系统时间有关的执行文件说明:Linux 时钟类型在分类和设置上却和Windows大相径庭。
和 Windows 不同的是,Linux将时钟分为系统时钟(System Clock)和硬件(Real Time Clock,简称RTC)时钟两种。
系统时间是指当前Linux Kernel中的时钟,而硬件时钟则是主板上由电池供电的那个主板硬件时钟,这个时钟可以在BIOS的“Standard BIOS Feture”项中进行设置。
当Linux启动时,硬件时钟会去读取系统时钟的设置,然后系统时钟就会独立于硬件运作。
2.理解NTP服务端的设置文件/etc/ntp.conf关于权限设定部分权限的设定主要以 restrict 这个参数来设定,格式如下:restrict IP地址 mask 子网掩码参数其中 IP 可以是IP地址,也可以是 default ,default 就是指所有的IP 参数有以下几个:ignore :关闭所有的 NTP 联机服务nomodify:客户端不能更改服务端的时间参数,但是客户端可以通过服务端进行网络校时。
linux(RedHat)NTP时间同步的配置方法
局域网内linux(RedHat)NTP时间同步的配置方法2009.12.31目录1. NTP跟踪层级安排2. NTP配置数据对单点故障应对能力的评估3. NTP服务器-redhat服务器的配置数据及说明4. NTP客户机一redhat服务器的配置数据及说明NTP跟踪层级安排设备第1跟踪时钟源第2跟踪时钟源第3跟踪时钟源网内NTP S/C192.168.80.31192.168.80.4prefer注1127.127.1.0server 192.168.80.34192.168.80.4prefer注1127.127.1.0server 其他redhat机器192.168.80.31或192.168.80.34192.168.80.34或192.168.80.31127.127.1.0client 注1:如有其他与192.168.80.4同级的时钟源可用,则NTP的可靠性更佳。
网内所有NTP客户机由自已的NTP算法根据当时NTP服务器及网络状态自行选择NTP服务器:不是192.168.80.3僦是192.168.80.34一旦网内NTP客户机失去了与网内NTP服务器的连接,将会按照自已的时钟频率将系统时间继续走下去,除了可能会造成日志时间和告警时间与标准时间有非常小的偏差外,不会对服务器应用或自身造成任何影响。
二.NTP配置数据对单点故障应对能力的评估下面就局域网内系统中相关设备发生单点故障时,各设备的NTP时钟跟踪情况做一分析:1. .上级NTP服务器单机失效但vrrp有效:2. 上级NTP服务器vrrp失效):3. 局域网内的NTPserver_1(31)失效:4. 局域网内的NTPserver_2(34)失效:三.NTP服务器—redhat服务器(31,34)的配置数据及说明(注:对NTP服务器的唯一要求是机器上不要跑双机系统。
)1. NTP的配置文件(/etc/ntp.conf)的内容:#ntprestrictpartrestrictdefaultkodnomodifynotrapnopeernoqueryrestrict127.0.0.1restrict192.168.80.0mask255.255.255.0nomodifynotraprestrict192.168.81.0mask255.255.255.0nomodifynotrap#ntpserverpartserver192.168.80.4version3server127.127.1.0#fudge127.127.1.0stratum10#ntpotherpartdriftfile/var/lib/ntp/drift2. 硬件时间每日有条件地被系统时间更新的配置(1)创建硬件时间更新脚本:/root/day_update_hwclock.sh的内容:/usr/sbin/ntpq-p>/root/tmp_ntpq.txt2>&1ifgrep"*†192.168.80.4"/root/tmp_ntpq.txtthen/bin/date>>/root/tmp_ntpq.txt2>&1/usr/sbin/hwclock--show>>/root/tmp_ntpq.txt2>&1/usr/sbin/hwclock-w>>/root/tmp_ntpq.txt2>&1[$?-eq0]&&echo"hwclock-wsuccess">>/root/tmp_ntpq.txt2>&1/bin/date>>/root/tmp_ntpq.txt2>&1/usr/sbin/hwclock--show>>/root/tmp_ntpq.txt2>&1elselogger-palert"[HC]:NTPserverlostorNTPservicestop"fihwclock-wsuccessMonJan414:19:20CST2010Mon04Jan201002:19:20PMCST-0.015907seconds[root@ftpnode2~]#该脚本用于将系统时间去同步硬件时间,以消除硬件时间的累积误差。
linux下NTP服务的配置
linux下NTP服务的配置第一步安装NTP服务查找当前系统是否已安装ntp:[root@localhost ~]# rpm -qa | grep ntp发现已经安装ntp-4.2.4p8-3.el6.centos.x86_64第二步配置NTP服务器NTP服务器配置如下编辑配置文件/etc/ntp.conf设置此服务器同上层服务器做时间同步的IP地址:restrict mask 255.255.255.255 nomodify notrap noqueryrestrict mask 255.255.255.255 nomodify notrap noqueryrestrict 127.0.0.1restrict -6 ::1restrict 10.75.0.0 mask 255.255.255.0 nomodify notrapserver server server server 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10配置文件说明如下restrict定义默认访问规则,nomodify禁止远程主机修改本地服务器配置,notrap拒绝特殊的ntpdq捕获消息,noquery拒绝btodq/ntpdc查询,这里的查询是服务器本身状态查询。
其中,为东南大学,为北京邮电大学。
配置文件的最后两行作用是当服务器与公用的时间服务器失去联系时以本地时间为客户端提供时间服务。
第三步启动NTPD为了使NTP服务可以在系统引导的时候自动启动,执行:#chkconfig ntpd on启动ntpd:service ntpd start第四步检查时间服务器是否正确同步每次修改了配置文件后都需要重新启动服务来使配置生效。
可以使用下面的命令来检查NTP服务,可以得到一个进程ID号:#pgrep ntpd使用下面的命令检查时间服务器同步的状态:#ntpq –p每次重启NTP服务器之后大约要3到5分钟客户端才能与server 建立正常的通讯连接。
ntp服务器配置
国家开发银行时间同步基础设施建设项目实施说明书2010年4月文档信息文档状态记录目录网络设备NTP客户端配置 (6)一、C ISCO下NTP服务客户端配置 (6)1.1思科基础网络设备配置NTP (6)1.2思科CSS11503上配置NTP (7)1.3思科CSACSE-1113-K9上配置NTP (8)1.4思科SCE上配置NTP (9)1.5思科GSS-4492R-K9上配置NTP (10)1.6思科CS-MARS-100E-K9上配置NTP (11)1.7 Call Manager配置NTP (15)二、华为设备配置NTP (17)2.1华为路由器及防火墙配置NTP (17)2.2华为NS-SecPath 100F-AC,S3900上配置NTP (18)三、联想网域防火墙的NTP配置 (20)四、启明星辰防火墙的NTP配置 (21)五、F5下的NTP配置 (22)六、网康下的NTP配置 (23)七、P OLYCOM的NTP配置 (24)主机系统NTP客户端配置 (26)一、AIX下NTP服务客户端配置 (26)二、HP-UNIX下NTP服务客户端配置 (29)三、S OLARIS下NTP服务客户端配置 (33)3.1 solaris8、9 NTP服务客户端配置 (33)3.2 solaris10 NTP服务客户端配置 (34)3.3 同步的检查 (35)四、L INUX下NTP服务客户端配置 (36)五、W INDOWS下NTP服务客户端配置 (37)5.1 Windows 98下NTP服务客户端配置 (37)5.2 Windows 2000下NTP服务客户端配置 (37)5.3 Windows XP下NTP服务客户端配置 (38)5.4 Windows 2003下NTP服务客户端配置 (38)5.5 Windows Vista下NTP服务客户端配置 (39)5.6 Windows 7下NTP服务客户端配置 (40)5.7 Windows 2008下NTP服务客户端配置 (40)六、SCO UNIX下NTP服务客户端配置 (41)网络设备NTP客户端配置一、Cisco下ntp服务客户端配置1.1思科基础网络设备配置NTP此方案包括思科路由器2600,1721,1841,2800,7609,3825,3845,7200,交换机2940,2950,2960,3550,3750,4500,6500及防火墙ASA5520,PIX上配置NTP。
H3C配置命令31-ntp命令
【描述】 display ntp-service sessions 命令用来显示本地设备 NTP 服务维护的所有 sessions 的状态。
注意: 除 NTP 服务器模式外,其余的 NTP 工作模式均会建立连接。
[12345]1.0.1.11 LOCAL(0) 3 377 64 16 -0.4 0.0 0.9
note: 1 source(master),2 source(peer),3 selected,4 candidate,5 configured
1.1.2 display ntp-service status
【举例】
<H3C> display ntp-service trace server 127.0.0.1,stratum 8, offset 0.000000, synch distance 0.00000 refid 127.127.1.0
1.1.4 ntp-service access
【命令】 ntp-service access { query | synchronization | server | peer } acl-number undo ntp-service access { query | synchronization | server | peer }
1-3
H3C S7500 系列以太网交换机 命令手册 NTP
第 1 章 NTP 配置命令
【描述】 ntp-service access 命 令 用 来 设 置 对 本 地 设 备 服 务 的 访 问 控 制 权 限 。 undo ntp-service access 命令用来取消设置的访问控制权限。 缺省情况下,没有设置对本地设备服务的访问控制权限。 设置对本地设备 NTP 服务的访问控制权限。这里提供了一种最小限度的安全措施, 更安全的方法是进行身份验证。当有一个访问请求时,按照最小访问限制到最大访 问 限 制 依 次 匹 配 , 以 第 一 个 匹 配 的 为 准 , 匹 配 顺 序 为 peer , server , synchronization,query。
NTP时间服务器配置
NTP时间服务器学习笔记引言NTP时间服务器就是提供时间授权(对时)的服务器,它可以用Linux或Windows系统来架设。
总来说NTP时间服务器理解和配置都相对简单,我们只在此提醒一点NTP通信端口采用udp的123端口。
以下我们以Windows 2008/Redaht5.4作为时间服务器为服务端,Linux和Windows系统为客户端来学习一下。
服务端Windows NTP服务器默认情况下,独立服务器WINDOWS SERVER 2008是作为NTP客户端工作的,所以必须通过修改注册表,以使系统作为NTP服务器运行。
工作之前请先备份注册表文件。
1、修改以下选项的键值HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServe r内的[Enabled]设定为1。
打开NTP服务器功能(默认是不开启NTP Server服务,除非电脑升级成为域控制站)。
2、修改以下键值HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags 设定为5.该设定强制主机将它自身宣布为可靠的时间源,从而使用内置的互补金属氧化物半导体(CMOS) 时钟。
如果要采用外面的时间服务器就用默认的a值即可.# 210.72.145.44 (国家授时中心服务器IP地址)3、修改以下键值HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type内的[Type]设定为NTP。
4、重启Win32Time服务:先关闭windows time 服务,再开启该服务。
可以在“管理工具”的“服务”界面下完成,也可以以DOS 方式输入“net stop w32time”、“net start w32time”。
NTP配置
NTP配置手册目录第1章简介 (3)第2章NTP配置 (4)2.1 简介 (4)2.2 基本指令描述 (4)2.3 应用实例 (6)2.3.1 应用实例一 (6)2.4 监控和调试 (7)2.4.1 监控命令 (7)2.4.2 监控命令实例 (7)2.4.3 调试命令 (7)2.4.4 调试命令实例 (8)第3章时区配置 (9)3.1 简介 (9)3.2 基本指令描述 (9)第1章简介本文主要讲述以下网络时间协议NTP在迈普设备中的配置方法。
本章主要内容:●NTP配置●时区配置第2章NTP配置本章主要内容:●NTP简介●NTP基本指令描述●NTP配置示例2.1 简介网络时间协议(NTP)是用来在整个网络内发布和接收精确时间的协议,主要解决网络内所有路由器的时钟同步问题。
所有Maipu路由器都有自己的系统时钟,能够保存当前的日期和时间。
使用NTP可以同步这些系统时钟。
2.2 基本指令描述⏹ntp master启动NTP服务器;否则使用no格式。
ntp master stratum-numberno ntp master语法描述stratum-number 配置服务器stratum值,范围2-15默认为8【缺省情况】未定义。
⏹ntp server配置NTP客户端,指定服务器的IP地址,使用no命令删除服务器ntp server [vrf vrf-name] ip-address key key-number version version source interface-nameno ntp server [vrf vrf-name] ip-address语法描述vrf vrf-name NTP工作的VRFip-address NTP服务器地址key key-number指定认证服务器密钥,范围1-4294967295version version指定NTP工作版本号,范围1-4默认4【缺省情况】未定义注:在配置了ntp server命令后,我公司的设备在作为客户端的同时,隐性也做了ntp服务器。
16-NTP配置命令
第 1 章 NTP 配置命令
1.1.2 ntp-service server
【命令】 ntp-service server ip-address [ authentication-keyid keyid key-value key ] undo ntp-service server ip-address
【举例】 # 本地设备被配置成由服务器 128.108.22.44 提供同步时间,需要身份验证,采用 keyid 为 2,key-value 为 abc。
[H3C]ntp-service server 128.108.22.44 authentication-keyid 2 key-value abc
【视图】 系统视图
【参数】 ip-address:远程服务器 IP 地址。 authentication-keyid:定义 MD5 身份验证密钥 ID 号。 keyid:向该远程服务器发送消息使用的密钥 ID 号,取值范围:0~4294967295。 key-value:定义 MD5 身份验证密钥。 key:MD5 身份验证密钥,长度为 1~32 的字符串。
【描述】 ntp-service server 命令用来配置 NTP 服务器。undo ntp-service server 命令用 来删除 NTP 服务器。 ntp-service server 命令指定 ip-address 所确定的远程服务器作为本地时间服务器。 其中,ip-address 是一个主机地址,不能为广播、组播地址、127 开头的地址或 AP 自身接口的 IP 地址。本地设备工作在 client 模式,在这种工作模式下,只能是本地 客户机同步到远程服务器。取消该 server 配置时采用相应的 undo 命令。
NTP时间服务器配置
NTP服务器配置实验环境:RHEL5Server:192.168.2.10Client:192.168.2.120一、搭建时间同步服务器1、编译安装ntp serverrpm -qa | grep ntp2、修改ntp.conf配置文件vi /etc/ntp.conf①、第一种配置:允许任何IP的客户机都可以进行时间同步#restrict default kod nomodify notrap nopeer noqueryrestrict default modify notrap②、第二种配置:只允许192.168.2.0网段的客户机进行时间同步在restrict default nomodify notrap noquery(表示默认拒绝所有IP的时间同步)之后增加一行:restrict 192.168.2.0 mask 255.255.255.0 nomodify notrap3、启动ntp服务service ntpd start开机启动服务chkconfig --level 35 ntpd on4、ntpd启动后,客户机要等几分钟再与其进行时间同步,否则会提示“no server suitable for synchronization found”错误。
二、配置时间同步客户机手工执行ntpdate <ntp server> 来同步或者利用crontab来执行crontab -e0-59/10 * * * * /usr/sbin/ntpdate 192.168.2.10 >> /root/ntpdate.log 2>&1表示每隔10分钟同步一次时间三、在服务端验证:# watch ntpq -pEvery 2.0s: ntpq -p Tue Dec 7 05:52:55 2010remote refid st t when poll reach delay offset jitter====================================================================== ========*LOCAL(0) .LOCL. 8 l 22 64 377 0.000 0.000 0.001服务正常运行在客户端进行同步验证:# ntpdate -d 192.168.2.107 Dec 05:54:42 ntpdate[3627]: ntpdate 4.2.2p1@1.1570-o Thu Nov 26 11:35:07 UTC 2009 (1) Looking for host 192.168.2.10 and service ntphost found : 192.168.2.10transmit(192.168.2.10)receive(192.168.2.10)transmit(192.168.2.10)receive(192.168.2.10)transmit(192.168.2.10)receive(192.168.2.10)transmit(192.168.2.10)receive(192.168.2.10)transmit(192.168.2.10)server 192.168.2.10, port 123stratum 9, precision -20, leap 00, trust 000refid [192.168.2.10], delay 0.02632, dispersion 0.00061transmitted 4, in filter 4reference time: d0a890f1.b4d040ff Tue, Dec 7 2010 5:54:41.706originate timestamp: d0a89102.09318178 Tue, Dec 7 2010 5:54:58.035transmit timestamp: d0a890f2.3c8effe2 Tue, Dec 7 2010 5:54:42.236filter delay: 0.02910 0.02632 0.02808 0.026410.00000 0.00000 0.00000 0.00000filter offset: 15.80026 15.79880 15.79793 15.798370.000000 0.000000 0.000000 0.000000delay 0.02632, dispersion 0.00061offset 15.7988017 Dec 05:54:42 ntpdate[3627]: step time server 192.168.2.10 offset 15.798801 sec附:当用ntpdate -d 来查询时会发现导致no server suitable for synchronization found 的错误的信息有以下2个:错误1.Server dropped: Strata too high在ntp客户端运行ntpdate serverIP,出现no server suitable for synchronization found的错误。
H3C配置命令31-ntp命令
【视图】 任意视图
1-1
H3C S7500 系列以太网交换机 命令手册 NTP
第 1 章 NTP 配置命令
【参数】 无
【描述】 display ntp-service status 命令用来显示 NTP 服务的状态信息。
【举例】
<H3C> display ntp-service status Service status:enabled clock status: unsynchronized clock stratum: 16 reference clock ID: none nominal frequency: 100.0000 Hz actual frequency: 100.0000 Hz clock precision: 2^18 clock offset: 0.0000 ms root delay: 0.00 ms root dispersion: 0.00 ms peer dispersion: 0.00 ms reference time: 00:00:00.000 UTC Jan 1 1900(00000000.00000000)
【举例】
# 显示 NTP 服务维护的所有 sessions 的状态。
<H3C> display ntp-service sessions
source
reference stra reach poll now offset delay disper
********************************************************************
1-2
H3C S7500 系列以太网交换机 命令手册 NTP
