Installing DHCP server in Debian
#apt-get install dhcp3-serverOnce you press enter installation will start it will ask you some questions just you need to click ok for all three times
Configuring DHCP server
The main Configuration file for DHCP server is /etc/dhcp3/dhcpd.conf
Before doing any changes take backup copy of this file and add the following lines
option domain-name "test1.com";Each one of the above line is explained below
option domain-name-servers 192.0.0.1, 194.2.0.50;
option routers 192.0.0.151;
default-lease-time 3600;
subnet 192.0.0.0 netmask 255.255.255.0 {
arrange 192.0.0.200 192.0.0.254;
}
first line provides the name field for the clients, second line gives DNS for for the clients, third one is for router ip,fourth one is lease time fifth line is subnet and netmask details, sixth line is ipaddress range for your clients
If you want more details in dhcpd.conf file check the man page of this file
If you want to configure static ipaddress for some machines follow this
host hostname {Each one of the above line is explained below
hardware ethernet 00:B0:CF:8B:49:37;
fixed-address 192.0.0.19;
}
First line name of the host you want to configure static ip address,second one is MAC address of that perticular machine,if you want to find the MAC address of that machine you need to run the "ifconfig" command,third one is ipaddress you want to assign to that perticular machine.
You need to restart the DHCP daemon to take effect of your new changes.
/etc/init.d/dhcp3-server restartIf it restarts without any errors your configuration is correct. If you get any errors you need to check the log files for more error information
tail /var/log/messagesThe following file give you the complete details about the DHCP clients connecting to the DHCP server this details includes the following
IP address of the client machine
MAC address of the client machine
Name of the client machine
Beginning and ending of ipaddress lease time
Client Machine Configuration
You need to modify the following file
vi /etc/network/interfacesYou need to add the following lines and save the file.
auto lo eth0Now you need to restart the networking service to take these new changes
iface lo inet loopback
iface eth0 inet dhcp
/etc/init.d/networking restartIf you want to check your machine is configured properly you need to run the following command
ifconfigFinally you can check your log file(/var/log/messages) everything is properly configured or not.
Selamat Mencoba.

0 komentar:
Posting Komentar