old-www/LDP/LG/issue39/jenkins8.html

362 lines
15 KiB
HTML

<!--startcut ==========================================================-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="StarOffice/5.0 (Unix)">
<META NAME="AUTHOR" CONTENT="Ron Jenkins">
<META NAME="CREATED" CONTENT="19990327;17313200">
<META NAME="CHANGEDBY" CONTENT="Ron Jenkins">
<META NAME="CHANGED" CONTENT="19990330;21493100">
<STYLE>
<!--
@page { size: 21.59cm 27.94cm; margin-left: 3.18cm; margin-right: 3.18cm; margin-top: 2.54cm; margin-bottom: 2.54cm }
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!--endcut ============================================================-->
<H4>
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <HR> <P>
<!--===================================================================-->
<P ALIGN=CENTER STYLE="margin-bottom: 0.00cm"><FONT SIZE=4><B>Linux
Primer Series Part 8</B></FONT></P>
<P ALIGN=CENTER STYLE="margin-bottom: 0.00cm"><FONT SIZE=4><B>Advanced
Network Services version 03.30.1999</B></FONT></P>
<P STYLE="margin-bottom: 0.00cm; font-weight: medium"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm; font-weight: medium"><FONT SIZE=3>Copyright
&copy;1998, 1999 Ron Jenkins. All rights reserved.</FONT></P>
<P STYLE="margin-bottom: 0.00cm; font-weight: medium"><FONT SIZE=3>I
welcome your suggestions, corrections, criticisms, and comments. I
may be reached at the following address - <A HREF="mailto:rjenkins62@netscape.net">rjenkins62@netscape.net</A>
.</FONT></P>
<P STYLE="margin-bottom: 0.00cm; font-weight: medium"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm; font-weight: medium"><FONT SIZE=3>This
work is provided on an &quot;as is&quot; basis. The author provides
no warranty whatsoever, either express or implied, regarding the
work, including warranties with respect to its merchantability or
fitness for any particular purpose.</FONT></P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">You may have noticed that my e mail
address has changed again. My ISP has decided to move to metered
access, just as my last one did. This seems to be a growing trend,
at least here in the Midwest.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">To eliminate the need for constantly
changing this stuff, I have acquired an account @ Netscape, which
will remain constant, regardless of ISP changes.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">As soon as I can afford it, or can
find a place to house my webpages, I will post it here.
Unfortunately, I will be unable to have the updates and enhancements
to my column on-line until then.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Before I get a flood of &quot;Get a
Geocities page&quot; messages, let me just say that I have
requirements that Geocities is unwilling to supply.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">The qni.com address will still be
functional for a couple of months, to make the transition as smooth
as possible.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Operating Systems
Covered/Supported: </B>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Slackware version 3.6 </B>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>RedHat version 5.1 </B>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Windows NT Server version 4.0 </B>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Windows NT Workstation version
4.0 </B>
</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>I only test my columns on the
operating systems specified. I don't have access to a MAC, I don't
use Windows 95, and have no plans to use Windows 98.</B></P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>If someone would care to provide
equivalent instructions for any of the above operating systems, I
will be happy to include them in my documents. </B>
</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Advanced Network Services:</B></P>
<P STYLE="margin-bottom: 0.00cm">This month, we will be examining
some advanced services that you may or may not want to use on your
home network.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">In particular, we will be looking at
some options for streamlining the connection scripts, executing
demand dialing, and time synchronization issues.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">In this month's column, we will be
looking at the following areas of interest:</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Customization options for the
connect scripts</P>
<P STYLE="margin-bottom: 0.00cm">Time Synchronization</P>
<P STYLE="margin-bottom: 0.00cm">Demand Dialing</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">As always, I will include ant
distribution specific information as necessary. Unless indicated
otherwise, the information will apply equally to both distributions.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Customization options for the
connect scripts:</B></P>
<P STYLE="margin-bottom: 0.00cm">I can't stress enough the importance
of assuring that your PPP software is version 2.3 or above. It is
the added functionality that this software contains that make the
following things possible.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">With version 2.3 or greater, here
are some of the things we can do right from the script, rather than
having to run ancillary programs to accomplish similar functions.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Auto-reconnect - This option is
enabled using the keyword &quot;persist&quot; in the connect script.
This eliminates the need for the pppupd software we have been using.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Demand Dialing - This option is
enabled using the keyword &quot;demand&quot; in the connect script.
This eliminates the need for a third party program, such as diald.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Therefore, a new revised script
taking advantage of these options would look something like this:</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Begin connect script example -</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">#!/bin/sh</P>
<P STYLE="margin-bottom: 0.00cm">pppd connect \</P>
<P STYLE="margin-bottom: 0.00cm">'chat -v -f /path/to/chat/script'
/dev/cua1 115200 -detach crtscts modem \</P>
<P STYLE="margin-bottom: 0.00cm">-proxyarp defaultroute demand
persist &amp;</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">End connect script example -</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Note that no changes are required to
your chat script, as this just handles the initial terminal login,
then hands off to the PPP daemon.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Also, if your ISP's interpretation
of the phrase &quot;Unlimited Usage&quot; is like mine, you will be
limited to 10 to 12 hours per day. I would strongly suggest that if
this is the case, then consider moving to another ISP.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">If you choose to stay, the demand
dialing function will be required, unless you want to connect
manually each time, or if you have a regular period of time during
which you use the Internet, you may want to write a cron job to take
care of connecting and disconnecting.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">For instance, say you connect from
8:00 a.m. To 8:00 p.m. every day, and wish to automate the procedure.
You would simply open your crontab file with the command &quot;crontab
-e&quot; and enter the following two lines:</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">0 8 * *
* /path/to/your/connect/script</P>
<P STYLE="margin-bottom: 0.00cm">0 20 * *
* /path/to/your/ppp-off/script</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">or staying with our examples we have
been using:</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">0 8 * * * /sbin/unicom</P>
<P STYLE="margin-bottom: 0.00cm">0 20 * * * /usr/sbin/ppp-off</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Time Synchronization:</B></P>
<P STYLE="margin-bottom: 0.00cm">Although we don't often think about
it, time is very important to the proper operation of computers and
programs.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Y2K issues aside, many services on
your network or individual systems depend on an accurate measurement
of time.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">UNIX and Linux in particular are
very picky about time discrepancies, and tend to do nasty things to
your processes and data if two machines disagree about the time.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Briefly, there are two methods of
acquiring an accurate measurement of time:</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">From an internal device (such as
your CMOS clock,) or from an external source, such as a time server
or frequency standard.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">This will be old hat to those of you
who come from an amateur radio background, but the government has
just such a source available, and several different options for
availing yourself of its use.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Your internal CMOS clock is
unreliable, and dependent upon a constant power source. So in this
area we will concentrate on synchronizing our machines, and our
network to an external source.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">The &quot;absolute standard&quot;
for time is an atomic clock housed at the National Institutes of
Standards and Technology (NIST) in Fort Collins, Colorado.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">There are many ways to use this
standard to synchronize your network, ranging from Radio Frequency
receivers to modem dial up connections, to Global Positioning
Satellites (GPS.)</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Here we will concentrate on using
the Internet to accomplish this synchronization.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">The de facto standard for this
purpose is something called the Network Time Protocol, or NTP. Some
systems, particularly RedHat based systems, often come with ntp or
xntp pre-installed. Check the documentation and man pages for more
information.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">If you are using a Slackware based
machine, you will have a utility called netdate that will serve the
same function. You can initiate netdate manually, trough a script,
or from a cron job. Check the man page for more details.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Either system will require you to
specify one or more time servers from which accurate data can be
obtained.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Time Servers are machines that
collect and dispense accurate time data. They are organized in to
&quot;stratums&quot; with the lower numbers being the more accurate.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Stratum one servers are usually
servers that have some sort of direct logical connection to the
atomic clock, either by radio satellite or modem, and an accurate
external device to make this connection.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Stratum two servers acquire data
from the stratum one machines, and pass it along to other stratum two
machines, or peers, and down to stratum three machines, and so on.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">For most home applications, and
business applications that do not require a &quot;real time clock,&quot;
stratum two servers are more than adequate for your needs.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">For a list of time servers, as well
as the ntp software, see the resources section.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Demand Dialing:</B></P>
<P STYLE="margin-bottom: 0.00cm">If you have followed the above
instructions, then this should be a moot point. If you cannot or
will not upgrade your PPP software to 2.3 or above, you will need to
use diald or something similar to initiate the demand dialing
function.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">Configuration of diald or one of the
other programs is beyond the scope of this document. Check your
preferred program documentation and man pages for more information.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm">If enough people express interest, I
will devote a column specifically to this subject in the future.</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Next month, we will conquer Print
Services. See 'ya then!</B></P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>References:</B></P>
<P STYLE="margin-bottom: 0.00cm">PPP HOW-TO</P>
<P STYLE="margin-bottom: 0.00cm">pppd man pages</P>
<P STYLE="margin-bottom: 0.00cm">netdate man pages</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P STYLE="margin-bottom: 0.00cm"><B>Resources:</B></P>
<P STYLE="margin-bottom: 0.00cm">http://www.nist.gov/</P>
<P STYLE="margin-bottom: 0.00cm"><BR>
</P>
<P> <HR> <P>
<center><H4>Previous ``Linux Primer'' Columns</H4></center>
<p>
<A HREF="../issue32/jenkins1.html">Linux Primer #1, September 1998</A><BR>
<A HREF="../issue33/jenkins2.html">Linux Primer #2, October 1998</A><BR>
<A HREF="../issue34/jenkins3.html">Linux Primer #3, November 1998</A><BR>
<A HREF="../issue35/jenkins4.html">Linux Primer #4, December 1998</A><BR>
<A HREF="../issue36/jenkins5.html">Linux Primer #5, January 1999</A><BR>
<A HREF="../issue37/jenkins6.html">Linux Primer #6, February 1999</A><BR>
<A HREF="../issue38/jenkins7.html">Linux Primer #7, March 1999</A><BR>
<!--===================================================================-->
<P> <hr> <P>
<center><H5>Copyright &copy; 1999, Ron Jenkins <BR>
Published in Issue 39 of <i>Linux Gazette</i>, April 1999</H5></center>
<!--===================================================================-->
<P> <hr> <P>
<A HREF="./index.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif"
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../index.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./woods.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./richardson.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P>
<!--startcut ==========================================================-->
</BODY>
</HTML>
<!--endcut ============================================================-->