Chinaunix首页 | 论坛 | 博客
  • 博客访问: 303501
  • 博文数量: 60
  • 博客积分: 2579
  • 博客等级: 大尉
  • 技术积分: 570
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-17 14:54
文章分类

全部博文(60)

文章存档

2011年(1)

2010年(1)

2009年(35)

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

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