DHCP3-Server Installation and Configuration in Ubuntu 12.04LTS..............
1:-Set a static IP address in Ubuntu 12.04
It is not intuitively obvious how to assign Ubuntu 12.04 LTS a a static IP address from the command line. However, much of
Linux administration involves the editing of text files, and assigning a
static IP address is no different. You’ll need to edit the following
file:
/etc/network/interfaces
Initially, the file only contains information about your local loopback address:
auto lo
iface lo inet loopback
To assign a static IP address, you’ll need to make some changes to this file.
Let’s say you want to assign a static IP of 192.168.0.2 to your eth1 network connection (the first Ethernet adapter on your system; if you only have one, it will be eth0), with a subnet mask of 255.255.255.0 and a local gateway of 192.168.0.1. First, make a backup copy of the interfaces file:
sudo cp /etc/network/interfaces ~
This will make a backup copy in your home directory in case something goes amiss during the editing process. Next, fire up a text editor:
sudo vi /etc/network/interfaces
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.1
You’ll then to need have your system load the new IP configuration. You can do that by rebooting, but if that takes too long, you can use this command to force Ubuntu to re-read the configuration files:
sudo ifup eth0
Your system will then have a static IP address.
2:-Installation and Configuration of DHCP3-Server
apt-get install dhcp3-server
once we have your static IP, you’ll need to edit DHCP’s main configuration file, which is /etc/dhcp3/dhcpd.conf. First make a backup copy of the file to your home folder, in case something goes wrong:
cp /etc/dhcp3/dhcpd.conf ~
Then begin editing dhcpd.conf:
gedit /etc/dhcp3/dhcpd.conf