Chinaunix首页 | 论坛 | 博客
  • 博客访问: 76838
  • 博文数量: 58
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 560
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-16 06:26
文章分类

全部博文(58)

文章存档

2011年(1)

2009年(34)

2008年(23)

我的朋友
最近访客

分类: LINUX

2008-06-16 22:57:17

#server段的ip为192.168.17.1

#局域网的网段为192.168.17.0

#可以根据自己的需要修改

服务器端的ntp.conf文件

# /etc/ntp.conf, configuration for ntpd


driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable


# You do need to talk to an NTP server or two (or three).

server 127.127.1.1

# pool.ntp.org maps to more than 300 low-stratum NTP servers.

# Your server will pick a different set every time it starts up.

# *** Please consider joining the pool! ***

# *** < ***



# By default, exchange time with everybody, but don't allow configuration.

# See /usr/share/doc/ntp-doc/html/accopt.html for details.

restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.

restrict 127.0.0.1
restrict ::1

# Clients from this (example!) subnet have unlimited access,

# but only if cryptographically authenticated

restrict 192.168.17.0 mask 255.255.255.0 nomodify

# If you want to provide time to your local subnet, change the next line.

# (Again, the address is an example only.)

#broadcast 192.168.123.255


# If you want to listen to time broadcasts on your local subnet,

# de-comment the next lines. Please do this only if you trust everybody

# on the network!

#disable auth

#broadcastclient

 

客户端ntp.conf的配置

# /etc/ntp.conf, configuration for ntpd


driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable


# You do need to talk to an NTP server or two (or three).

server 192.168.17.1

# pool.ntp.org maps to more than 300 low-stratum NTP servers.

# Your server will pick a different set every time it starts up.

# *** Please consider joining the pool! ***

# *** < ***


# By default, exchange time with everybody, but don't allow configuration.

# See /usr/share/doc/ntp-doc/html/accopt.html for details.

restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.

restrict 127.0.0.1
restrict ::1

# Clients from this (example!) subnet have unlimited access,

# but only if cryptographically authenticated

#restrict 192.168.123.0 mask 255.255.255.0 notrust


# If you want to provide time to your local subnet, change the next line.

# (Again, the address is an example only.)

#broadcast 192.168.123.255


# If you want to listen to time broadcasts on your local subnet,

# de-comment the next lines. Please do this only if you trust everybody

# on the network!

#disable auth

#broadcastclient

阅读(1014) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~