ntp的操蛋玩意儿报错

54 views
Skip to first unread message

wangsh

unread,
Oct 26, 2011, 4:46:48 AM10/26/11
to shlug
哎,抒发一下感情,、。。。。。。
正题:
首先我的环境:
在RHel服务器上配置ntp服务,我的服务器在内网,是通过映射外网ip上网的。
my ntp file:
[root@web ~]# ntpq -c version                                                                                          
ntpq 4.2...@1.1190-r Thu Oct  5 04:11:36 EDT 2006 (1)

[root@web ~]# cat /etc/ntp.conf 


restrict default nomodify notrap noquery

restrict 127.0.0.1 


# -- CLIENT NETWORK -------
# Permit systems on this network to synchronize with this
# time service.  Do not permit those systems to modify the
# configuration of this service.  Also, do not use those
# systems as peers for synchronization.
# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
#restrict 10.4.49.0 mask 255.255.255.0 nomodify notrap nopeer

# --- OUR TIMESERVERS ----- 
server cn.pool.ntp.org prefer


# --- NTP MULTICASTCLIENT ---
restrict 172.16.210.0 mask 255.255.0.0 nomodify notrap

server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay  0.008
keys            /etc/ntp/keys

[root@web ~]#  cat /etc/ntp/step-tickers 

[root@web ~]# service ntpd start
ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: [  OK  ]
启动失败,说明是在和上级同步的时候出现问题了,之后我停止吊ntpd服务;然后执行以下命令
[root@web ~]# ntpdate cn.pool.ntp.org
26 Oct 16:43:03 ntpdate[30575]: no server suitable for synchronization found
报这种错误的原因我查了,有一下几种:
1.开启了防火墙,挡掉了123端口;我本机上没开iptables
2.官方说如果使用的是ntp4.2(包括4.2)之后的版本,在restrict的定义中使用了notrust的话,会导致以上错误,但是我配置文件里面没有notrust。


我怀疑是不是外网ip出去的时候123端口被挡掉了呢?大家有什么意见没?


--
http://mygill.com

wangsh

unread,
Oct 26, 2011, 4:58:35 AM10/26/11
to shlug
首先在服务器上ping cn.pool.ntp.org是可以ping通的,就是ntpdate的时候就出现这种错误;
--
http://mygill.com

Shell Xu

unread,
Oct 26, 2011, 8:26:54 AM10/26/11
to sh...@googlegroups.com

先抓包

From P81HD

wangsh

unread,
Oct 26, 2011, 10:14:37 PM10/26/11
to sh...@googlegroups.com
刚刚问过网络的,外网出去的时候确实有一个防火墙,但是现在防火墙上已经把123端口打开了,为什么还是会报错。郁闷。
--
http://mygill.com

Xin Yue

unread,
Oct 27, 2011, 5:04:25 AM10/27/11
to Shanghai Linux User Group
ntpq -d ntp-server

看一下debug信息

On Oct 27, 10:14 am, wangsh <zzwan...@gmail.com> wrote:
> 刚刚问过网络的,外网出去的时候确实有一个防火墙,但是现在防火墙上已经把123端口打开了,为什么还是会报错。郁闷。
>

> 在 2011年10月26日 下午8:26,Shell Xu <shell909...@gmail.com>写道:
>
>
>
>
>
>
>
>
>
> > 先抓包
>
> > From P81HD

> > 在 2011-10-26 下午4:58,"wangsh" <zzwan...@gmail.com>写道:
>
> > 首先在服务器上ping cn.pool.ntp.org是可以ping通的,就是ntpdate的时候就出现这种错误;
>

Jianlei Zhang

unread,
Oct 31, 2011, 5:22:14 AM10/31/11
to sh...@googlegroups.com
restrict所有的Server IP,默认阻挡所有IP连入NTP Daemon。具体见MAN,不具体见《鸟哥私房菜》。

--
此致

张建雷 敬上

Reply all
Reply to author
Forward
0 new messages