18.8 An Unlikely Server: A Local Clock Impersonator

     

This last server configuration is a useful and simple configuration to implement. It's useful when we can't use an external clock source or we don't have Internet access to use an external timeserver. It's simple because we can use the same configuration files to set up a time source that is, in fact, the clock of our own server. We should note that this server is now going to act as a timeserver. The fact that we are using the internal clock of a server should also be noted. If you remember back to our discussions regarding time, an individual server's internal clock is less than accurate. For a significant number of installations, this is not necessarily a concern. As long as all the machines in our network are recording the same time, this can be a significant and worthwhile configuration to enable; just be sure that you can accept the inaccuracies of an internal clock before proceeding. So, it's on to the configuration. Because our computer is a server, we need to set up the /etc/ntp.conf file to point to a time source. The time source we use is a Class-A IP address that looks like an address of an external clock. The key is in the driver we use. If you remember back to our discussions of using a radio/GPS receiver, the third octet of the Class-A IP address indicated the driver used by the xntpd daemon to communicate with the external clock. In this instance, the Class-A address used is 127.127.1.1 ; hence, the driver number is 1. If you look at the man page for xntpd , you will see that this driver number relates to a local clock . This is the idea behind the term local clock impersonator ; we are impersonating an external clock source by using our internal server clock. This sounds like a long-winded way of saying, "I simply use an entry in /etc/ntp.conf = server 127.127.1.1 ". The answer is simply yes ! Here's the entry I will use in /etc/ntp.conf on server hpeos002 .

 

 root@hpeos002[] #  vi /etc/ntp.conf  ... server 127.127.1.1 fudge 127.127.1.1 stratum 10 

The additional entry to not is the fudge directive. A fudge will change particular attributes of a clock source. In this case we are fudge 'ing the stratum level of this server. This is technically not required but it is considered good NTP etiquette to correctly advertise your stratum level based on the accuracy of you clock source. The rest of the configuration is the same as for a server with a real external clock; we don't use ntpdate as we are synchronizing with ourselves , not an external source. Here's the /etc/rc.config.d/netdaemons file for the same machine.

 

 export NTPDATE_SERVER="" export XNTPD=1 export XNTPD_ARGS= 

Once configured, we can start the daemon as before:

 

 root@hpeos002[] #  /sbin/init.d/xntpd start  xntpd  root@hpeos002[] # root@hpeos002[] # 

We then wait for the requisite 5 minutes for the daemon to calibrate itself and then we are ready to service time requests . As we can see from this output from ntpq “p we are now ready to act as a server; we can also review the output found in syslog .

 

 root@hpeos002[] #  ntpq -p  remote          refid      st t when poll reach   delay   offset    disp ============================================================================= *LOCAL(1)       LOCAL(1)        10 l    9   64   37     0.00    0.000  885.01 root@hpeos002[] # root@hpeos002[] #  tail  -1 /var/adm/syslog/syslog.log  Aug 28 14:59:37 hpeos002 xntpd[4060]: synchronized to LOCAL(1), stratum=10 root@hpeos002[] # 

Let's move on to looking at configuring purely NTP clients . We will set up a polling client (polling specific servers) as well as a broadcast client (listening to any NTP packets broadcast on the network).



HP-UX CSE(c) Official Study Guide and Desk Reference
HP-UX CSE(c) Official Study Guide and Desk Reference
ISBN: N/A
EAN: N/A
Year: 2006
Pages: 434

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net