Configure DHCP server
I,InstallDHCPSoftware Package
Rpm-ivh/misc/cd/Server/dhcp-3.0.5-23.e15.i386.rpm
II,Create a master configuration fileDhcp. conf
[Root @ localhost ~] # Cp/usr/share/doc/dhcpd-3.0.5/dhcpd. conf. samole/etc/dhcpd. conf
[Root @ localhost ~] # Vim/etc/dhcpd. conf
Ddns-update-style none; // disable Dynamic DNS update.
Option domain-name "bene.com"; // specify the default search domain
Option domain-name-servers 192.168.1.1, 202.96.128.68; // DNS address
Default-lease-time 21600; // default lease for 6 hours
Max-lease-time 43200; // The maximum lease size is 12 hours.
Subnet 192.168.0.0 netmask 255.255.255.0 {
Option routers 192.168.0.1; // specify the Default Gateway
Option subnet-mask 255.255.255.0; // subnet
Range 192.168.0.128192.168.0.254; // address range
Host ns {
Next-server marvin.redhat.com;
Hardware ethernet 12: 34: 56: 78: AB: CD; // reserved for the client address
Fixed-address 192.168.0.129;
}
III,StartDhcpdService(Service dhcpd configtest can check the configuration script)
[Root @ localhost ~] # Service dhcpd start
[Root @ localhost ~] # Chkconfig dhcpd on // Add the running level
[Root @ localhost ~] # Netstat-naup | grep ": 67" // view the dhcpd service port
IV,ConfigurationDHCPClient
[Root @ localhost ~] # Vim/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE = eth0
ONBOOT = yes // start on startup
BOOTPROTO = dhcp
[Root @ localhost ~] # Dhclient-d eth0 // automatically obtain the new IP Address
[Root @ localhost ~] # Dhclient-r eth0 // release and obtain the IP address again
[Root @ localhost ~] # Less/var/lib/dhcpd. leases // view allocated IP addresses