First, Introduction:
DHCP : Dynamic hostconfiguration Protocol , Dynamic Host Setup protocol, which is a network protocol for a LAN, uses UDP The main purpose is to automatically assign network-related configuration address to the internal network or network service provider, and achieve the purpose of managing the host efficiently.
BOOTP : DHCP the predecessor; disadvantage: one-time allocation for lifelong use.
DHCP propose the concept of lease, can dynamically determine the requirements of the host based on Demand IP address, and IP addresses can be recycled.
Second, the working principle:
DHCP : Using C/S architecture, i.e. DHCLIENT/DHCPD ;
Working principle:
1 , Client : dhcp DISCOVER discover package, find dhcp server;
2 , Server : DHCP Offer , DHCP Server Received DISCOVER package, it will reply to the client Offer Package,
3, client:DHCPREQUEST, after clients receive an offer broadcast from DHCP , will determineDHCPserver, continue to thisDHCPServer SendREQUESTPackage ApplicationIPinformation;
4 , Server : dhcp ACK dhcp mac address lookup determines whether the secondary client is assigned a new ip ip
Lease: IP the term of use of the information; By default, the client will forward the lease to the DHCP the server submits a renewal request if DHCP The server does not respond to the renewal application, the client will continue to submit the renewal application, if the server has not responded, the client will waive the renewal request, again to the local area network to initiate DHCP DISCOVER to find the other DHCP server;
Three, installation configuration:
1 , Installation:
Required Packages:DHCP
# yum Install DHCP: installing DHCP;
# RPM–QL DHCP: View the files created by installing the DHCP package;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/C6/wKiom1Wn4qDTBYOcAAPENFOml6c496.jpg "title=" 1.jpg " alt= "Wkiom1wn4qdtbyocaapenfoml6c496.jpg"/>
2 , Configuration DHCP Server:
#/etc/dhcp/dhcpd.conf: Master config file;
#/usr/share/doc/dhcp-**/dhcpd.conf.sample: Can exhibit this master profile template to modify the configuration;
Global configuration:
>option domain-name "chencer.org"; : DHCP host name >option domain-name-servers 192.168.0.110; : DNS server address >default-lease-time 3600; : Default lease time in seconds; >max-lease-time 86400; : Maximum lease time, unit seconds; >log-facility Local7; : Log level;
Address pool configuration:
>subnet 192.168.0.0 netmask255.255.255.0 {> range 192.168.0.100 192.168.0.200; : Address pool IP range;> option routers 192.168.0.1; : Gateway configuration;
reserved IP address configuration:
reserved addresses: addresses that are specific to a particular client, should not use addresses in the address pool, and precedence over addresses in the address pool;
in the address pool {} add configuration information internally;
>host chencer {> Hardware Ethernet 00:0c:29:a6:37:75; : Specify host MAC address;> fixed-address 192.168.0.150; : Sets the IP address of the binding host;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/C6/wKiom1Wn5FbAghlFAAB01pkx_vE945.jpg "title=" 2.jpg " alt= "Wkiom1wn5fbaghlfaab01pkx_ve945.jpg"/>
# service DHCPD configtest: Edit complete, save exit, check configuration file syntax;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/C4/wKioL1Wn5n-x3To_AAAxTNEzbfk845.jpg "title=" 3.jpg " alt= "Wkiol1wn5n-x3to_aaaxtnezbfk845.jpg"/>
Iv. Start-up service;
# chkconfig DHCPD on: Set boot start;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/C6/wKiom1Wn5NfhhFMaAABmC2a7UjI447.jpg "title=" 4.jpg " alt= "Wkiom1wn5nfhhfmaaabmc2a7uji447.jpg"/>
# service DHCPD {Start|restart}: Start or restart services;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/C6/wKiom1Wn5QyBgH7AAAA5b5nuoE4859.jpg "title=" 5.jpg " alt= "Wkiom1wn5qybgh7aaaa5b5nuoe4859.jpg"/>
#ss –UNL: View listening port; DHCPD Port: 67/udp dhclient Port: 68/udp
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/C4/wKioL1Wn54_DQ1maAABnV3BIHIw619.jpg "title=" 6.jpg " alt= "Wkiol1wn54_dq1maaabnv3bihiw619.jpg"/>
# tail/var/log/messages: View service log;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/C6/wKiom1Wn5eeCyY6kAAKIh4QGRrk525.jpg "title=" 7.jpg " alt= "Wkiom1wn5eecyy6kaakih4qgrrk525.jpg"/>
# ifconfig: View network parameters;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/C4/wKioL1Wn5_iyIn64AAEz60yNHT0342.jpg "title=" 8.jpg " alt= "Wkiol1wn5_iyin64aaez60ynht0342.jpg"/>
# ifconfig: reserved address network parameters;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/C6/wKiom1Wn5j-QLuE1AAEzB3GTeR0129.jpg "title=" 9.jpg " alt= "Wkiom1wn5j-qlue1aaezb3gter0129.jpg"/>
# cat/var/lib/dhcpd/dhcpd.leases: view lease information;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/C4/wKioL1Wn6GnhN-hRAACMSuyHAks312.jpg "title=" 10.jpg "alt=" Wkiol1wn6gnhn-hraacmsuyhaks312.jpg "/>
This article is from the "Pony Learning Record" blog, make sure to keep this source http://masachencer.blog.51cto.com/8683770/1675500
DHCP Management configuration