- 论坛徽章:
- 0
|
1,Installing DHCP server in Debian
#apt-get install dhcp3-server
Once 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
subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name "globalrealsource.local";
option domain-name-servers 192.168.1.20, 192.168.1.5;
option routers 192.168.1.5;
range 192.168.1.100 192.168.1.200;
option ntp-servers 192.168.1.5;
option netbios-scope "";
option netbios-node-type 8;
key "globalrealsource.local" {
algorithm hmac-md5;
secret
"rruXyAiuAZnKPjDCyS4LBpp8WmOr7xPHulXuG9KAAVWcWc/yyzOG31MUJ4k6F2HzGaBLtwgQDW7LPhk+vC/0ug==";
};
zone globalrealsource.local {
primary 192.168.1.20;
key "globalrealsource.local";
}
zone 1.168.192.in-addr.arpa {
primary 192.168.1.20;
key "globalrealsource.local";
}
}
2,If you want to configure static ipaddress for some machines follow this
host hostname {
hardware ethernet 00:B0:CF:8B:49:37;
fixed-address 192.168.1.100;
}
You need to restart the DHCP daemon to take effect of your new changes.
#/etc/init.d/dhcp3-server restart
If 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/syslog
The 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
3,Client Machine Configuration
You need to modify the following file
# vi /etc/network/interfaces
You need to add the following lines and save the file.
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
Now you need to restart the networking service to take these new changes
#/etc/init.d/networking restart
If you want to check your machine is configured properly you need to run the following command
#ifconfig
Finally you can check your log file(/var/log/messages) everything is properly configured or not. |
|