Friday, September 3, 2010

Network Administrator common mistakes Part 1, NTP


Ethernet Standalone DCF77/GPS TimeServer - ipNTP
Common thing that net-admin sometimes forget is install and configure ntp at all their machine. This lead wrong time information at log message, mess in file system, or even can corrupt your filesystem.
Let me tell you how to install and configure ntp at your machine.

At ubuntu, you must install ntpdate package or ntp package, then edit /etc/default/ntpdate for set time server you want to use. In example you can use 0.pool.ntp.org.

At OpenBSD, you can enable ntp by editing /etc/rc.conf.local and put these line

ntpd_flags=""
to enable openntpd daemon. Please note that if the BIOS time is off more that couple minute, it's get a day or even a week to synchronize with the ntp server. This problem because the system never force clock to new time at once, but they drifting time little by little, to avoid trouble to some time-sensitive software (in example dovecot or mysqld). Surely if you want to force time to synchronized at once, you can use -s option. Oh yeah, almost forgot, you can edit the configuration file at /etc/ntpd.conf and adjusting the server or servers to 0.pool.ntp.org.

At mikrotik, it's even simpler. You just type this:
/system ntp client set enabled=yes mode=unicast primary-ntp=0.pool.ntp.org
at the console and voila, the time will synchronized.
Tips:
you can adjust 0.pool.ntp.org with another time server that near with your region.