ntp 服务编译安装 及 更改端口

开源库下载地址:   http://download.csdn.net/detail/mtour/8151863


编译方法:


./configure  --prefix=/usr/local/ntp/

make 

make install


更改ntp服务器端口方法

代码中默认端口宏定义是 123, 最近发现公司网络对于小端口的包不做转发,校时总是失败,于是尝试更换端口


ntp.h 中 更改宏定义值


/*
 * NTP protocol parameters.  See section 3.2.6 of the specification.
 */
#define	NTP_VERSION	((u_char)4) /* current version number */
#define	NTP_OLDVERSION	((u_char)1) /* oldest credible version */
#define	NTP_PORT	11027	/* included for non-unix machines */

我这里改为 11027 端口,经过测试,能够校时成功了。