Re: [SLUG] DHCP or BIND - Wally can do it too!

From: Josh Tiner (josh.tiner@worldwidephp.com)
Date: Thu Feb 14 2002 - 00:49:30 EST


Paul,

Hi! First time poster, been reading for about a day - but I just couldn't
resist. I've actually been knee deep in BIND, named, and DHCP for the last
few days now in my office and I've learned a few things I figured I might
share. Could break things down a bit. :-)

dhcpcd is the DHCP 'client daemon'

dhcpd is the DHCP 'server daemon'

You need to be running the dhcpd to "hand out" ip addresses, not BIND. :-)
The next question on your mind probabaly is: "Well, gee jtiner, how do I do
that?!?" Simple! Here's a crash course (in return I'm hoping for a little
help regaurding FAXing and also remote desktop control). So, buckle up,
loosen yer tie, and I'll tell you a little story of a guy that setup DHCP to
hand out private IP addresses on a small office network...

The story begins...

Once upon a time was a computer guru, we'll call him Wally (distant cousin
of Wyle E., but doesn't fall off cliffs nearly as much), who was assigned
the task of making some of the corporate big heads laptop computers in the
office where he worked able to easily connect to the office LAN and the
Internet - without having to manually reconfigure the IP information
everytime one of the big wigs strolled into the office and demanded to be
put on the office LAN. The bosses didn't want to spend ANY cash either. He
was told to use an ancient Pentium II with just 16 MB of RAM.

Wally was under a bit of pressure! The economy was bad, the budgets were
low, and if he didn't pull this task off he knew for sure he'd be ass out on
the street hunting for a job. Wally went to the drawing board. After about
an hour of research he had it together. He decided to use RedHat 7.2 linux
to pull off the feat! After doing an install of linux he began to work
furiously on setting up the DHCP server. It had to be up before LUNCH! :)

Wally logged in as root.

1.) He verified dhcp was installed by issuing the command:
    $ rpm -q dhcpd

2.) He cd'd to the /etc directory.

3.) He created a new file called dhcpd.conf using vi.

4.) He wrote the following stuff in the file:

# --
# /etc/dhcpd.conf
#
# The boss demanded that I get this DHCP server up before lunch or I'm
fired.
# This is very simple, and will only assign a pool of 20 IP addresses for
# individuals connecting to the LAN / internet in our office. It's simple,
but
# it works.
#
# --Wally Coyote
# Short Order Miracle Worker
# ACME Corporation
# Stinking Creek, AL 37337

# lease the IP from the pool for 720 secs
default-lease-time 720;

# do not allow the IP to be leased for more than 86400 secs (1 day)
max-lease-time 86400;

# set the subnet mask for the client
option subnet-mask 255.255.255.0;

# set the broadcast address for the client
open broadcast-address 192.168.0.255;

# the following is the IP of the DHCP server
option routers 192.168.0.254;

# set the DNS servers for the clients (primary and secondary) seperated by
commas
option domain-name-servers 192.168.0.1, 192.168.0.2;

# create a pool of ip address - do not make this pool ridiculously large
because
# it does eat resources
subnet 192.168.0.0 netmask 255.255.255.0 {
    # clients will be assigned IPs between .20 and .50
    # that's twenty IPs, just like the boss ordered
    range 192.168.0.30 192.168.0.50;
}

#EOF

--

Now wally had a /etc/dhcpd.conf file. :-) He smiled really big. He was on to something good, and hadn't even been at work setting it up for more than an hour.

Wally then started the dhcpd server by issuing the command:

$ /etc/init.d/dhcpd start

Then he made it so that DHCP server started everytime the computer booted by issuing the command:

$ chkconfig dhcpd on

Wally then made sure DHCP was working by checking the /var/lib/dhcp/dhcpd.leases file to make sure that the computers that were requesting a new IP in the office were getting IP addresses. Viola!

He sighed with releif - IP addresses were being assigned with no problems! The boss was happy that Wally pulled it off. He could now surf "sites of questionable interest" on his laptop in the comfort of his big boss office (yup, the one with the reflective glass mirror that he uses to watch over the employees). Wally was happy too, because the cute secretary owed Wally a date because she made a bet earlier in the day that Wally couldn't pull it off.

[note: if the dhcp server has two nic cards, you can also turn it into a "internet gatway router using ipchains too. dhcp truly is a peice o' cake. even Wally can do it.]

...the story ends.

Well Paul, I hope you've enjoyed our storytime. It can actually get ALOT more complicated than that - as with everything Linux there are a TON of options that you can put in the /etc/dhcpd.conf file. One of the cooler features is to enable permant IPs based on the MAC address. DHCP is great for handling mobile computers in an office environment, but I'd still recommend making on the desktops and workstations static-o-matic m'self.

:-)

I'll post another (short) email soon regaurrding X desktop sharing and also FAXing from linux.

-jtiner e-mail: josh.tiner@worldwidephp.com

----- Original Message ----- From: "Paul M Foster" <paulf@quillandmouse.com> To: "SLUG List" <slug@nks.net> Sent: Wednesday, February 13, 2002 10:13 PM Subject: [SLUG] DHCP or BIND

> I've never really untangled DNS for myself, but I'm working on > understanding it right now. One question comes up that I don't seem to > have an answer for. I know there's a dhcpcd, which grabs an IP address > from a nameserver. And I know there's BIND, which serves up IP > addresses. I thought there was a DHCP server daemon as well, which > would perform the function of serving up IP addresses on small networks. > Is that not the case, or do I need to run BIND to hand out IP addresses? > > Paul >



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:04:53 EDT