[olug] DHCP questions

Christopher Cashell topher at zyp.org
Wed Aug 21 23:27:03 UTC 2002


At Wed, 21 Aug 02, Unidentified Flying Banana Don E. Kauffman, said:
> I recently got DHCP on my Qwest Choice Online.  i have the linux box (RH 7.2) 
> up and running after some confusion. I need some advice or good how ti's on 
> setting up my Win 98 box to work similarly to what it was  

It should be doable.

> Previously I had the two boxes  networked w/ private/ public static P's 
> Linux having the public and Wind 98 the private. Since I've had DHCP this 
> doesn't work.  So how do I do this now? I'd be interested in several pieces 
> of info.  

It should be essentially the exact same setup.  The only difference is
that the IP address isn't known ahead of time, so your networking
scripts have to account for the fact that they won't find the IP until
DHCP get sit.

> 1. Setting M$ 98 box up with a private static IP address networked with Linux 
> Dynamic IP.

I assume you're using two network cards in the Linux box, correct?  One
with a static internal IP, and one with an external IP from DHCP?  If
not, you'll need to setup IP Aliasing (and running both over the same
cable isn't the most efficient thing in the world. . . and introduces
other problems which aren't fun to deal with (i.e. You'd be much better
off with two NIC's). ;-)

> 2. I'm using IPtables  / Netfilter so I need to know what I use for SNAT 
> postrouting. Here's the line i used for the static IP below.  
> 
> iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 10.190.6.223
> 
> I found some advice that seemed to suggest I replace this with the line 
> below.
> 
> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 
>
> and leave off the --to <static IP> That didn't seem to work either, 

Assuming everything else is setup correctly, this *should* work.  (This
is essentially what I'm currently using.)  I'd suggest consulting the IP
Masquerading howto[1] for further information, as well as the IP
Masquerading-Simple howto[2] (which is meant to complement the other
howto, not replace it).

The IP Masquerading howto includes a great introduction to setting up IP
Masquerading, both on the routing box, and any client machines that will
be utilizing it.

> 3.  How would I go about setting up DHCP on my internal network? There's 
> probably a couple of good how tors on this  so if anyone knows of any they 
> can recommend it. 

You're correct, The Linux Documentation Project has a (slightly dated)
how to[3] on setting up DHCP, both server and client.

> A. Would there be any advantages / disadvantages  to setting up this way? 

The biggest advantage to setting up your own internal DHCP server is
that you can use it to "push" network setup information to the client
machines.  Thus, all of your IP and networking setup will be centralized
on a single machine.  Additionally, you can use it to easily add
additional computers to the network (assuming you're using a hub).  I
use an internal DHCP server so I can plug my laptop into my network and
instantly have Internet access through my IP Masquerading gateway.

> B. Do i need different equipment or will this work with a crossover cable?

First, let me make sure I understand your current setup. ;-)

You have two computers, one running Linux, one running Windows.  The
Linux box has two network cards, one connected to the cable modem, and
the second connected via a crossover cable to a network card in the
Windows machine.

Is that correct?

If so, then yes, you should be able to get it working with that setup.

However, I would urge you to consider purchasing a hub at some point, as
it can simplify things in the future.  Especially if you ever decide to
connect additional computers to your network and utilize the same
Internet connection.  Without a hub, you'd have to manually move the
crossover cable to whichever computer you want to be able to access the
Internet, while with a hub, you can simply plug more in. Also,  hubs
have dropped to /very/ reasonable prices these days.  Depending on how
many computers you have, or are considering getting, a switch might even
be worth while.

> Thanks In advance! 

Hope this helps, particularly the IP Masquerading Howto, which is one of
the best resources I've found.

[1]  http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/index.html
[2]  http://www.tldp.org/HOWTO/Masquerading-Simple-HOWTO/index.html
[3]  http://www.tldp.org/HOWTO/mini/DHCP/index.html

> Don Kauffman

--
Christopher




More information about the OLUG mailing list