Service Introduction
DHCP Service Overview:
Name: dhcp-dynamichost Configuration Protocol Dynamic Host Configuration Protocol
Features: DHCP (Dynamic Host configuration Protocol. dll ) is a local area network protocol that uses UDP the work of the agreement, mainly has two uses:
1 , automatically assigned to an internal network or network service provider IP address, host name, DNS server, domain name
2 , matching and other services to achieve integrated management functions. Such as: Unattended Installation Server
3 , Features: C/S Mode Client / service side
DHCP Service usage: Port ( Bootps) (BOOTPC) .
the is the service side the is the client
Application Case List
company has 60 computer, ip address segment is 192.168.20.1-192.168.20.254 255.255.255.0 192.168.20.1 ,
Now there's a Span style= "FONT-SIZE:11PX;" >DHCP server address is 192.168.20.63, Now you need to assign to the rest of the computer dynamically. ip address, address range 192.168.20.100-192.168.20.200 ip address is 192.168.10.88 for reserved use.
Experimental simulation
Dhcp Server localhost.cn.cn:192.168.10.63 virtual machine nic: Vmnet1
Client localhost1.cn. : Employee Pending Assignment
Client localhost2.cn : Boss 192.168.20.88
Configure DHCP
Installation
[[email protected] ~]# yum-y install DHCP Install packages
To view the ports used by DHCP
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/76/05/wKiom1ZIUXCyKDnvAAAnvdQ9Ne0647.png "title=" 1.png " alt= "Wkiom1ziuxcykdnvaaanvdq9ne0647.png"/>
Configuration file Location :
/etc/dhcp/dhcpd.conf
when DHCP when the main package is installed, the template file for the master profile is automatically generated
/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample
and in / etc The directory will create a blank dhcpd.conf master configuration file.
Ls/etc/dhcp/dhcpd.conf
Copy the template configuration file to / etc replace blank under directory dhcpd.conf master configuration file.
[email protected] ~]# Cp/etc/dhcp/dhcpd.conf/etc/dhcp/dhcpd.conf.bak backup files before copying
[Email protected] ~]# cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.conf
CP : whether to overwrite "/etc/dhcp/dhcpd.conf" ? y
Get localhost2.cn of the MAC Address
HWaddr 00:0c:29:35:18:4a
[[Email protected]~]# vim/etc/dhcp/dhcpd.conf Modifying a configuration file
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/76/03/wKioL1ZIUi_w6JNlAABre84n2to866.png "title=" 2.png " alt= "Wkiol1ziui_w6jnlaabre84n2to866.png"/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/76/03/wKioL1ZIUkDDDtd5AABWZPO7tdE285.png "title=" 3.png " alt= "Wkiol1ziukdddtd5aabwzpo7tde285.png"/>
[Email protected] ~]#/ETC/INIT.D/DHCPD restart
starting dhcpd: [ failed ]
Solutions
1. The first time the virtual machine NIC mode uses the Vmnet1 , modify it to Vmnet4 Mode
2. modify its corresponding settings ( etc/dhcp/dhcpd.conf )
[[Email protected]~]#/etc/init.d/dhcpd Start
starting dhcpd: [ OK ]
Configuring the Client
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/76/03/wKioL1ZIUuHiBHC7AABg3SUASig358.png "style=" float: none; "title=" 5.png "alt=" Wkiol1ziuuhibhc7aabg3suasig358.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/76/05/wKiom1ZIUpbQT_C6AAA3EkPwzxU962.png "style=" float: none; "title=" 6.png "alt=" Wkiom1ziupbqt_c6aaa3ekpwzxu962.png "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/76/05/wKiom1ZIUpjhFV6-AAC3fr1LjnE407.png "style=" float: none; "title=" 7.png "alt=" Wkiom1ziupjhfv6-aac3fr1ljne407.png "/>
This article is from the "10852974" blog, please be sure to keep this source http://10862974.blog.51cto.com/10852974/1712924
Build DHCP service to dynamically assign IP addresses