SlideShare une entreprise Scribd logo
1  sur  4
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances (20)

Dhcp
DhcpDhcp
Dhcp
 
Dhcp
DhcpDhcp
Dhcp
 
Dhcp
DhcpDhcp
Dhcp
 
Sharing your-internet-connection-on-linux
Sharing your-internet-connection-on-linuxSharing your-internet-connection-on-linux
Sharing your-internet-connection-on-linux
 
Tutorial on dhcp
Tutorial on dhcp Tutorial on dhcp
Tutorial on dhcp
 
Networking DHCP server Setup Reports
Networking DHCP server Setup ReportsNetworking DHCP server Setup Reports
Networking DHCP server Setup Reports
 
Dhcp ppt
Dhcp pptDhcp ppt
Dhcp ppt
 
Dhcp
DhcpDhcp
Dhcp
 
DHCP Protocol
DHCP ProtocolDHCP Protocol
DHCP Protocol
 
Dhcp presentation
Dhcp presentationDhcp presentation
Dhcp presentation
 
DHCP & DNS
DHCP & DNSDHCP & DNS
DHCP & DNS
 
Bootstrapping with bootp and dhcp
Bootstrapping with bootp and dhcpBootstrapping with bootp and dhcp
Bootstrapping with bootp and dhcp
 
DHCP
DHCPDHCP
DHCP
 
Wintel ppt for dhcp
Wintel ppt for dhcpWintel ppt for dhcp
Wintel ppt for dhcp
 
1. primary dns using bind for a and cname record for ipv4 and ipv6
1. primary dns using bind for a and cname record for ipv4 and ipv61. primary dns using bind for a and cname record for ipv4 and ipv6
1. primary dns using bind for a and cname record for ipv4 and ipv6
 
Dhcp
DhcpDhcp
Dhcp
 
dynamic host configuration protocol
dynamic host configuration protocoldynamic host configuration protocol
dynamic host configuration protocol
 
DNS, DHCP Configuration
DNS, DHCP Configuration DNS, DHCP Configuration
DNS, DHCP Configuration
 
Dhcp
DhcpDhcp
Dhcp
 
Dhcp presentation 01
Dhcp presentation 01Dhcp presentation 01
Dhcp presentation 01
 

En vedette

Function point Analysis: An idiots friendly introduction
Function point Analysis: An idiots friendly introductionFunction point Analysis: An idiots friendly introduction
Function point Analysis: An idiots friendly introductionArun
 
Function points analysis
Function points analysisFunction points analysis
Function points analysisYunis Lone
 
Function point analysis introduction
Function point analysis introductionFunction point analysis introduction
Function point analysis introductionTechcanvass
 
Dynamic Host Configuration Protocol
Dynamic Host Configuration ProtocolDynamic Host Configuration Protocol
Dynamic Host Configuration Protocolgueste98b36
 

En vedette (6)

DHCP Ubuntu
DHCP UbuntuDHCP Ubuntu
DHCP Ubuntu
 
Function point Analysis: An idiots friendly introduction
Function point Analysis: An idiots friendly introductionFunction point Analysis: An idiots friendly introduction
Function point Analysis: An idiots friendly introduction
 
Function points analysis
Function points analysisFunction points analysis
Function points analysis
 
Function Points
Function PointsFunction Points
Function Points
 
Function point analysis introduction
Function point analysis introductionFunction point analysis introduction
Function point analysis introduction
 
Dynamic Host Configuration Protocol
Dynamic Host Configuration ProtocolDynamic Host Configuration Protocol
Dynamic Host Configuration Protocol
 

Similaire à Dhcp confg

Dhcp server configuration
Dhcp server configurationDhcp server configuration
Dhcp server configurationUttamAgarwal9
 
Dhcp Configuration File
Dhcp Configuration FileDhcp Configuration File
Dhcp Configuration FileShubhamg Gupta
 
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...Vignesh kumar
 
DHCP in windows server 2012
DHCP in windows server 2012DHCP in windows server 2012
DHCP in windows server 2012Abaady Sahal
 
dynamichost configuration protocol
dynamichost configuration protocoldynamichost configuration protocol
dynamichost configuration protocolrajisri2
 
DYNAMIC HOST CONFIGURATION PROTOCOL
DYNAMIC HOST CONFIGURATION PROTOCOLDYNAMIC HOST CONFIGURATION PROTOCOL
DYNAMIC HOST CONFIGURATION PROTOCOLVENKATESHAN A S
 
Lesson 6: Dynamic Host Configuration Protocol A
Lesson 6: Dynamic Host Configuration Protocol ALesson 6: Dynamic Host Configuration Protocol A
Lesson 6: Dynamic Host Configuration Protocol AMahmmoud Mahdi
 
