DHCP Server Installation
Step 1
[root@local~]# yum install dhcp
Install dhcp service rpm via yum.
[root@local~]# vi /etc/dhcpd.conf
ddns-update-style none;
default-lease-time 259200; ## 3 days lease
max-lease-time 518400; ## 5 days max lease
option routers 192.168.1.1; ## Gateway
option broadcast-address 192.168.1.255; ## Broadcast
option domain-name-servers 202.177.26.100, 202.177.26.110; ## DNS
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.199; ## DHCP client range
option subnet-mask 255.255.255.0;
option nis-domain "domain";
option domain-name "domain";
## HW address map to fix IP, delete this tab if no one is fix IP
host client {
hardware ethernet 00:40:95:30:43:B4;
fixed-address 192.168.1.5;
}
}
By default the DHCP broadcast is monitoring as "eth0" , if you want enable in mutli network interface, you can edit :
[root@local~]# vi /etc/init.d/dhcpd
daemon /usr/sbin/dhcpd ${DHCPDARGS} 2>/dev/null
daemon /usr/sbin/dhcpd eth1 2>/dev/null
daemon /usr/sbin/dhcpd eth2 2>/dev/null
Step 2
[root@local~]# /etc/init.d/dhcpd start
[root@local~]# chkconfig dhcpd on
Start dhcp service and enable auto-start.
[root@local~]# netstat -tlunp |grep dhcp
[root@local~]# tail -n50 /var/log/message
Check the service is running normally or not.
[root@local~]# cat /var/lib/dhcp/dhcpd.leases
Check the status of client access.
Server is hosted by Alanstudio
Linux Operating System
Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.
|