0% found this document useful (0 votes)
2 views8 pages

performing notes

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

AIM:

Installing and configure DHCP server and write a program to install the software on remote
machine.

Theory:
DHCP stands for Dynamic Host Configuration Protocol. DHCP is a standardized network
protocol used on Internet Protocol networks for dynamically distributing network configuration
parameters, such as IP addresses for interfaces and services. DHCP Server can be any server
(Linux or Windows) that is used to distribute IP addresses automatically to the clients in the
network. Since, DHCP Server assigns IP addresses automatically to all systems, a system or
Network administrator need not to assign IP addresses manually to every single machine in the
network. DHCP is opt for system or Network administrator who is managing thousands of
systems.
The Dynamic Host Configuration Protocol (DHCP) is a network service that enables host
computers to be automatically assigned settings from a server as opposed to manually
configuring each network host. Computers configured to be DHCP clients have no control over
the settings they receive from the DHCP server, and the configuration is transparent to the
computer's user.
The most common settings provided by a DHCP server to DHCP clients include:

• IP address and netmask

• IP address of the default-gateway to use

• IP adresses of the DNS servers to use

• However, a DHCP server can also supply configuration properties such as:

• Host Name

• Domain Name

• Time Server

• Print Server
The advantage of using DHCP is that changes to the network, for example a change in the
address of the DNS server, need only be changed at the DHCP server, and all network hosts will
be reconfigured the next time their DHCP clients poll the DHCP server. As an added advantage,
it is also easier to integrate new computers into the network, as there is no need to check for the
availability of an IP address. Conflicts in IP address allocation are also reduced.

A DHCP server can provide configuration settings using the following methods:

Manual allocation (MAC address)


This method entails using DHCP to identify the unique hardware address of each network card
connected to the network and then continually supplying a constant configuration each time the
DHCP client makes a request to the DHCP server using that network device. This ensures that a
particular address is assigned automatically to that network card, based on it's MAC address.

Dynamic allocation (address pool)


In this method, the DHCP server will assign an IP address from a pool of addresses (sometimes
also called a range or scope) for a period of time or lease, that is configured on the server or until
the client informs the server that it doesn't need the address anymore. This way, the clients will
be receiving their configuration properties dynamically and on a "first come, first served" basis.
When a DHCP client is no longer on the network for a specified period, the configuration is
expired and released back to the address pool for use by other DHCP Clients. This way, an
address can be leased or used for a period of time. After this period, the client has to renegociate
the lease with the server to maintain use of the address.

Automatic allocation
Using this method, the DHCP automatically assigns an IP address permanently to a device,
selecting it from a pool of available addresses. Usually DHCP is used to assign a temporary
address to a client, but a DHCP server can allow an infinite lease time.

The last two methods can be considered "automatic" because in each case the DHCP server
assigns an address with no extra intervention needed. The only difference between them is in
how long the IP address is leased, in other words whether a client's address varies over time.
Ubuntu is shipped with both DHCP server and client. The server is dhcpd (dynamic host
configuration protocol daemon). The client provided with Ubuntu is dhclient and should be
installed on all computers required to be automatically configured. Both programs are easy to
install and configure and will be automatically started at system boot.

Install DHCP Server in Ubuntu


To install DHCP server on Ubuntu 15.04, enter the following command:

sudo apt-get install isc-dhcp-server

Configuration
DHCP server configuration is not that difficult. First, we have to assign on what interfaces
should the DHCP server (dhcpd) serve DHCP requests. In my case, I have only one Interface on
my system (eth0), so I assigned eth0.

To do that, edit file /etc/default/isc-dhcp-server,

sudo vi /etc/default/isc-dhcp-server

Assign the network interface:

[...]

INTERFACES="eth0"

Save and close the file.

Now, edit dhcpd.conf file,

sudo vi /etc/dhcp/dhcpd.conf

Make the changes as shown below.

Set the domain name and domain-name servers:

[...]
# option definitions common to all supported networks...

option domain-name "unixmen.local";

option domain-name-servers server.unixmen.local;

[...]

If this DHCP server is the official DHCP server for the local network, you should uncomment the
following line:

[...]

authoritative;

[...]

Define the sunbet, range of ip addresses, domain and domain name servers like below:

[...]

# A slightly different configuration for an internal subnet.

subnet 192.168.1.0 netmask 255.255.255.0 {

range 192.168.1.20 192.168.1.30;

option domain-name-servers server.unixmen.local;

option domain-name "unixmen.local";

option routers 192.168.1.1;

option broadcast-address 192.168.1.255;

default-lease-time 600;

max-lease-time 7200;
}

[...]

If you want to assign a fixed IP address to your client, you should enter it’s MAC id and the IP
address in the following directive. For example, I want to assign a fixed IP address 192.168.1.15
to my Ubuntu client, therefore I modified the following directive as shown below.

[...]

host ubuntu-client {

hardware ethernet 00:22:64:4f:e9:3a;

fixed-address 192.168.1.15;

[...]

After making all the changes you want, save and close the file. Be mindful that if you have
unused entries on the dhcpd.conf file, comment all of them. Otherwise, you’ll get issues while
starting dhcp service.

Now, restart dhcp service:

In Ubuntu 15.04:

sudo systemctl restart isc-dhcp-server

In Ubuntu 14.04 and older systems:

sudo service isc-dhcp-server restart

Likewise, you can start/stop dhcp service as shown below:

In Ubuntu 15.04 systems:


sudo systemctl start isc-dhcp-server

sudo systemctl stop isc-dhcp-server

In Ubuntu 14.04 and older systems:

sudo service isc-dhcp-server start

sudo service isc-dhcp-server stop

3. Configure DHCP Clients

Now, go to the client configuration network settings and change the IP settings to Automatic
(DHCP).
Restart the network or reboot the client system to get IP address automatically from the DHCp
server.

Now, you should see the IP address has been automatically assigned to the clients from the
DHCP server.

Run the following command from the client system Terminal:

sudo ifconfig

Sample output:
As you see in the above picture, Ubuntu 14.04 desktop system which has MAC id
00:22:64:4f:e9:3a got a fixed IP address (192.168.1.15) from the DHCP server.

Oral Questions
1. what is mean by DHCP and how does DHCP do?

2. What is configuration of DHCP server?

3. How to install the software on remote machine.?


4. What is uses of DHCP server?

You might also like