SlideShare a Scribd company logo
Configuring DHCP

Installation Mannual - DHCP
A DHCP Server assigns IP addresses to client computers. This is very often used in enterprise networks
to reduce configuration efforts. All IP addresses of all computers are stored in a database that resides
on a server machine.

A DHCP server can provide configuration settings using two methods
Address Pool
This method entails defining a pool (sometimes also called a range or scope) of IP addresses from
which DHCP clients are supplied their configuration properties dynamically and on a fist come first
serve 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.
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.




Install DHCP server in ubuntu
      sudo apt-get install dhcp3-server

This will complete the installation.
Configuring DHCP server
If you have two network cards in your ubuntu server you need to select which interface you want to use
for DHCP server listening.By default it listens to eth0.
You can change this by editing /etc/default/dhcp3-server file
      sudo vi /etc/default/dhcp3-server

Find this line
INTERFACES=”eth0″
Replace with the following line
INTERFACES=”eth1″
Save and exit.This is optional.
Next you need to make a backup copy of /etc/dhcp3/dhcpd.conf file
cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.back
Edit /etc/dhcp3/dhcpd.conf file using the following command
      sudo vi /etc/dhcp3/dhcpd.conf

Using address pool method
You need to change the following sections in /etc/dhcp3/dhcpd.conf file
      default-lease-time 600;
      max-lease-time 7200;

      option subnet-mask 255.255.255.0;
      option broadcast-address 192.168.1.255;
      option routers 192.168.1.254;
      option domain-name-servers 192.168.1.1, 192.168.1.2;
      option domain-name “yourdomainname.com”;

      subnet 192.168.1.0 netmask 255.255.255.0 {
      range 192.168.1.10 192.168.1.200;
      }

save and exit the file
This will result in the DHCP server giving a client an IP address from the range 192.168.1.10-
192.168.1.200 . It will lease an IP address for 600 seconds if the client doesn’t ask for a specific time
frame. Otherwise the maximum (allowed) lease will be 7200 seconds. The server will also “advise” the
client that it should use 255.255.255.0 as its subnet mask, 192.168.1.255 as its broadcast address,
192.168.1.254 as the router/gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers.
Using MAC address method
This method is you can reserver some of the machines or all the machines with fixed ip address.In the
following example i am using fixed ip address for server1,server2,printer1 and printer2
      default-lease-time 600;
      max-lease-time 7200;

      option subnet-mask 255.255.255.0;
      option broadcast-address 192.168.1.255;
      option routers 192.168.1.254;
      option domain-name-servers 192.168.1.1, 192.168.1.2;
      option domain-name “yourdomainname.com”;

      subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
      }

      host server1 {
      hardware ethernet 00:1b:63:ef:db:54;
      fixed-address 192.168.1.20;
      }

      host server2 {
      hardware ethernet 00:0a:95:b4:d4:b0;
      fixed-address 192.168.1.21;
      }

      host printer1 {
      hardware ethernet 00:16:cb:aa:2a:cd;
      fixed-address 192.168.1.22;
      }

      host printer2 {
      hardware ethernet 00:0a:95:f5:8f:b3;
      fixed-address 192.168.1.23;
      }

Now you need to restart dhcp server using the following command
sudo /etc/init.d/dhcp3-server restart
Configure Ubuntu DHCP Client
If you want to configure your ubuntu desktop as DHCP client following this procedure
You need to open /etc/network/interfaces file
sudo vi /etc/network/interfaces
make sure you have the following lines (eth0 is an example)
      auto lo eth0
      iface eth0 inet dhcp
      iface lo inet loopback

Save and exit the file
You need to restart networking services using the following command
      sudo /etc/init.d/networking restart

How to find DHCP server IP address
You need to use the following commands
sudo dhclient
or
tail -n 15 /var/lib/dhcp3/dhclient.*.leases
Dhcp confg

More Related Content

PPTX
Dhcp Server Linux Server
PPT
Lession4 Dhcp
PPT
IPTABLES
ODP
Dhcpsession
PPS
Linux05 DHCP Server
PPTX
6 understanding DHCP
PPT
Configuration DHCP
PPT
Dhcp Server Linux Server
Lession4 Dhcp
IPTABLES
Dhcpsession
Linux05 DHCP Server
6 understanding DHCP
Configuration DHCP

What's hot (20)

PPTX
PDF
Sharing your-internet-connection-on-linux
PPTX
Tutorial on dhcp
DOCX
Networking DHCP server Setup Reports
PPTX
Dhcp ppt
PPTX
PPT
DHCP Protocol
PPTX
DHCP & DNS
PPTX
Bootstrapping with bootp and dhcp
PPT
Wintel ppt for dhcp
PDF
1. primary dns using bind for a and cname record for ipv4 and ipv6
PPTX
PPT
dynamic host configuration protocol
DOCX
DNS, DHCP Configuration
PPTX
PPT
Dhcp presentation 01
Sharing your-internet-connection-on-linux
Tutorial on dhcp
Networking DHCP server Setup Reports
Dhcp ppt
DHCP Protocol
DHCP & DNS
Bootstrapping with bootp and dhcp
Wintel ppt for dhcp
1. primary dns using bind for a and cname record for ipv4 and ipv6
dynamic host configuration protocol
DNS, DHCP Configuration
Dhcp presentation 01
Ad

Viewers also liked (6)

PDF
DHCP Ubuntu
PPTX
Function point Analysis: An idiots friendly introduction
PPT
Function points analysis
PPTX
Function Points
PDF
Function point analysis introduction
PPT
Dynamic Host Configuration Protocol
DHCP Ubuntu
Function point Analysis: An idiots friendly introduction
Function points analysis
Function Points
Function point analysis introduction
Dynamic Host Configuration Protocol
Ad

