Page 190 - DCAP106_OPERATING_SYSTEM_TOOLS
P. 190
Unit 10: Servers
RPM’s filename usually starts with the word dhcp followed by a version number like this: dhcp- Notes
3.0.1rc14-1.i386.rpm.
With Debian / Ubuntu the package name may contain a version number. Use the dpkg --list |
grep dhcp command to get a list of all your dhcp packages and use the output to infer what the
DHCP server package name would be. In this case we can guess that the package name should
be dhcp3-server.
root@u-bigboy:/tmp# dpkg --list | grep dhcp
ii dhcp3-client 3.0.3-6ubuntu7 DHCP Client
ii dhcp3-common 3.0.3-6ubuntu7 Files used by all the dhcp3* packages
root@u-bigboy:/tmp#
The /etc/dhcpd.conf File
When DHCP starts, it reads the file /etc/dhcpd.conf. It utilizes the commands here to configure
your network. The standard DHCP RPM package doesn’t automatically install a /etc/dhcpd.
conf file, but you can find a sample copy of dhcpd.conf in the following directory which you can
always use as a guide.
/usr/share/doc/dhcp-<version-number>/dhcpd.conf.sample
You have to copy the trial dhcpd.conf file to the /etc directory and then you’ll have to edit it.
Here is the command to do the copying for the version 3.0p11 RPM file:
[root@bigboy tmp]# cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample
/etc/dhcpd.conf
With Debian / Ubuntu the configuration file name is /etc/dhcp*/dhcpd.conf and has the similar
syntax as that used by Redhat / Fedora.
Here is a rapid explanation of the dhcpd.conf file: Most importantly, there must be a subnet
section for each interface on your Linux box.
ddns-update-style interim
ignore client-updates
subnet 192.168.1.0 netmask 255.255.255.0 {
# The range of IP addresses the server
# will issue to DHCP enabled PC clients
# booting up on the network
range 192.168.1.201 192.168.1.220;
# Set the amount of time in seconds that
# a client may keep the IP address
default-lease-time 86400;
max-lease-time 86400;
# Set the default gateway to be used by
# the PC clients
option routers 192.168.1.1;
# Don’t forward DHCP requests from this
# NIC interface to any other NIC
# interfaces
LOVELY PROFESSIONAL UNIVERSITY 183