CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOS6.5搭建NTP服务器,并为思科交换机提供时间同步大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

本文主要讲解如何在CentOS6.5上配置NTP服务器,并为思科交换机提供时间同步功能。 服务器安装步骤: 1. Linux上安装NTP软件: 命令:yum install ntp(回车) 输出信息: [root@localhost ~]# yum install ntp Loaded plugins: fastestmirror, refresh-packagekit, security Det
@H_801_13@

本文主要讲解如何在CentOS6.5上配置NTP服务器,并为思科交换机提供时间同步功能


服务器安装步骤:

1. Linux上安装NTP软件:

命令:yum install ntp(回车)

输出信息:

[root@localhost ~]# yum install ntp

Loaded plugins: fastestmirror,refresh-packagekit,security

Determining fastest mirrors

* base: mirrors.tuna.tsinghua.edu.cn

* extras: mirrors.tuna.tsinghua.edu.cn

* updates: mirrors.tuna.tsinghua.edu.cn

SetTing up Install Process

Resolving Dependencies

--> Running transaction check

---> Package ntp.x86_64 0:4.2.6p5-1.el6.centos will be updated

---> Package ntp.x86_64 0:4.2.6p5-10.el6.centos.1 will be an update

--> Processing Dependency: ntPDAte = 4.2.6p5-10.el6.centos.1 for package: ntp-4.2.6p5-10.el6.centos.1.x86_64

--> Running transaction check

---> Package ntPDAte.x86_64 0:4.2.6p5-1.el6.centos will be updated

---> Package ntPDAte.x86_64 0:4.2.6p5-10.el6.centos.1 will be an update

--> Finished Dependency Resolution

……

2.配置ntp服务器的配置文件

命令:[root@localhost ~]# vim /etc/ntp.conf


driftfile /var/lib/ntp/drift

reStrict default kod nomodify notrap nopeer noquery

reStrict -6 default kod nomodify notrap nopeer noquery

reStrict 127.0.0.1

reStrict -6 ::1

server ntp.fudan.edu.cn

reStric ntp.fudan.edu.cn nomodify notrap noquery

server 127.127.1.0

fudge 127.127.1.0 stratum 8

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

3. 保存退出配置文件,重启ntp服务。

[root@localhost ~]# service ntpd start

如果时间没有立马同步,稍等几分钟


思科交换机客户端配置步骤:

1. 登录交换机配置如下命令:

ntp server 192.168.4.212 (指定ntp服务器地址)

clock timezone GMT 8 (定义时区)

service timestamps debug datetiR_526_11845@e localtime (定义debug日志显示时间)

service timestamps log datetiR_526_11845@e localtime (定义log日志显示时间)

2. 查看命令

sw#show clock

20:56:16.132 GMT Thu Oct 13 2016

sw#show ntp status

Clock is synchronized,stratum 10,reference is 192.168.1.1

nominal freq is 119.2092 Hz,actual freq is 119.2081 Hz,precision is 2**17

reference time is DBAA0318.33909662 (20:56:56.201 GMT Thu Oct 13 2016)

clock offset is 0.2520 msec,root delay is 2.78 msec

root dispersion is 11.99 msec,peer dispersion is 0.41 msec


搭建过程中遇到的问题及解决办法:

搭建完成后发现交换机一直无法同步时间,使用另外一台linux机器配置为客户端一样无法同步时间。

ntp客户端运行ntPDAte serverIP,出现no server suitable for synchronization found错误

最后发现是没有关闭linux防火墙。。。

使用命令:#serviceiptablesstop 关闭linux防火墙后,服务器运行正常。


链接http://www.blogjava.net/spray/archive/2008/07/10/213964.html

大佬总结

以上是大佬教程为你收集整理的CentOS6.5搭建NTP服务器,并为思科交换机提供时间同步全部内容,希望文章能够帮你解决CentOS6.5搭建NTP服务器,并为思科交换机提供时间同步所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。