305 lines
13 KiB
HTML
305 lines
13 KiB
HTML
<!--startcut ==============================================-->
|
|
<!-- *** BEGIN HTML header *** -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML><HEAD>
|
|
<title>DHCP for the Home Network LG #48</title>
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
|
|
ALINK="#FF0000">
|
|
<!-- *** END HTML header *** -->
|
|
|
|
<!-- *** BEGIN navbar *** -->
|
|
<A HREF="index.html"><IMG ALT="[ Table of Contents ]"
|
|
SRC="../gx/indexnew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom ></A>
|
|
<A HREF="../index.html"><IMG ALT="[ Front Page ]"
|
|
SRC="../gx/homenew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
|
|
<A HREF="lane.html"><IMG ALT="[ Prev ]" SRC="../gx/back2.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom></A>
|
|
<A HREF="../faq/index.html"><IMG ALT="[ Linux Gazette FAQ ]"
|
|
SRC="./../gx/dennis/faq.gif"WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
|
|
<A HREF="lg_backpage48.html"><IMG ALT="[ Next ]" SRC="../gx/fwd.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom ></A>
|
|
<!-- *** END navbar *** -->
|
|
|
|
<!--endcut ============================================================-->
|
|
|
|
<H4>
|
|
"Linux Gazette...<I>making Linux just a little more fun!</I>"
|
|
</H4>
|
|
|
|
<P> <HR> <P>
|
|
<!--===================================================================-->
|
|
|
|
<center>
|
|
<H1><font color="maroon">DHCP for the Home Network</font></H1>
|
|
<H4>By <a href="mailto:jpollman@bigfoot.com">JC Pollman</a> and <a href="mailto:bill.mote@bigfoot.com">Bill Mote</a></H4>
|
|
</center>
|
|
<P> <HR> <P>
|
|
|
|
<!-- END header -->
|
|
|
|
|
|
|
|
|
|
|
|
<p>Tired of lugging that laptop from the office to home only to find that
|
|
once you get there you have to boot your M$ operating system, change your
|
|
network settings to work with your home network, and then ... ah-hem REBOOT?!
|
|
I was! [Enter DHCP from stage left.]<font color="#000000">
|
|
If </font>your <font color="#000000">office and home environments are configured
|
|
correctly, DHCP is a</font>bout to be your new best friend!
|
|
<p><b>Disclaimer: </b>This article provides information we have gleamed
|
|
from reading the books, the HOWTOs, man pages, usenet news groups, and
|
|
countless hours banging on the keyboard. It is not meant to be an all inclusive
|
|
exhaustive study on the topic, but rather, a stepping stone from the novice
|
|
to the intermediate user. All the examples are taken directly from
|
|
our home networks so we know they work.
|
|
<p><b>How to use this guide:</b>
|
|
<ul>
|
|
<li>
|
|
Words encapsulated by square brackets like [Enter] indicate the depression
|
|
of a key on the keyboard or a mouse button [Mouse1]</li>
|
|
|
|
<li>
|
|
Words encapsulated by squiggly brackets like {your name here} indicate
|
|
data that will/should be substituted with "real" data</li>
|
|
|
|
<li>
|
|
Text depicted in italics are commands you, the user, should type at a prompt</li>
|
|
</ul>
|
|
<b>Prerequisites:</b> This guide assumes that you have at least DHCP 2.0
|
|
installed and that your local IP network is setup and functioning.
|
|
<p><b>DHCP@Home, why? </b>Convenience. I was fed up with changing
|
|
network configurations when I came home and then subsequently went back
|
|
to the office. It was completely unacceptable to add a bolt-on utility
|
|
to manage these settings for me. Then one day it hit me. We
|
|
use DHCP at work. Why shouldn't I use it at home! It'll give
|
|
me an IP address on the local network, the necessary DNS information, and
|
|
the correct gateway.
|
|
<p><b>DHCP@Work, why?</b> This one is a little easier to justify
|
|
than simply being inconvenienced. I worked at a facility with ~600
|
|
workstations. On the 1st day with the company I had to setup my own
|
|
machine and get it on the network. It took nearly 30-minutes for
|
|
an ill-equiped network administrator, I'll leave his name out of this article
|
|
since he's still providing network services for a local company, to find
|
|
an empty IP address that I could statically assign to my system.
|
|
He had paper print outs of 3-complete Class-C networks (192.168.[1-3].[1-254]).
|
|
It doesn't take higher math to figure out that there's over 750 addresses
|
|
available. 255 of which were on the network segment I was on.
|
|
<p>His process:
|
|
<blockquote>1. Find an open slot on the printed copy
|
|
<br>2. Verify it was open in his electronic copy
|
|
<br>3. Ping the address to verify no one was on it
|
|
<br>4. Give it to me, write it on the paper and enter it electronically</blockquote>
|
|
That was Friday. Monday morning I had an IP Conflict. Real
|
|
accurate system. All I knew about DHCP was that I had to select it
|
|
to get an IP address from my ISP at home. I had no idea how it worked
|
|
nor if we could use it to fix this `problem'. I joined forces with
|
|
a different network services group in the company, they educated me, and
|
|
we did a full frontal assault on every machine. DHCP is running to
|
|
this day ...
|
|
<p><b>IP Numbering Schemes: </b>If you've decided to run DHCP at
|
|
home then be smart about it. Figure out a numbering scheme and stick
|
|
with it. You'll know exactly what's on your network just by seeing
|
|
the IP address. This advice holds more weight in the corporate world
|
|
where you're likely to be hosting more machines. Anyway, this is
|
|
what I use at home and it closely resembles work as well:
|
|
<p><tt><u>IP Address Range Hosts</u></tt>
|
|
<p><tt><font color="#3333FF">* Important machines and network equipment
|
|
*</font></tt>
|
|
<p><tt> .001
|
|
Your router (if present)</tt>
|
|
<br><tt> .002 - .009 Network
|
|
equipment (switches and hubs)</tt>
|
|
<br><tt> .010 - .075 Servers</tt>
|
|
<br><tt> .076 - .099 Network
|
|
Printers</tt>
|
|
<p><tt><font color="#3333FF">* User workstations *</font></tt>
|
|
<p><tt> .100 - .254 DHCP
|
|
range</tt>
|
|
<br>
|
|
<p>Sticking with a scheme like the one above will make visual scans of
|
|
your logs much easier since you'll likely notice an oddball IP address
|
|
doing something it's not supposed to or not capable of, i.e., a printer
|
|
trying to telnet into your machine? Not likely ... and a good indicator
|
|
that you didn't read last month's article on security!
|
|
<p><b>Are you ready?</b> Type the following command at a shell prompt:
|
|
<br>
|
|
<blockquote><i>whereis dhcpd[Enter]</i></blockquote>
|
|
You should see output similar to the following line. If not, then
|
|
you still need to install DHCP. Get to it and come back here:
|
|
<blockquote>dhcpd: /usr/sbin/dhcpd /etc/dhcpd.conf /etc/dhcpd.leases
|
|
/etc/dhcpd.leases~</blockquote>
|
|
|
|
<p><br><b>/etc/dhcpd.conf:</b> This is where we start. This file
|
|
is the key to it all and it's extremely simple in design. Here's
|
|
what mine looks like:
|
|
<br>
|
|
<center><table BORDER COLS=1 WIDTH="50%" BGCOLOR="#FFFFFF" NOSAVE >
|
|
<tr NOSAVE>
|
|
<td BGCOLOR="#3366FF" NOSAVE>
|
|
<h1>
|
|
<b><font color="#FFFFFF">/etc/dhcpd.conf</font></b></h1>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr NOSAVE>
|
|
<td BGCOLOR="#3366FF" NOSAVE>September 18, 1999</td>
|
|
</tr>
|
|
|
|
<tr NOSAVE>
|
|
<td BGCOLOR="#3366FF" NOSAVE>Author: Bill Mote</td>
|
|
</tr>
|
|
|
|
<tr NOSAVE>
|
|
<td ROWSPAN="2" NOSAVE>default-lease-time 36000;
|
|
<br>max-lease-time 7200;
|
|
<br>option subnet-mask 255.255.255.0;
|
|
<br>option broadcast-address 192.168.1.255;
|
|
<br>option routers 192.168.1.10;
|
|
<br>option domain-name-servers 192.168.1.10;
|
|
<br>option domain-name "mynetwork.cxm";
|
|
<p>subnet 192.168.1.0 netmask 255.255.255.0 {
|
|
<br> range 192.168.1.100 192.168.1.254;
|
|
<br>} </td>
|
|
</tr>
|
|
</table></center>
|
|
|
|
<p><b>/etc/dhcpd.leases: </b>We now need to give the dhcp server somewhere
|
|
to start. We do so by creating an empty leases file. Type the
|
|
following command at a shell prompt:
|
|
<blockquote><i>touch /etc/dhcpd.leases[Enter]</i></blockquote>
|
|
Below is a `live' dhcpd.leases file from my system. Please note that
|
|
your file will be empty until a DHCP client successfully obtains an IP
|
|
address from your server.
|
|
<br>
|
|
<br>
|
|
<center><table BORDER COLS=1 WIDTH="50%" NOSAVE >
|
|
<tr NOSAVE>
|
|
<td BGCOLOR="#3366FF" NOSAVE>
|
|
<h1>
|
|
<font color="#FFFFFF">/etc/dhcpd.leases</font></h1>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr NOSAVE>
|
|
<td BGCOLOR="#3366FF" NOSAVE>September 18, 1999</td>
|
|
</tr>
|
|
|
|
<tr NOSAVE>
|
|
<td BGCOLOR="#3366FF" NOSAVE>Author: {auto generated by dhcpd}</td>
|
|
</tr>
|
|
|
|
<tr NOSAVE>
|
|
<td BGCOLOR="#FFFFFF" NOSAVE>lease 192.168.1.100 {
|
|
<br> starts 6 1999/09/18 17:27:36;
|
|
<br> ends 6 1999/09/18 17:37:36;
|
|
<br> hardware ethernet 00:60:08:e3:60:03;
|
|
<br> uid 01:00:60:08:e3:60:03;
|
|
<br> client-hostname "NoFear";
|
|
<br>}</td>
|
|
</tr>
|
|
</table></center>
|
|
|
|
<p><b>Let's go already! </b>It's what you've been waiting for.
|
|
Time to startup the dhcp server and get a client running. Type the
|
|
following command at a shell prompt:
|
|
<blockquote><i>/usr/sbin/dhcpd[Enter]</i></blockquote>
|
|
That's it for the server side. Now onto client configuration.
|
|
<p><b>M$ client: </b> For the purposes of this article I'm going to
|
|
assume that you've got mostly M$ machines connected to a linux server.
|
|
<p>The Microsoft client is actually very easy to configure. Follow
|
|
these mouse clicks:
|
|
<br>
|
|
<blockquote><i>Start -> Settings -> Control Panel -> Network</i></blockquote>
|
|
Find the `TCP/IP protocol for your network adapter'. Highlight it
|
|
get to the properties window by pressing [Mouse1] on the `Properties' button.
|
|
Since pictures are better than words I'll use the following 3 pictures
|
|
to illustrate how your TCP/IP settings should be configured:
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<center>
|
|
<p><img SRC="gx/pollman/ip_address.gif" HSPACE=3 VSPACE=3 height=441 width=356>
|
|
<br><img SRC="gx/pollman/gateway.gif" HSPACE=3 VSPACE=3 height=441 width=356>
|
|
<br><img SRC="gx/pollman/dns.gif" HSPACE=3 VSPACE=3 height=441 width=356></center>
|
|
|
|
<p><br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<p>After a quick M$ reboot you should be golden! For more info on
|
|
DHCP see the <font color="#FF6666"><a href="http://www.linuxhq.com/HOWTO/mini/DHCP.html">DHCP-minihow-to</a></font>.
|
|
Notice in the opening sentence of this paragraph the word, "should".
|
|
Well, here's what I've found.
|
|
<br>
|
|
<blockquote>DHCP and Win98 SE (second edition) -- [Bill steps onto his
|
|
soap box] Nothing like a little competition to spark the boys in Redmond,
|
|
eh? The impression was the *everyone* was setting up Linux boxes
|
|
to share their internet connections at home. Microsoft responds in
|
|
short order with Internet Connection Sharing included in Win98 SE.
|
|
Quite frankly, I loved it. I used it to get our church computers
|
|
running from a single dial connection and it's working great.
|
|
<p>However, Win98 SE's ICS seems to be doing something a little off the
|
|
wall when it comes to DHCP. My Win98 SE machine at home assigns an
|
|
IP address to my NIC if it can't find a DHCP server. In the old days
|
|
Win9x would use it's last known IP address as long as the lease hadn't
|
|
expired ... not any more.
|
|
<p>If you have problems getting your Win98 SE box to get an IP address
|
|
then you may want to assign it a permanent address. What about the
|
|
numbering scheme you ask? You `could' set a small range aside at
|
|
the bottom or top of the range, but still above our default .100 (like
|
|
.100 - .105).
|
|
<p>If you still want the box to have an IP address assigned by DHCP then
|
|
you can do the following:
|
|
<blockquote>
|
|
<ul>
|
|
<li>
|
|
Give the Win98 SE box an IP address on your network. Don't worry
|
|
it'll just be temporary.</li>
|
|
|
|
<li>
|
|
Wait a couple of days (haven't narrowed the time down yet)</li>
|
|
|
|
<li>
|
|
Set the machine back to DHCP</li>
|
|
</ul>
|
|
</blockquote>
|
|
Ridiculous? Yes. I just haven't looked for a way to permanently
|
|
fix the problem. There's probably some undocumented Win9x registry
|
|
tweak ... If anyone knows send it to my e-mail address below please!</blockquote>
|
|
|
|
<br>Next month we will be discussing Linux Client Side DHCP.
|
|
|
|
<p><br>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|
|
|
|
<!-- *** BEGIN copyright *** -->
|
|
<P> <hr> <P>
|
|
<H5 ALIGN=center>
|
|
|
|
Copyright © 1999, JC Pollman, Bill Mote<BR>
|
|
Published in Issue 48 of <i>Linux Gazette</i>, December 1999</H5>
|
|
<!-- *** END copyright *** -->
|
|
|
|
<!--startcut ==========================================================-->
|
|
<P> <HR> <P>
|
|
<!-- *** BEGIN navbar *** -->
|
|
<A HREF="index.html"><IMG ALT="[ Table of Contents ]"
|
|
SRC="../gx/indexnew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom ></A>
|
|
<A HREF="../index.html"><IMG ALT="[ Front Page ]"
|
|
SRC="../gx/homenew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
|
|
<A HREF="lane.html"><IMG ALT="[ Prev ]" SRC="../gx/back2.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom></A>
|
|
<A HREF="../faq/index.html"><IMG ALT="[ Linux Gazette FAQ ]"
|
|
SRC="./../gx/dennis/faq.gif"WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
|
|
<A HREF="lg_backpage48.html"><IMG ALT="[ Next ]" SRC="../gx/fwd.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom ></A>
|
|
<!-- *** END navbar *** -->
|
|
</BODY></HTML>
|
|
<!--endcut ============================================================-->
|