DHCP (dynamic host configuration protocol)
DHCP (dynamic host configuration protocol)DHCP (dynamic host configuration protocol)
DHCP (dynamic host configuration protocol)Netwax Lab
 
Configurar dhcp en router cisco
Configurar dhcp en router ciscoConfigurar dhcp en router cisco
Configurar dhcp en router ciscoGuiro Lin
 
configure a DHCP server on Fedora.pdf
configure a DHCP server on Fedora.pdfconfigure a DHCP server on Fedora.pdf
configure a DHCP server on Fedora.pdfHussein Younis
 
Module (8) DHCP Server.pptx
Module (8) DHCP Server.pptxModule (8) DHCP Server.pptx
Module (8) DHCP Server.pptxGeorgeThoreJr
 
Installing and configuring a dhcp on windows server 2016 step by step
Installing and configuring a dhcp on windows server 2016 step by stepInstalling and configuring a dhcp on windows server 2016 step by step
Installing and configuring a dhcp on windows server 2016 step by stepAhmed Abdelwahed
 
Dynamic Host Configuration Protocol ( DHCP).pptx
Dynamic Host Configuration Protocol ( DHCP).pptxDynamic Host Configuration Protocol ( DHCP).pptx
Dynamic Host Configuration Protocol ( DHCP).pptxSYEDASGARAHMED1
 
Dhcp & dhcp relay agent in cent os 5.3
Dhcp & dhcp relay agent in cent os 5.3Dhcp & dhcp relay agent in cent os 5.3
Dhcp & dhcp relay agent in cent os 5.3Sophan Nhean
 

Similaire à Dhcp confg (20)

dhcp.pdf
dhcp.pdfdhcp.pdf
dhcp.pdf
 
DHCP concept
DHCP conceptDHCP concept
DHCP concept
 
Dhcp server configuration
Dhcp server configurationDhcp server configuration
Dhcp server configuration
 
Dhcp Configuration File
Dhcp Configuration FileDhcp Configuration File
Dhcp Configuration File
 
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...
dhcp (dynamic host configuration protocol) very Cleare Explanation, Interview...
 
DHCP in windows server 2012
DHCP in windows server 2012DHCP in windows server 2012
DHCP in windows server 2012
 
dynamichost configuration protocol
dynamichost configuration protocoldynamichost configuration protocol
dynamichost configuration protocol
 
Dhcp
DhcpDhcp
Dhcp
 
DYNAMIC HOST CONFIGURATION PROTOCOL
DYNAMIC HOST CONFIGURATION PROTOCOLDYNAMIC HOST CONFIGURATION PROTOCOL
DYNAMIC HOST CONFIGURATION PROTOCOL
 
14047721
1404772114047721
14047721
 
Dhcp
DhcpDhcp
Dhcp
 
DHCP
DHCPDHCP
DHCP
 
Lesson 6: Dynamic Host Configuration Protocol A
Lesson 6: Dynamic Host Configuration Protocol ALesson 6: Dynamic Host Configuration Protocol A
Lesson 6: Dynamic Host Configuration Protocol A
 
DHCP (dynamic host configuration protocol)
DHCP (dynamic host configuration protocol)DHCP (dynamic host configuration protocol)
DHCP (dynamic host configuration protocol)
 
Configurar dhcp en router cisco
Configurar dhcp en router ciscoConfigurar dhcp en router cisco
Configurar dhcp en router cisco
 
configure a DHCP server on Fedora.pdf
configure a DHCP server on Fedora.pdfconfigure a DHCP server on Fedora.pdf
configure a DHCP server on Fedora.pdf
 
Module (8) DHCP Server.pptx
Module (8) DHCP Server.pptxModule (8) DHCP Server.pptx
Module (8) DHCP Server.pptx
 
Installing and configuring a dhcp on windows server 2016 step by step
Installing and configuring a dhcp on windows server 2016 step by stepInstalling and configuring a dhcp on windows server 2016 step by step
Installing and configuring a dhcp on windows server 2016 step by step
 
Dynamic Host Configuration Protocol ( DHCP).pptx
Dynamic Host Configuration Protocol ( DHCP).pptxDynamic Host Configuration Protocol ( DHCP).pptx
Dynamic Host Configuration Protocol ( DHCP).pptx
 
Dhcp & dhcp relay agent in cent os 5.3
Dhcp & dhcp relay agent in cent os 5.3Dhcp & dhcp relay agent in cent os 5.3
Dhcp & dhcp relay agent in cent os 5.3
 

Dernier

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Dernier (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

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