HOWTO Setup NTPD

From Research
Jump to navigation Jump to search

Setup the ntpd.conf File

Edit /etc/ntpd.conf (suse) or /etc/ntp.conf (gentoo) to look like this:

restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 209.87.56.0 mask 255.255.255.0
restrict 209.87.57.30
server 209.87.57.30
restrict 142.58.103.1
server 142.58.103.1
driftfile /etc/ntp.drift
logfile /var/log/ntp.log

Installation

Gentoo

# emerge ntp -va
# rc-update add ntpd default
# /etc/init.d/ntpd start

DO NOT rc-update add ntp-client default don't do it!!!??

Suse

# chkconfig xntpd on
# /etc/init.d/xntpd start

For Firewall users

Add the following rule to iptables:

-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT

Check everything is running properly

# ntpdc

Then type in 'peers' to see if the ntpd can contact the ntp server correctly, and then type 'quit' to exit.

Locked Down ntpd.conf

If you are paranoid, use:

restrict default ignore
restrict 127.0.0.1
restrict 209.87.57.30
server 209.87.57.30
restrict 209.87.56.234
server 209.87.56.234
driftfile /etc/ntp.drift
logfile /var/log/ntp.log