1. DownloadDHCP
Yum-y Install DHCP
2. ConfigurationDHCP MasterServer
Download finished DHCP after service
Step One: cd/etc/sysconfig/network-scripts/
VI Ifcfg-eth0
You need to automatically assign an address to Bootproto by DHCP to none.
ipaddr fill in the address of the DHCP server.
Fill in the default gateway and subnet mask.
Such as:
650) this.width=650; "title=" 1.png "src=" Http://s3.51cto.com/wyfs02/M00/71/38/wKiom1XJU1DBdjeKAAE2hnuZz3A011.jpg " alt= "Wkiom1xju1dbdjekaae2hnuzz3a011.jpg"/>
Step Two: 1.cd/etc/dhcp
2.VI dhcpd.conf
3. modified dhcpd.conf content
#
# DHCP Server Configuration file.
# See/usr/share/doc/dhcp*/dhcpd.conf.sample
# See ' Mans 5 dhcpd.conf '
#
Option Domain-name "archermind.com";
Option Domain-name-servers 192.168.100.101;
FileName "pxelinux.0";
Next-server 172.21.80.30;
Default-lease-time 600;
Max-lease-time 7200;
authoritative;
Subnet 172.21.70.0 netmask 255.255.255.0{
Range DYNAMIC-BOOTP 172.21.70.18 172.21.70.130;
Option Broadcast-address 172.21.70.255;
Option routers 172.21.70.1;
}
Host Test1
{
Hardware Ethernet E8:39:35:43:F9:C8;
Fixed-address 172.21.70.131;
}
Specifies the range of dynamic IPs assigned, at the bottom can be statically fixed assigning IP to the specified MAC address.
The overall process is as follows:
650) this.width=650; "title=" 2.png "src=" Http://s3.51cto.com/wyfs02/M00/71/38/wKiom1XJVKTQJHy4AABjJtIYj_o614.jpg " alt= "Wkiom1xjvktqjhy4aabjjtiyj_o614.jpg"/>
650) this.width=650; "title=" 3.png "src=" Http://s3.51cto.com/wyfs02/M02/71/38/wKiom1XJVHqSC6tYAAJmykELbzE243.jpg " alt= "Wkiom1xjvhqsc6tyaajmykelbze243.jpg"/>
Step three: After the configuration is all complete
Service DHCPD Restart
3. Verifying dynamic fetchingIPand static Access
Looking for another device to connect to the DHCP server, i.e. from the server, dynamic fetch and static fetch all enter the command on the new device:/etc/init.d/network restart
Such as:
650) this.width=650; "title=" 5.png "src=" Http://s3.51cto.com/wyfs02/M02/71/38/wKiom1XJVOSw6Ve9AAB_-3yM7FE029.jpg " alt= "Wkiom1xjvosw6ve9aab_-3ym7fe029.jpg"/>
Results of dynamic allocations:
650) this.width=650; "title=" 6.png "src=" Http://s3.51cto.com/wyfs02/M01/71/38/wKiom1XJVQXQ8GiCAAHIS8Q1DVo096.jpg " alt= "Wkiom1xjvqxq8gicaahis8q1dvo096.jpg"/>
Static allocation result: Before dhcpd.conf to fixed Mac on DHCP server
E8:39:35:43:f9:c8 the results of the configuration are as follows:
650) this.width=650; "title=" 7.png "src=" Http://s3.51cto.com/wyfs02/M01/71/38/wKiom1XJVYSjWf6dAAHNx7V2TsQ007.jpg " alt= "Wkiom1xjvysjwf6daahnx7v2tsq007.jpg"/>
There is no difference between confirmation and configuration in dhcpd.conf.
Host Test1
{
Hardware Ethernet E8:39:35:43:F9:C8;
Fixed-address 172.21.70.131;
}
4. view the dynamic and static that have been assignedIP
To View assignments: cat/var/lib/dhcpd/dhcpd.leases
Check out the split IP Address : cat/var/lib/dhcpd/dhcpd.leases | grep ^l | sort-u | sed ' s/{//g '
Check out the split MAC Address : cat/var/lib/dhcpd/dhcpd.leases | grep hard | sort-u
Such as:
650) this.width=650; "title=" 8.png "src=" Http://s3.51cto.com/wyfs02/M02/71/35/wKioL1XJV56ClGAtAAEJ6-BzGqs208.jpg " alt= "Wkiol1xjv56clgataaej6-bzgqs208.jpg"/>
This article is from the "7582964" blog, please be sure to keep this source http://7592964.blog.51cto.com/7582964/1683523
Centors6.5 installation and configuration of DHCP servers