User Tools

Site Tools


networking:linux:linux_time

This is an old revision of the document!


Linux Timekeeping

ntpdate pool.ntp.org

ntpq -p

ntptrace pool.ntp.org

ntpstat

cat /var/log/daemon.log|grep ntp

zcat /var/log/daemon.log.1.gz |grep ntp

SME Server

Already functions as NTP server.

cat /var/log/ntpd/current |tai64nlocal

Server Preference

Setting a local time server may noticeably speed up boot times.

Edit /etc/ntp.conf and add a line for your preferred server:

vi /etc/ntp.conf


server 192.168.2.1 prefer

If the initscripts run ntpdate, you can replace /etc/ntp/step-tickers:

sudo cp -a /etc/ntp/step-tickers /etc/ntp/step-tickers.orig

sudo vim /etc/ntp/step-tickers

192.168.2.1

NTP Servers

0.us.pool.ntp.org 1.us.pool.ntp.org 2.us.pool.ntp.org 3.us.pool.ntp.org

Local Network Server

Edit the config file, uncomment and modify:

vim /etc/ntp.conf 

# Hosts on local network are less restricted.
restrict 192.168.2.0 mask 255.255.255.0 nomodify notrap
broadcast 192.168.2.255

sudo service ntpd restart

Firewall

Open UDP port 123 on the firewall:

http://www.ghidinelli.com/2008/09/25/iptables-firewall-rules-for-ntpd-time-synchronization

/sbin/iptables -A INPUT -p udp -s 192.168.30.0/24 --dport 123 -j ACCEPT
/sbin/iptables -A OUTPUT -p udp --sport 123 -j ACCEPT

service iptables save

or:

system-config-securitylevel-tui

123:udp

netstat -uapn|grep 123
networking/linux/linux_time.1328289325.txt.gz · Last modified: 2012/02/17 08:40 (external edit)