0% found this document useful (0 votes)
56 views3 pages

DHCP (Dynamic Host Configuration Protocol) : Atif Mahmood MSCIT-F09-A02

The document discusses DHCP (Dynamic Host Configuration Protocol) and how to configure the dhcpd server on SUSE Linux. It explains that DHCP is used to automatically assign IP addresses and network parameters to clients. It also provides details on preparing dhcpd by adding a route to allow broadcast packets, and describes the /etc/dhcpd.conf configuration file which defines DHCP options and IP address ranges to assign to clients.

Uploaded by

Shahid Rana
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views3 pages

DHCP (Dynamic Host Configuration Protocol) : Atif Mahmood MSCIT-F09-A02

The document discusses DHCP (Dynamic Host Configuration Protocol) and how to configure the dhcpd server on SUSE Linux. It explains that DHCP is used to automatically assign IP addresses and network parameters to clients. It also provides details on preparing dhcpd by adding a route to allow broadcast packets, and describes the /etc/dhcpd.conf configuration file which defines DHCP options and IP address ranges to assign to clients.

Uploaded by

Shahid Rana
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Atif Mahmood MSCIT-F09-A02

DHCP(Dynamic Host Configuration Protocol)


The Dynamic Host Configuration Protocol (DHCP) is used to control vital networking
parameters of hosts (running clients) with the help of a DHCP-server. The purpose is to
enable individual computers on an IP network to extract their configurations from the
DHCP server. The server doesn't have to have exact information about the individual
computers until they request the information. The idea is to reduce the work necessary
to administer a large IP network. The most significant piece of information distributed in
this manner is the IP address.

Preparations for configuring dhcpd


In order for dhcpd to work correctly with picky DHCP clients, it must be able to send
packets with an IP destination address of 255.255.255.255. Unfortunately, Linux insists
on changing 255.255.255.255 into the local subnet broadcast address. This results in a
DHCP protocol violation, and while many DHCP clients don't notice the problem, some
(specifically, all Microsoft DHCP clients) do. Clients that have this problem will appear
not to see DHCPOFFER messages from the server. 

It is possible to work around this problem on SuSE Linux by creating a host route from
your network interface address to 255.255.255.255. The easiest way to do this in SuSE
Linux is to add a host route for this address to the network device the DHCP server is
connected to. To set this up manually, you have to issue the command: 

 # route add -host 255.255.255.255 dev eth0


This of course assumes that you run the server on device eth0. Change the value if you
use another device. To make this setting permanent, add the line 

255.255.255.255 0.0.0.0 255.255.255.255 eth0


to the routing table in /etc/route.conf. The DHCP server is started by the script
/sbin/init.d/dhcp, if the variable START_DHCPD in /etc/rc.config has the value yes.

 The DHCP Server


The core of any DHCP system is the dynamic host configuration protocol daemon. This
server leases addresses and watches how they are used, according to the settings
defined in the configuration file /etc/dhcpd.conf. By changing the parameters and values
in this file, a system administrator can influence the program's behavior in numerous
ways.
The Configuration File /etc/dhcpd.conf

default-lease-time 600; # 10 minutes


max-lease-time 7200; # 2 hours
option domain-name "cosmos.all";
option domain-name-servers 192.168.1.1, 192.168.1.2;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
subnet 192.168.1.0 netmask 255.255.255.0
{
range 192.168.1.10 192.168.1.20;
range 192.168.1.100 192.168.1.200;
}

This simple configuration file should be sufficient to get the DHCP server to assign IP
addresses in the network. Make sure that a semicolon is inserted at the end of each
line, because otherwise dhcpd will not be started.

The above sample file can be divided into three sections. The first one defines how
many seconds an IP address is leased to a requesting client by default ( default-lease-
time) before it should apply for renewal. The section also includes a statement of the
maximum period for which a machine may keep an IP address assigned by the DHCP
server without applying for renewal (max-lease-time).

In the second part, some basic network parameters are defined on a global level:

 The line option domain-name defines the default domain of your network.

 With the entry option domain-name-servers, specify up to three values for the DNS
servers used to resolve IP addresses into hostnames and vice versa. Ideally, configure
a name server on your machine or somewhere else in your network before setting up
DHCP. That name server should also define a hostname for each dynamic address and
vice versa. To learn how to configure your own name server ,

 The line option broadcast-address defines the broadcast address to be used by the


requesting client.

 With option routers, tell the server where to send data packets that cannot be
delivered to a host on the local network (according to the source and target host
address and the subnet mask provided). In most cases, especially in smaller networks,
this router is identical to the Internet gateway .

 With option subnet-mask, specify the netmask assigned to clients.


The last section of the file is there to define a network, including a subnet mask. To
finish, specify the address range that the DHCP daemon should use to assign IP
addresses to interested clients. In this example, clients may be given any address
between 192.168.1.10 and 192.168.1.20 as well as192.168.1.100 and 192.168.1.200.

After editing these few lines, you should be able to activate the DHCP daemon with the
command rcdhcpd start. It will be ready for use immediately. Use the
command rcdhcpd check-syntax to perform a brief syntax check. If you encounter any
unexpected problems with your configuration—the server aborts with an error or does
not return done on start—you should be able to find out what has gone wrong by
looking for information either in the main system log/var/log/messages or on console 10
( Ctrl - Alt - F10 ).

On a default SUSE LINUX system, the DHCP daemon is started in a chroot


environment for security reasons. The configuration files must be copied to the chroot
environment so the daemon can find them. Normally, there is no need to worry about
this because the command rcdhcpd start automatically copies the file.

You might also like