Chinaunix首页 | 论坛 | 博客
  • 博客访问: 61033
  • 博文数量: 38
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 396
  • 用 户 组: 普通用户
  • 注册时间: 2015-07-12 14:46
文章分类

全部博文(38)

文章存档

2016年(11)

2015年(27)

我的朋友
最近访客

分类: LINUX

2015-08-12 11:05:48

查看ntp端口:

[root@super63 ~]# grep ntp /etc/services

 

安装ntp服务器(默认已经安装)

[root@super63 ~]# rpm -ivh /mnt/Packages/ntp-4.2.6p5-1.el6.x86_64.rpm                  

 

配置ntp服务器配置文件:

[root@super63 ~]# vim /etc/ntp.con

restrict 192.168.1.0 mask 255.255.255.0    #允许的网段

 

server 127.127.1.0   local clock  #本地作为服务器,可以写外网的服务器但必须要能上网

fudge 127.127.1.0     stratum 10

重启服务:                                                                                                                                       

[root@super63 ~]# service ntpd start

 

查看:

[root@super63 ~]# ntpstat

synchronised to local net at stratum 11

   time correct to within 7948 ms

   polling server every 64 s


[root@super63 ~]# ntpq -p

     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

*LOCAL(0)        .LOCL.          10 l   23   64    1    0.000    0.000   0.000

 

Ntp服务器需要等待一会才可以同步

 

测试:

 

[root@super64 ~]# ntpdate 192.168.1.63

 7 Aug 22:48:05 ntpdate[3216]: adjust time server 192.168.1.63 offset -0.004701 sec

[root@super64 ~]# ntpdate 192.168.1.63

 7 Aug 22:48:14 ntpdate[3217]: adjust time server 192.168.1.63 offset -0.000245 sec

[root@super64 ~]# ntpdate 192.168.1.63

 7 Aug 22:48:16 ntpdate[3218]: adjust time server 192.168.1.63 offset 0.000083 sec

同步完成

 

 

同步外网的ntp服务器:

(机器要能上网)

ntpdate cn.pool.ntp.org  #ntp服务器




阅读(978) | 评论(0) | 转发(0) |
0

上一篇:dd

下一篇:samba

给主人留下些什么吧!~~