If you need more assistance with the ISC DHCP client or server
you should probably visit
http://www.fugue.com/dhcp/lists
and subscribe to one or more of the support mailing lists and post your
question there. They have a lot of knowledgeable people there who are willing
to help.
If you have any questions comments or suggestions please send
them to me by mailing Studded@dal.net.
Last modified 30 March 1998
pseudo-device bpfilter 4
After you have recompiled the kernel and rebooted you will probably need to make your devices. As root type:
# cd /dev
# /bin/sh MAKEDEV bpf0 bpf1 bpf2 bpf3
If you do not wish to use the ports collection you can try installing it as a package instead. You could of course download the source from the ISC and compile it yourself, but if you are going to do that you might as well use the port. :)
# cp /usr/ports/net/isc-dhcp2/work/dhcp-2.0b1pl0/client/dhclient.conf /etc
A lot of the things in the conf file are examples and should be deleted. The only entries I have in mine are:
# Defaults
timeout 60;
reboot 10;
retry 60;
select-timeout 5;
initial-interval 2;
script "/etc/dhclient-script";
interface "ed0" {
request subnet-mask, broadcast-address,
routers, domain-name-servers,
domain-name, host-name;
require domain-name-servers;
media "link2";
}
Your configuration should be determined by your local needs of course. Your ISP should be able to give you the information you need (unless of course they are like Road Runner and prefer not to acknowledge that Unix exists :). The options I have in the request statement are pretty much normal and required. The man page for dhclient.conf also suggests that you can start with an empty conf file and in most normal server configurations it should come up by itself. Then you can check the /var/db/dhclient.leases file to see what information the server sends you.
In general you should not need to make any modifications to the script, it will work out of the box. One option I need that is not currently supported by the dhclient-script is setting the hostname. I have a patch for the script that will set the hostname if you request it from the server. I also added an option to run a local script that in my case logs in to the Road Runner system when it obtains a new lease. I did not want to put this info in the client script itself for various reasons. If you have similar needs you can set up your own dhclient-script.local in /etc. If you do not, you can ignore that part of the patch (or delete it) since it will not do anything if there is no such script to run. :)
The format of my dhclient-script.local file is as such. I use it to start Phil Karn's excellent rrlogin program that is needed by us Road Runner users. (Thanks Phil. :) Those who have an interest in Road Runner or cable modem service in general would be well served at his page. I do not like to keep rrlogin running, so I kill it off once I am logged in. It is enough to bring it up as needed when I boot or get a new lease.
Once you have got the files situated the way you want them, fire it up and make sure it is working. As root I simply type
# dhclient ed0
which fires it up for my 3Com 3c509 card.
# If dhcp will be setting your hostname for
you, comment this out.
# If you have a static hostname set it here
as normal.
#hostname="my.domain.name" # Set this!
. . .
# Make sure you define your network interfaces
even if they will
# be configured by dhcp (so that the start
script catches them).
network_interfaces="ed0 lo0"
# List of network interfaces (lo0 is loopback).
ifconfig_lo0="inet 127.0.0.1"
# default loopback device configuration.
# But do not let rc.network configure it.
#ifconfig_ed0="inet 204.210.32.25 netmask
255.255.255.0"
. . .
# This is almost certainly going to be something
you get from dhcp.
defaultrouter="NO"
# Set to default gateway (or NO).
In /etc/rc.network you will see the following (no changes need to be made).
# Set up all the network interfaces, calling
startup scripts if needed
for ifn in ${network_interfaces};
do
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
fi
. . .
You can take advantage of this by creating a script that starts dhcp. The script should have a suffix named after the interface you want to key it to. For instance mine is called /etc/start_if.ed0. Since all I need to do is start dhcp, it is very simple.
#!/bin/sh
/usr/local/sbin/dhclient ed0