![]() |
Now serving 104 guides. |
|
DHCP Daemon General Information This guide will explain how to install and some basic configuration of the Internet Software Consortium (ISC) DHCP server. The DHCP protocal is an easy way to dynamically assign IPs over a network as well as set other options like dns servers and gateways network-wide. It can also be used to assign a static IP to a machine by using its MAC address.Requirements
Installation The ISC DHCP daemon is already on the ports tree so it's quite simple to install.
Configuration The first thing to do is to edit the startup script.
dhcpd_options" and "dhcpd_ifaces". Under dhcpd_options, you want -q (this eliminates a terribly annoying banner every time the server's started up. Under dhcpd_ifaces, you want to list the network device you want the DHCP daemon to listen on (ex: xl0).Save and quit. Now it's time for the server configuration.
Next is the range or scope you'd like your DHCP server to dish out IPs in. This is very straightforward and I don't feel it needs any further explanation. The max-lease-time is the lease time (in seconds) for an IP. The lease time is how long it'll be before the DHCP daemon cycles through and sees if the IP's currently in use and either renews the lease or frees the IP accordingly.subnet-mask is straightforward. This must match the netmask declaration at the beginning.The broadcast-address must be at the end of your range. In this example, it'd be 10.10.10.255; if you're using 192.168.1.x then it'd be 192.168.1.255.The routers option specifies a machine/device acting as a gateway for internet access. If you don't have any, simply delete this line and pretend it doesn't exist (like for a LAN party DHCP server without Internet access).domain-name-servers specifies DNS server IPs. This is always good to be set to some sort of DNS server, even if it's not on your internal LAN.netbios-name-servers are the WINS servers on your network if any. If you don't have any, simply delete this line and pretend it doesn't exist.use-host-decl-names simply let's me use the block below that's an example on how to designate a static IP based on a MAC address. If you don't need such a thing, simply delete it.The last block is simply an example on how to designate a static IP address for something based on its MAC address. In this case, I want to have my switch use the IP 10.10.10.1 so I can telnet to it and tinker with it's configuration. This is optional and doesn't have to be in the configuration file. Just in case:
/var/db/dhcpd.leases which you can open with your favorite text editor and take a peek at any time to see what's using what on the network.Author: Kyle Symonds 1 Comment Posted by rhyous on January 18, 2007 at 3:49:49 am EET
The sample config gave me errors. After reading the errors and looking at the dhcpd.conf.sample it maybe should look like this:
ddns-update-style none; subnet 10.10.10.0 netmask 255.255.255.0 { range 10.10.10.40 10.10.10.100; default-lease-time 144000; max-lease-time 192000; option subnet-mask 255.255.255.0; option broadcast-address 10.10.10.255; option routers 10.10.10.10; option domain-name-servers 10.10.10.10; option domain-name "internal.lan"; option netbios-name-servers 10.10.10.10; } use-host-decl-names on; host switch { hardware ethernet 00:00:00:00:00:00; fixed-address 10.10.10.1; } |
Copyright 2003 - 2008 BSD Guides. All rights reserved. |
About | Terms of Use | Privacy | Contact |

