[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dhcpd.conf



Thursday, April 04, 2002, 1:19:11 PM, Brian W. Carver wrote:

> I've scoured the web, read the man page, and don't get it.  If several
> people posted or sent me their dhcpd.conf files with explanations of
> why each name/address goes in each spot I would greatly appreciate it.

I'm no expert, but I did just recently set up DHCPd on my system. I
didn't run into any problems, so I must have done something right
<grin>.  Following are my thoughts. If anyone with more knowledge wants
to add their two cents, by all means!

> The other attached computer is a laptop that's at the office right now,
> so no info, but I think it would say:.

Because the Laptop is portable, and may not always be connected, I would
recommend giving it a dynamic IP address. Your other computers can have
Static IPs. Unless you want to give the Laptop a static IP, that's fine.
Normally the MAC Address for a Laptop is given on a sticker on the
underside. In my situation, we will have two Win98 Computers hooked up
all the time (static IPs) and one WinNT Laptop occasionally hooked up.
The Laptop doesn't deserve its own IP address <grin>.

> What I don't get in dhcp.conf is:
> What info from above goes where in the below file.  It seems to me like
> they use different names for things, so I can't figure out how to match

The default dhcpd.conf file confused me too, so I just went with what I
knew. Here's the link to the Mini-HOWTO.

http://www.linuxdoc.org/HOWTO/mini/DHCP/index.html

As Kurdt has mentioned, check your /etc/network/interfaces.

I have to fix mine for eth0 still as I have a Dynamic Public IP Address
(DSL), but here's what mine currently is:

#/etc/network/interfaces
iface eth0 inet static
        netmask 255.255.254.0
        network 208.181.144.0
        broadcast 208.181.145.255
        gateway 208.181.144.1

iface eth1 inet static
        address 192.168.43.1
        netmask 255.255.255.0
        broadcast 192.168.43.255
        network 192.168.43.0
## eof

The important one is eth1. You automatically set the address and stuff
so it loads that way on boot.

And, for the dhcpd.conf (note, I changed the IP Addresses for this
email. Read the comments):

# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# Updated by Alan on March 22 2002

# option definitions common to all supported networks...


# Change domain-name to your domain name. I just preceeded my ISP with
# the name of my Linux computer.
option domain-name "yourcomp.yourisp.com";

# The domain-name-servers you enter here will be used by all other
# computers on your LAN. eg.. 24.205.1.62, 24.205.x.x, 24.205.x.x, etc
option domain-name-servers 255.255.255.150, 255.255.255.130;

# This just tells all the other computers that you're a Class C network.
# If you're using the 192.168.x.x address, you're Class C. Don't change
# the IP address for this. It really should be 255.255.255.0
option subnet-mask 255.255.255.0;

# I went with the default lease times. I guess they could be longer.
default-lease-time 600;
max-lease-time 7200;

# These next two are important. Change the 43 for your 0.
option broadcast-address 192.168.43.255;
option routers 192.168.43.1;

# Here's where you set up your range of Dynamic IP Addresses. I set mine
# for 10 because I don't honestly think I'll have more than 10 computers
# hooked up. It is in this range that your Laptop will have an IP Address
# of. You could certainly set it to a range of 100-255 if you want,
# reserving the first 100 IPs for Static.
subnet 192.168.43.0 netmask 255.255.255.0 {
  range 192.168.43.10 192.168.43.20;
}

# And here's where you can start setting up your Desktop computers and
# their static IP addresses. I honestly don't know what the "host" is used
# for, so I decided to make it a "Tag" so I know what computer it is. I
# don't have the MAC addresses memorized!
#
# When you do a winipcfg on your Windows boxen, the MAC Address is the
# hardware address given here. The fixed address is the Static IP you want
# to assign to that computer.
host abpcomp {
  hardware ethernet 00:50:BA:AB:92:79;
  fixed-address 192.168.43.2;
}

host laptop {
  hardware ethernet 00:00:00:00:00:00;
  fixed-address 192.168.43.3;
}

## eof

After editing that file, be sure to edit /etc/init.d/dhcpd.

Change run_dhcpd=0 to run_dhcpd=1

and further down, in the case section add "eth1" into the start) and
restart) sections:

--exec /usr/sbin/dhcpd eth1

After that, you should be able to run "/etc/init.d/dhcp start", or
reboot, and it "should" work.

If you get errors, or have questions, ask. =]

HTH

-- 
  - Alan Poulton (apoulton@telus.net) -
...last screw - finished!    Oh, what's that?    A JUMPER?!?!


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: