Saturday, September 19, 2009

NTP Server & Client Configs on Fedora 10

On the server, ensure that there is the following line in the /etc/hosts file:
127.0.0.1 localhost
Also ensure that port 123/UDP is open.

Then edit the /etc/ntp.conf file to look like this:
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).


# Permit time synchronization with our time source, but do not

# permit the source to query or modify the service on this system.

restrict default kod nomodify notrap nopeer noquery

restrict -6 default kod nomodify notrap nopeer noquery


# Permit all access over the loopback interface. This could

# be tightened as well, but to do so would effect some of

# the administrative functions.
restrict 127.0.0.1

restrict -6 ::1


# Use public servers from the pool.ntp.org project.

# Please consider joining the pool (http://www.pool.ntp.org/join.html).

#server 0.fedora.pool.ntp.org dynamic

#server 1.fedora.pool.ntp.org dynamic

#server 2.fedora.pool.ntp.org dynamic

driftfile /var/lib/ntp/drift


# Undisciplined Local Clock. This is a fake driver intended for backup

# and when no outside source of synchronized time is available.
server 127.127.1.0

# local clock
fudge
127.127.1.0 stratum 10



# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
On the server, enter:
chkconfig ntpd on
service ntpd on
Then, set the date correctly on the server (date MMDDhhmm).

On the client,
ensure that there is the following line in the /etc/hosts file:
127.0.0.1 localhost


Edit the /etc/ntp.conf file to look like this, assuming that the local NTP server we just set up is named barney with an IP address of 10.8.0.1:


# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1

driftfile /var/lib/ntp/drift

# Hosts on local network are less restricted.
restrict barney mask 255.255.255.0 nomodify notrap
server barney

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

On the client, enter:
chkconfig ntpd on
service ntpd on
If there is a large difference in times, you can quickly bring the client into close sync with the time server by typing:
ntpdate barney
You can see if the client is being updated by using the command:
watch ntpq -p


Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home