Setting Up NTP Clients

You configure most of the computers on your network in much the same way you configure your main NTP server. The main difference is that you specify just one system using a single server line: your network's main NTP server. When you use ntpq to verify the server's operation, it should display a summary that points to your network's main NTP server. If it doesn't, it could be that your main NTP server's NTP port (123) is blocked by a firewall, or the server may be misbehaving.

If you prefer not to expose most of your clients by running NTP servers on them, you can protect their NTP ports with firewall rules, as described in Chapter 20, "Controlling Network Access." Another option is to run ntpdate in a cron job instead of running the full server. This latter option may result in some clock drift between calls, but on most systems this drift will be minor. The NTP developers are discouraging use of ntpdate, though, and it may eventually disappear. (In Debian, it's in a separate package from the main NTP server.) To use ntpdate, call the program along with the hostname or IP address of your network's main NTP server:

# ntpdate bigben.threeroomco.com

NTP clients and servers are available for many OSs. Therefore, you can use a Linux NTP server to coordinate the time for just about any OS on your network. Try a web search to locate clients for more obscure OSs. Many OSs include NTP clients by default. For instance, in Wndows NT or 2000, you can type NET TIME /SETSNTP:nip.se/verin a DOS prompt window, where ntp.server is your NTP server system.

If you have Windows 9x/Me clients and run a Samba server, you can use a time protocol that's part of SMB/CIFS. Include the following line in the [global] section of the Samba configuration file (/etc/samba/smb.conf on most systems):

time server = Yes

You can then type NET TIME WSERVER /SET /YES in a DOS prompt window to set the clock on the Windows client to match the clock on the Samba server called SERVER. The Samba server need not be your domain's main NTP server, but if you want all your systems' clocks synchronized to an outside source, the Samba server should run an NTP server. The SMB/CIFS time protocol doesn't provide the precision or accuracy of NTP, but it's good enough for most purposes when setting Windows clients.

Tip Try creating a DOS/Windows batch file (one whose name ends in .BAT) that calls NET TIME in either of the ways just described, and then copy the batch file to the Windows Startup folder. Doing so will cause the Windows system to synchronize its clock whenever it boots, which for most Windows systems is frequently enough to keep their clocks set to within a few seconds of the veridical time, even if the clock drifts badly.

Team LiB

0 0

Post a comment