Here you will find many ways to share your machine with the rest of the world or your local network. Before installing any packages in this chapter, you need to be sure you understand what the package does and how to set it up correctly. It might also be helpful to learn about the consequences of an improper setup so that you can analyze the risks.
The DHCP package contains both the client and server programs for DHCP. dhclient (the client) is useful for connecting your computer to a network which uses DHCP to assign network addresses. dhcpd (the server) is useful for assigning network addresses on your private network.
Download (HTTP): http://gd.tuwien.ac.at/infosys/servers/isc/dhcp/dhcp-3.0-history/dhcp-3.0.2.tar.gz
Download (FTP): ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history/dhcp-3.0.2.tar.gz
Download MD5 sum: 04800a111521e7442749b2ce883f962b
Download size: 834 KB
Estimated disk space required: 29.7 MB
Estimated build time: 0.22 SBU
Net-tools-1.60 (you may omit net-tools by using the following patch to utilize iproute2: http://www.linuxfromscratch.org/blfs/downloads/6.1/dhcp-3.0.2-iproute2-3.patch)
You must have Packet Socket support (Device Drivers -> Networking Support -> Networking Options -> Packet Socket) compiled into the kernel.
If you chose not to install net-tools, apply the iproute2 patch:
patch -Np1 -i ../dhcp-3.0.2-iproute2-3.patch
Install DHCP by running the following commands:
patch -Np1 -i ../dhcp-3.0.2-gcc_3.4.3-2.patch && ./configure && make
Now, as the root user:
make LIBDIR=/usr/lib INCDIR=/usr/include install
LIBDIR=/usr/lib INCDIR=/usr/include: This command installs the library and include files in /usr instead of /usr/local.
Information on configuring the DHCP client can be found in Chapter 14, DHCP Clients.
Note that you only need the DHCP server if you want to issue LAN addresses over your network. The DHCP client doesn't need this script to be used. Also note that this script is coded for the eth1 interface, which may need to be modified for your hardware configuration.
Install the /etc/rc.d/init.d/dhcp init script included in the blfs-bootscripts-6.1 package.
make install-dhcp
The lease file must exist on startup. The following command will satisfy that requirement:
touch /var/state/dhcp/dhcpd.leases
The following commands will create a base configuration file for a DHCP server. There are several options that you may want to add (information that is passed back to the DHCP client) and those are covered in the man pages for dhcp.conf.
cat > /etc/dhcpd.conf << "EOF" default-lease-time 72000; max-lease-time 144000; ddns-update-style ad-hoc; subnet [192.168.5.0] netmask [255.255.255.0] { range [192.168.5.10] [192.168.5.240]; option broadcast-address [192.168.5.255]; option routers [192.168.5.1]; } EOF
All addresses should be changed to meet your circumstance.
Last updated on 2005-08-14 15:03:38 -0600