Installing DHCP Server in debian linux is not that hard actually…
I assume you have the following configuration on your host:
2 internal nics:
eth0 (For internal )
eth1 (for internet)
1. Setting up your eth0 for dhcp use
The most important thing you need to do is configuring static ip adresses.
I will use the following IP adress 192.168.10.x as my ip-adress range.
We type the following command: nano /etc/network/interfaces
And be sure the settings are the same as below:
auto eth0
iface eth0 inet static
address 192.168.10.1
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
After you have modified the file press control+x you will get a confirmation telling you to save the file yes or no.. We do Y and press Enter
restart the network interface type:
/etc/init.d/networking restart
And press enter.
2. Install and configure the dhcp server
If you have completed the step above we are going to install the dhcp and configure it.
First lets install the module:
apt-get install dhcp3-server
After a while it gives a blue screen with a warning. Just press enter and let him install.
When it finished installing the server will not start. We need to bind him to a interface and give a IP range to lease.
2.1 Binding the interface
Enter the following command
nano /etc/default/dhcp3-server
Press enter
Edit the following line
INTERFACES=”"
To
INTERFACES=”eth1″
After you have modified the file press control+x you will get a confirmation telling you to save the file yes or no.. We do Y and press Enter
2.2 configuring the DHCP Release
We are at the final step and after that we have a full DHCP Server Running!
We are not going to use the default config file of the dhcp server however we are going to keep a copy of the config file.
go to the following directory:
cd /etc/dhcp3/
Make a backup copy of the following config file by typing the following command:
cp dhcpd.conf dhcpd.old.conf
And press Enter.
Now remove the file that you have backuped
rm dhcpd.conf
We make the new dhcpd.conf in this step as I promised type:
nano dhcpd.conf
Now copy/paste the following data into the file
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.10 192.168.10.100;
option domain-name-servers 192.168.1.1;
option domain-name “Failserver.nl”;
option netbios-name-servers 192.168.10.1;
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
default-lease-time 86400;
max-lease-time 676800;
}
After you have modified the file press control+x you will get a confirmation telling you to save the file yes or no.. We do Y and press Enter
Now restart the DHCP3 server
/etc/init.d/dhcp3-server restart
Related Posts
- 10/06/2011 -- linux local privilege escalation on polkit-1 <= 0.101 (0)
- 08/04/2011 -- Linux Kernel < 2.6.37-rc2 ACPI custom_method Privilege Escalation (0)
- 04/07/2011 -- sniffer tools for Centos–dsniff (0)
- 01/18/2011 -- How do I view the information the process of IO to read and write on linux? (0)
- 03/14/2010 -- rhel/centos x86_64 and i386 packages mess (2)
- 03/08/2010 -- Tunning Kernel Parameters Improving Linux Network Performance (1)
- 03/07/2010 -- Linux Check Disk Space with the Commands du and df (2)
- 03/04/2010 -- Linux software RAID 5 very slow (1)
- 02/27/2010 -- Homemade Bench top Power Supply (0)
- 09/02/2009 -- Linux Kernel < 2.6.19 udp_sendmsg Local Root Exploit (2)
Thanks,I will consider your suggest.
Hello,
I hope you put the source http://www.failserver.nl on the blog tutorial you posted… ;)
Thanks!