Installing and configuring DHCP, debian 6

In this article we will install the dhcp server in debian, and will hand out ip addresses in our local area network.

The DHCP protocol (Dynamic Host Configuration Protocol) is used to configure the TCP/IP hosts within the network. The DHCP server selects appropriate configuration parameters (the IP address of the subnet mask and other auxiliary parameters such as the IP address of the default gateway, DNS server addresses, domain names, etc.) user stations.

The DHCP server assigns the client an IP address within a set range for a certain period (lease time). The IP address can be left to the user, you must complete the request for extension of the period before the date of expiry. If the user has not requested renewal period, the IP address is considered free and can be assigned to another client.

Oh well, let’s begin.

apt-get install dhcp3-server

Edit the configuration file:

/etc/init.d/isc-dhcp-server

# What should interfaces On the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. “eth0 eth1”.
INTERFACES = “eth1”

You can now configure the server, open the file/etc/dhcp3/dhcpd.conf and enter there the options you want, similar to the example below. In the default configuration file are some examples that you may need in the future, so let’s leave it on the safe side and create a new configuration file.

CP/etc/dhcp3/dhcpd.conf/etc/dhcp3/dhcpd.conf.default
cat/dev/null >/etc/dhcp3/dhcpd.conf
Nano/etc/dhcp3/dhcpd.conf

Nano/etc/dhcp3/dhcpd.conf

You should get the following:

the DDNS-update-style none;
#
# Here is the domain name of the DNS server and the IP address lease time for clients, by default, a maximum of 10 days of week.
option domain-name “example.com”;
option domain-name-servers, 192.168.0.253 192.168.0.254;
default-lease-time 604800;
Max-lease-time 864001;
#
# The Server Logging
the log-facility local7;
#
# Here is a subnet of addresses for the clients, DNS server, NETBIOS name server,
# доменное имя, широковещательный адрес, и диапазон выдаваемых адресов.
subnet 192.168.0.0 netmask 255.255.255.0 {
option netbios-name-servers 192.168.0.253;
option domain-name-servers 192.168.0.253, 192.168.0.254;
option domain-name “domain.ru”;
option broadcast-address 192.168.200.255;
option routers 192.168.0.1;
range 192.168.0.10 192.168.0.250;
}

Сохраните файл и запустите DHCP сервер командой:

/etc/init.d/dhcp3-server start

Вот вродебы и все друзья!!!