I. Introduction to PXE
1 principle of PXE principle PXE is the latest technology developed by Intel Corporation to work with Client/server network mode support workstations to download images from remote servers over the network, And thus supports the startup process of the operating system from the network the principle of DHCP Dynamic Host Configuration Protocol is a network protocol of LAN, the use of UDP protocol work mainly has two purposes: to the internal network or service provider automatically assigned IP address to the user to the internal network administrator as to all computers
As a means of central management.
How DHCP Assignment addresses work
Dhcpdiscover Dhcpoffer dhcprequest DHCPAck
The principle of TFTP
Tftptrivial File Transfer Protocol,
The Simple File Transfer Protocol is a protocol family of TCP/IP protocol that provides simple file transfer between the client and server, providing an uncomplicated, inexpensive file transfer service. The port number is 69. Ftp+nfs+http principle FTP File Transfer Protocol NFS Network File system HTTP Hypertext Transfer Protocol Kickstart principle kickstart is a kind of unattended installation mode.
Working principle:
A file named Ks.cfg is generated by documenting the various parameters that are required for manual intervention during the typical installation process, and when the appropriate parameters are found in the subsequent installation process, the found parameters are used, and when no suitable parameters are found, the installer is required to intervene manually. This way, if the kickstart file covers all the parameters that are required to be filled in during installation, the installer can simply tell the installer where to fetch the ks.cfg file and then go to work on it. When the installation is complete, the installer restarts the system and ends the installation according to the restart option set in Ks.cfg.
Understanding the entire installation process
Second, the DHCP working principle diagram
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-12887 "border=" 0 "alt=" wps_clip_image-12887 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811766pyhr.png "" 611 "height=" 348 "/>
1, Client:dhcp DISCOVER
The client sends a request to provide IP-assigned broadcast to the router, and the router notifies the Linux server via unicast
2, Server:dhcp offer
The server responds to the request, the unicast notifies the router, and the router notifies the client by broadcasting the IP assignment request
3. Client:dhcp REQUEST
A client broadcast request obtains an IP address, and the router receives a request for unicast forwarding to the DHCP server
4, Server:dhcp ACK
Server responds to requests to assign IP acknowledgement unicast to router, router broadcast forwards to client
Three, PEX working principle diagram
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-4917 "border=" 0 "alt=" wps_clip_image-4917 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811776bg9d.png "" 616 "height=" 390 "/>
1, PXE boot, go to the radio to find the DHCP server to obtain the IP address pxelinux.0 file
2. The client connects to the server via TFTP and downloads the pxelinux.0 file.
3, the client download successful pxelinux.0 file, the system will also download the control pxelinux.0 configuration file, called default, then the client will follow the default configuration to execute the pxelinux.0 file.
4. Now the client will get the IP address once. and locate the Kickstar configuration based on the DHCP server configuration file
5. The pxelinux.0 file defines the response server to request parameters such as the Linux kernel, the root file system, and so on. Run this file, the client will request the relevant files and download to the server, all use the TFTP protocol.
6, the file downloaded successfully, the client will start the Linux kernel, which entered the installation time we saw the first figure
interface, the interface and its own installation see the first screen, the carriage return is a graphical installation, the input text is
Text to install there. If kickstart is used, the interface disappears quickly and may not be visible. The PXE boot is complete here.
7, the following on the protagonist kickstart appearances. In fact, kickstart in the fourth step has appeared, when the default requirements to run the pxelinux.0 file, the system reads the kernel, hangs in the root file system, the task will be handed over to the kickstart.
This includes the installation media source, language, time zone, partition, which packages are installed, and so on, all defined in the Kickstart file. Just enter this step, the Kickstart configuration file is correct, our unattended installation has succeeded
First, DHCP installation
1. Installation program
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-4682 "border=" 0 "alt=" wps_clip_image-4682 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811784raou.png "" 532 "height=" 333 "/>
2. Modify the configuration script
Configuring the DHCP service
Subnet ... netmask ... {
...
Next-server Tftp-server-ip;
FileName "pxelinux.0";
}
Hint Script sample document CAT/ETC/DHCP/DHCPD.CONF
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-11248 "border=" 0 "alt=" wps_clip_image-11248 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811787qa5i.png "" 435 "height=" 211 "/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-26237 "border=" 0 "alt=" wps_clip_image-26237 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811800cnra.png "" 431 "height=" 211 "/>
Second, TFTP installation
1. Program Installation
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-31685 "border=" 0 "alt=" wps_clip_image-31685 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811805vbib.png "" 431 "height=" 208 "/>
2. Default file directory
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-6863 "border=" 0 "alt=" wps_clip_image-6863 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811810gmwt.png "" 435 "height="/>
3. Basic Demo operation
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-22528 "border=" 0 "alt=" wps_clip_image-22528 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811818j3e2.png "" "height=" "/>"
4. Service Start-up
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-27829 "border=" 0 "alt=" wps_clip_image-27829 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811825rele.png "" 443 "height=" 227 "/>
Third, to provide a PXE working environment
1, program installation yum install Syslinux
2. Copy Cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-14380 "border=" 0 "alt=" wps_clip_image-14380 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811830ytmv.png "" 425 "height=" 103 "/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-11702 "border=" 0 "alt=" wps_clip_image-11702 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811834s23q.png "" 425 "height="/>
3, pxelinux.cfg under the default file configuration key step to specify the KS location
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-12890 "border=" 0 "alt=" wps_clip_image-12890 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_14068118412zbh.png "434" height= "/>"
Iv. provide the boot kernel and other files
Mount the system CD, assuming the location is/media/cdrom/
CP/MEDIA/CDROM/IMAGES/PXEBOOT/{VMLINUZ,INITRD.IMG}/var/lib/tftpboot/
CP/MEDIA/CDROM/ISOLINUX/{SPLASH.JPG,VESAMENU.C32,BOOT.MSG}/var/lib/tftpboot
mkdir/var/lib/tftpboot/pxelinux.cfg/
Cp/media/cdrom/isolinux/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/default
1. File copy
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-15665 "border=" 0 "alt=" wps_clip_image-15665 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811852kslg.png "" 479 "height=" 234 "/>
2. Results after copying
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-22546 "border=" 0 "alt=" wps_clip_image-22546 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811864rdia.png "" 481 "height=" 165 "/>
5. Provide installation source
Based on HTTP service implementation
1. Installation program
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-2543 "border=" 0 "alt=" wps_clip_image-2543 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811867dqm6.png "" 476 "height="/>
2. Start the service
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-3784 "border=" 0 "alt=" wps_clip_image-3784 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_14068118739eyd.png "" 478 "height=" 191 "/>
3, the display after the merger mount
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-2844 "border=" 0 "alt=" wps_clip_image-2844 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811907vu1k.png "" 481 "height=" 257 "/>
6. Provide ks.cfg file
1, specifying the URL and repo the key step this directory is placed in/var/www/html/ks.cfg
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-9975 "border=" 0 "alt=" wps_clip_image-9975 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811923jegz.png "" 586 "height=" 333 "/>
2. Some configuration of this automation script
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-19601 "border=" 0 "alt=" wps_clip_image-19601 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_14068119340bsk.png "" 586 "height=" 288 "/>
Vii. Results of experimental verification
1, test machine and server IP assigned to the same network card
2. Set the test machine NIC as the first startup item
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-11572 "border=" 0 "alt=" wps_clip_image-11572 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811944e6pv.png "" 584 "height=" 243 "/>
3. Make sure three services are started.
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-8232 "border=" 0 "alt=" wps_clip_image-8232 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811956359f.png "" 587 "height=" 177 "/>
4. Automatic Installation Interface
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-11554 "border=" 0 "alt=" wps_clip_image-11554 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811966q3hd.png "" 587 "height=" 334 "/>
5. Experimental results
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps_clip_image-10086 "border=" 0 "alt=" wps_clip_image-10086 "src=" http://img1.51cto.com/ Attachment/201407/31/8400375_1406811968qayb.png "" 581 "height=" 223 "/>