Similar to Dhcp confg (20)

PDF
dhcp.pdf
PDF
DHCP concept
PPTX
Dhcp server configuration
PPTX
Dhcp Configuration File
PPTX
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...
PDF
DHCP in windows server 2012
PPTX
dynamichost configuration protocol
PDF
DYNAMIC HOST CONFIGURATION PROTOCOL
PDF
14047721
PDF
Dhcp
PPT
PPSX
Lesson 6: Dynamic Host Configuration Protocol A
PDF
DHCP (dynamic host configuration protocol)
PDF
Configurar dhcp en router cisco
PDF
configure a DHCP server on Fedora.pdf
PPTX
Module (8) DHCP Server.pptx
PDF
Installing and configuring a dhcp on windows server 2016 step by step
PPTX
Dynamic Host Configuration Protocol ( DHCP).pptx
PDF
Dhcp & dhcp relay agent in cent os 5.3
PDF
DHCP SERVER
dhcp.pdf
DHCP concept
Dhcp server configuration
Dhcp Configuration File
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...
DHCP in windows server 2012
dynamichost configuration protocol
DYNAMIC HOST CONFIGURATION PROTOCOL
14047721
Dhcp
Lesson 6: Dynamic Host Configuration Protocol A
DHCP (dynamic host configuration protocol)
Configurar dhcp en router cisco
configure a DHCP server on Fedora.pdf
Module (8) DHCP Server.pptx
Installing and configuring a dhcp on windows server 2016 step by step
Dynamic Host Configuration Protocol ( DHCP).pptx
Dhcp & dhcp relay agent in cent os 5.3
DHCP SERVER

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Cloud computing and distributed systems.
PDF
cuic standard and advanced reporting.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Spectroscopy.pptx food analysis technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
KodekX | Application Modernization Development
Approach and Philosophy of On baking technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Understanding_Digital_Forensics_Presentation.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MIND Revenue Release Quarter 2 2025 Press Release
Diabetes mellitus diagnosis method based random forest with bat algorithm
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Cloud computing and distributed systems.
cuic standard and advanced reporting.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Spectroscopy.pptx food analysis technology
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
sap open course for s4hana steps from ECC to s4
Chapter 3 Spatial Domain Image Processing.pdf
KodekX | Application Modernization Development

Dhcp confg

  • 1. Configuring DHCP Installation Mannual - DHCP A DHCP Server assigns IP addresses to client computers. This is very often used in enterprise networks to reduce configuration efforts. All IP addresses of all computers are stored in a database that resides on a server machine. A DHCP server can provide configuration settings using two methods Address Pool This method entails defining a pool (sometimes also called a range or scope) of IP addresses from which DHCP clients are supplied their configuration properties dynamically and on a fist come first serve 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. 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. Install DHCP server in ubuntu sudo apt-get install dhcp3-server This will complete the installation. Configuring DHCP server If you have two network cards in your ubuntu server you need to select which interface you want to use for DHCP server listening.By default it listens to eth0. You can change this by editing /etc/default/dhcp3-server file sudo vi /etc/default/dhcp3-server Find this line
  • 2. INTERFACES=”eth0″ Replace with the following line INTERFACES=”eth1″ Save and exit.This is optional. Next you need to make a backup copy of /etc/dhcp3/dhcpd.conf file cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.back Edit /etc/dhcp3/dhcpd.conf file using the following command sudo vi /etc/dhcp3/dhcpd.conf Using address pool method You need to change the following sections in /etc/dhcp3/dhcpd.conf file default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; option routers 192.168.1.254; option domain-name-servers 192.168.1.1, 192.168.1.2; option domain-name “yourdomainname.com”; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.10 192.168.1.200; } save and exit the file This will result in the DHCP server giving a client an IP address from the range 192.168.1.10- 192.168.1.200 . It will lease an IP address for 600 seconds if the client doesn’t ask for a specific time frame. Otherwise the maximum (allowed) lease will be 7200 seconds. The server will also “advise” the client that it should use 255.255.255.0 as its subnet mask, 192.168.1.255 as its broadcast address, 192.168.1.254 as the router/gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers. Using MAC address method This method is you can reserver some of the machines or all the machines with fixed ip address.In the following example i am using fixed ip address for server1,server2,printer1 and printer2 default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; option routers 192.168.1.254; option domain-name-servers 192.168.1.1, 192.168.1.2; option domain-name “yourdomainname.com”; subnet 192.168.1.0 netmask 255.255.255.0 {
  • 3. range 192.168.1.10 192.168.1.200; } host server1 { hardware ethernet 00:1b:63:ef:db:54; fixed-address 192.168.1.20; } host server2 { hardware ethernet 00:0a:95:b4:d4:b0; fixed-address 192.168.1.21; } host printer1 { hardware ethernet 00:16:cb:aa:2a:cd; fixed-address 192.168.1.22; } host printer2 { hardware ethernet 00:0a:95:f5:8f:b3; fixed-address 192.168.1.23; } Now you need to restart dhcp server using the following command sudo /etc/init.d/dhcp3-server restart Configure Ubuntu DHCP Client If you want to configure your ubuntu desktop as DHCP client following this procedure You need to open /etc/network/interfaces file sudo vi /etc/network/interfaces make sure you have the following lines (eth0 is an example) auto lo eth0 iface eth0 inet dhcp iface lo inet loopback Save and exit the file You need to restart networking services using the following command sudo /etc/init.d/networking restart How to find DHCP server IP address You need to use the following commands sudo dhclient or tail -n 15 /var/lib/dhcp3/dhclient.*.leases