Your SlideShare is downloading. ×
Dhcp confg
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Dhcp confg


Published on

Published in: Technology
1 Comment
1 Like
No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Configuring DHCPInstallation Mannual - DHCPA DHCP Server assigns IP addresses to client computers. This is very often used in enterprise networksto reduce configuration efforts. All IP addresses of all computers are stored in a database that resideson a server machine.A DHCP server can provide configuration settings using two methodsAddress PoolThis method entails defining a pool (sometimes also called a range or scope) of IP addresses fromwhich DHCP clients are supplied their configuration properties dynamically and on a fist come firstserve basis. When a DHCP client is no longer on the network for a specified period, the configuration isexpired and released back to the address pool for use by other DHCP Clients.MAC AddressThis method entails using DHCP to identify the unique hardware address of each network cardconnected to the network and then continually supplying a constant configuration each time the DHCPclient makes a request to the DHCP server using that network device.Install DHCP server in ubuntu sudo apt-get install dhcp3-serverThis will complete the installation.Configuring DHCP serverIf you have two network cards in your ubuntu server you need to select which interface you want to usefor 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-serverFind this line
  • 2. INTERFACES=”eth0″Replace with the following lineINTERFACES=”eth1″Save and exit.This is optional.Next you need to make a backup copy of /etc/dhcp3/dhcpd.conf filecp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.backEdit /etc/dhcp3/dhcpd.conf file using the following command sudo vi /etc/dhcp3/dhcpd.confUsing address pool methodYou need to change the following sections in /etc/dhcp3/dhcpd.conf file default-lease-time 600; max-lease-time 7200; option subnet-mask; option broadcast-address; option routers; option domain-name-servers,; option domain-name “”; subnet netmask { range; }save and exit the fileThis will result in the DHCP server giving a client an IP address from the range . It will lease an IP address for 600 seconds if the client doesn’t ask for a specific timeframe. Otherwise the maximum (allowed) lease will be 7200 seconds. The server will also “advise” theclient that it should use as its subnet mask, as its broadcast address, as the router/gateway and and as its DNS servers.Using MAC address methodThis method is you can reserver some of the machines or all the machines with fixed ip address.In thefollowing example i am using fixed ip address for server1,server2,printer1 and printer2 default-lease-time 600; max-lease-time 7200; option subnet-mask; option broadcast-address; option routers; option domain-name-servers,; option domain-name “”; subnet netmask {
  • 3. range; } host server1 { hardware ethernet 00:1b:63:ef:db:54; fixed-address; } host server2 { hardware ethernet 00:0a:95:b4:d4:b0; fixed-address; } host printer1 { hardware ethernet 00:16:cb:aa:2a:cd; fixed-address; } host printer2 { hardware ethernet 00:0a:95:f5:8f:b3; fixed-address; }Now you need to restart dhcp server using the following commandsudo /etc/init.d/dhcp3-server restartConfigure Ubuntu DHCP ClientIf you want to configure your ubuntu desktop as DHCP client following this procedureYou need to open /etc/network/interfaces filesudo vi /etc/network/interfacesmake sure you have the following lines (eth0 is an example) auto lo eth0 iface eth0 inet dhcp iface lo inet loopbackSave and exit the fileYou need to restart networking services using the following command sudo /etc/init.d/networking restartHow to find DHCP server IP addressYou need to use the following commandssudo dhclientortail -n 15 /var/lib/dhcp3/dhclient.*.leases