Dhcp+vsftpd+tftp+kickstart build PXE environment for batch automation system installation

Source: Internet
Author: User
Tags file transfer protocol


First, Introduction

1.1 What is PXE

PXE (Pre-Boot execution Environment, pre-boot execution Environment) is the latest technology developed by Intel Corporation, working in the Client/server network mode, enabling workstations to download images from remote servers over the network, This supports booting the operating system over the network, and during the boot process, the terminal requires the server to assign an IP address, then TFTP (trivial File Transfer Protocol) or MTFTP (Multicast trivial file transfer Protocol) protocol to download a boot package into native memory executed by this boot package to complete the terminal basic software setup, thus booting the terminal operating system preinstalled in the server.

Strictly speaking, PXE is not a way to install, but a way to boot. A requirement for a PXE installation is that a PXE-supported network card (NIC) must be included on the computer to be installed, that is, the PXE Client must be in the network card. The PXE protocol enables a computer to boot over the network. This protocol is divided between the client side and the Server side, while the PXE client is in the ROM of the NIC. When the computer boots, the BIOS directs the PXE client into memory and then the files that are placed at the remote end by the PXE client are downloaded locally to run on the network. Running the PXE protocol requires setting up a DHCP server and a TFTP server. The DHCP server assigns an IP address to the PXE client (the host that will install the system), and because it assigns an IP address to the PXE client, the appropriate PXE settings need to be added when configuring the DHCP server. In addition, the TFTP client already exists in the PXE client ROM, so it can download the required files via the TFTP protocol to the TFTP Server.


1.2 PXE working process:

1. PXE Client starts from its own PXE network card and requests IP from the DHCP server in the network;

2. The DHCP server returns the IP that is assigned to the client and the location of the PXE file (the file is typically placed on a TFTP server);

3. The PXE Client requests the pxelinux.0 file from the TFTP server in the network;

4. The PXE Client obtains the pxelinux.0 file after the implementation of the file;

5. Load the kernel and file system via the TFTP server based on the results of pxelinux.0 execution;

6. Enter the installation screen, which can be installed by selecting one of the HTTP, FTP, and NFS modes;

Detailed workflow, please refer to the following picture


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/86/F0/wKiom1fPSwHweQ-7AAE6VKzeTpc312.jpg "style=" float: none; "title=" 152331542808644.jpg "alt=" Wkiom1fpswhweq-7aae6vkzetpc312.jpg "/>


1.3 What is Kickstart

Kickstart is an unattended installation method. It works by documenting typical parameters that require manual intervention during the installation process and generating a file named Ks.cfg. If you have to fill in the parameters during the installation process (not limited to the machine that generated the Kickstart installation files), the installer will first look for the files generated by the kickstart, and if the appropriate parameters are found, use the found parameters; Need to be manually intervened by the installer. So, if the kickstart file covers all the parameters that may be required during installation, then 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 according to the settings in the Ks.cfg and ends the installation.

Pxe+kickstart unattended installation of the operating system the complete process is as follows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/86/EF/wKioL1fPSwHx-bBsAACiLfTKxO4085.jpg "style=" float: none; "title=" 152331554052088.jpg "alt=" Wkiol1fpswhx-bbsaacilftkxo4085.jpg "/>

Second, the system environment

System Platform: RHEL7.0 (minimized installation)

System Kernel : 3.10.0-123.el7.x86_64

Experimental content:

Generate Ks.cfg File

Configuring HTTP Installation Methods

Configuring TFTP

Configuring PXE-enabled boot programs

Configure DHCP

Test installation


Network mode: bridging mode

Dhcp/tftp/http/nfs ip:172.25.254.100

The firewall is turned off/iptables:firewall is not running.

Selinux=disabled


2.1. Generate Ks.cfg File

[email protected] ~]# Yum install system-config-kickstart.noarch-y

[Email protected] ~]# System-config-kickstart

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/6A/wKiom1ffaxLAQGxBAAC_CB20cuY866.png "style=" width : 600px;height:203px; "title=" screenshot from 2016-09-19 12:30:09.png "width=" + "height=" 203 "border=" 0 "hspace=" 0 " Vspace= "0" alt= "wkiom1ffaxlaqgxbaac_cb20cuy866.png"/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/87/66/wKioL1ffaxuDYTZ0AADdSHHBkcA165.png "title=" Screenshot from 2016-09-19 12:24:10.png "width=" "height=" 288 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px; height:288px; "alt=" Wkiol1ffaxudytz0aaddshhbkca165.png "/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/87/6A/wKiom1ffaxqyUtgeAADld6liJYA763.png "title=" Screenshot from 2016-09-19 12:24:40.png "width=" "height=" 282 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px; height:282px; "alt=" Wkiom1ffaxqyutgeaadld6lijya763.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/87/66/wKioL1ffaxeh1QhVAACen0c_Ohw744.png "title=" Screenshot from 2016-09-19 12:25:43.png "style=" Float:none; "alt=" Wkiol1ffaxeh1qhvaacen0c_ohw744.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/6A/wKiom1ffaxjSR-uHAACfIE1DiAE037.png "title=" Screenshot from 2016-09-19 12:25:26.png "style=" Float:none; "alt=" Wkiom1ffaxjsr-uhaacfie1diae037.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/87/66/wKioL1ffaxmAHNUzAACg-dQFDCs592.png "title=" Screenshot from 2016-09-19 12:25:04.png "style=" Float:none; "alt=" Wkiol1ffaxmahnuzaacg-dqfdcs592.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/87/6A/wKiom1ffaxfSbvGXAADuQQN22Qc647.png "title=" Screenshot from 2016-09-19 12:25:58.png "width=" "height=" 261 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px; height:261px; "alt=" Wkiom1ffaxfsbvgxaaduqqn22qc647.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/87/66/wKioL1ffaxWzlioqAAB0Sh19fjk942.png "title=" Screenshot from 2016-09-19 12:26:53.png "width=" "height=" 136 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px; height:136px; "alt=" Wkiol1ffaxwzlioqaab0sh19fjk942.png "/>



650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/6A/wKiom1ffaxSQODVTAADs_5JHzmg820.png "title=" Screenshot from 2016-09-19 12:27:54.png "width=" "height=" 193 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px; height:193px; "alt=" Wkiom1ffaxsqodvtaads_5jhzmg820.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/87/6A/wKiom1ffaxXwukDQAADtyYN7cHE733.png "title=" Screenshot from 2016-09-19 12:27:37.png "width=" "height=" 197 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px; height:197px; "alt=" Wkiom1ffaxxwukdqaadtyyn7che733.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/66/wKioL1ffaxLQEqs4AACOMYozDwY299.png "style=" width : 600px;height:448px; "title=" screenshot from 2016-09-19 12:29:40.png "width=" + "height=" 448 "border=" 0 "hspace=" 0 " Vspace= "0" alt= "wkiol1ffaxlqeqs4aacomyozdwy299.png"/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/66/wKioL1ffaxPD01W4AAAAhFGBj1M350.png "style=" float: none; "Title=" screenshot from 2016-09-19 12:28:16.png "alt=" Wkiol1ffaxpd01w4aaaahfgbj1m350.png "/>


2.2, Configuration Vsftpd installation method

[email protected] ~]# Yum install vsftpd-y

[Email protected] ~]# mkdir/var/ftp/pub/yumsource6.5

[Email protected] ~]# mount/dev/cdrom/var/ftp/pub/yumsource6.5

[Email protected] ~]# cd/var/ftp/pub/

[[email protected] pub]# ls

Ks.cfg yumsource6.5

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/67/wKioL1ffcyCCAxOqAAC4OeVUVK0043.png "title=" Screenshot from 2016-09-19 13:09:06.png "width=" 650 "height=" 301 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:650px; height:301px; "alt=" Wkiol1ffcyccaxoqaac4oevuvk0043.png "/>


2.3. Configuring TFTP

[email protected] ~]# Yum install tftp-server vsftpd-y

[[email protected] ~]#/etc/init.d/vsftpd start

[Email protected] ~]# vim/etc/xinetd.d/tftp

Disable = no

[Email protected] ~]#/etc/init.d/xinetd restart


2.4. Configure DHCP

[email protected] ~]# Yum install dhcp-y

[Email protected] ~]# cp-p/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.conf

[Email protected] ~]# vim/etc/dhcp/dhcpd.conf

    1. Option Domain-name "server100.example.com";

    2. Option Domain-name-servers 172.25.254.6;


    3. Default-lease-time 60;

    4. Max-lease-time 7200;

    5. Log-facility Local7;


    6. Subnet 172.25.254.0 netmask 255.255.255.0 {

    7. Range 172.25.254.66 172.25.254.88;

    8. Option routers 172.25.254.6;

    9. }

[[email protected] ~]#/ETC/INIT.D/DHCPD start


2.5. Configuring PXE-enabled boot programs

[Email protected] pub]# cd/var/ftp/pub/yumsource6.5/

[Email protected] yumsource6.5]# cp-r isolinux/*/var/lib/tftpboot/

[email protected] yumsource6.5]# Yum install syslinux-y

[Email protected] yumsource6.5]# cp/usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

[Email protected] yumsource6.5]# vim/etc/dhcp/dhcpd.conf

Subnet 172.25.254.0 netmask 255.255.255.0 {

Range 172.25.254.66 172.25.254.88;

Option routers 172.25.254.6;

Next-server 172.25.254.100;

FileName "pxelinux.0";

}

[Email protected] tftpboot]# mkdir pxelinux.cfg

[email protected] tftpboot]# CP isolinux.cfg Pxelinux.cfg/default

[Email protected] tftpboot]#/ETC/INIT.D/DHCPD restart

[Email protected] tftpboot]# chmod 777 Pxelinux.cfg/default

[Email protected] tftpboot]# vim Pxelinux.cfg/default

Timeout 60

Menu default

Kernel Vmlinuz

Append initrd=initrd.img repo=ftp://172.25.254.100/pub/yumsource6.5 Quiet ks=ftp://172.25.254

.100/pub/ks.cfg

[Email protected] tftpboot]#/ETC/INIT.D/DHCPD restart

[Email protected] pub]#/etc/init.d/vsftpd restart

[Email protected] pub]#/etc/init.d/xinetd restart


Third, test installation

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/87/BA/wKiom1fft7KBu5c2AAD8zsZrh-M843.png "title=" Screenshot from 2016-09-19 17:59:03.png "width=" to "height=" 331 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:400px; height:331px; "alt=" Wkiom1fft7kbu5c2aad8zszrh-m843.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/B7/wKioL1fft4ahNixEAAB1J8RDDqQ172.png "title=" Screenshot from 2016-09-19 17:59:37.png "width=" to "height=" 421 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:400px; height:421px; "alt=" Wkiol1fft4ahnixeaab1j8rddqq172.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/B7/wKioL1fft5aDUsESAAB4p2sIerA706.png "title=" Screenshot from 2016-09-19 17:59:30.png "width=" to "height=" 417 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:400px; height:417px; "alt=" Wkiol1fft5adusesaab4p2siera706.png "/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/87/BA/wKiom1fft6WxchOjAABdQOjYUdk864.png "title=" Screenshot from 2016-09-19 17:59:16.png "width=" to "height=" to "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:400px; height:400px; "alt=" Wkiom1fft6wxchojaabdqojyudk864.png "/>


To start the installation:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/87/B7/wKioL1ffuGKR0fkAAAAmqa1yklM743.png "title=" Screenshot from 2016-09-19 18:04:52.png "width=" "height=" 345 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px; height:345px, "alt=" Wkiol1ffugkr0fkaaaamqa1yklm743.png "/>650" this.width=650; "src=" Http://s1.51cto.com/wyfs02 /m00/87/ba/wkiom1ffuglxzcdraamaobna-la216.png "style=" WIDTH:600PX;HEIGHT:414PX; "title=" Screenshot from 2016-09-19 18:05:00.png "width=" "height=" 414 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" wkiom1ffuglxzcdraamaobna-la216.png "/ >

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/B7/wKioL1ffuNvQFYmRAAAd68AGuHU098.png "title=" Screenshot from 2016-09-19 18:06:08.png "style=" Float:none; "alt=" Wkiol1ffunvqfymraaad68aguhu098.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/87/B7/wKioL1ffuNvjxjo0AAAEqlXVAWc118.png "title=" Screenshot from 2016-09-19 18:06:20.png "style=" Float:none; "alt=" Wkiol1ffunvjxjo0aaaeqlxvawc118.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/87/BA/wKiom1ffuNuS9Q98AAAhRj_mIiQ234.png "title=" Screenshot from 2016-09-19 18:06:33.png "style=" Float:none; "alt=" Wkiom1ffunus9q98aaahrj_miiq234.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/B7/wKioL1ffuNqQo0JpAABpHp7OlRE553.png "style=" float: none;width:700px;height:101px; "title=" screenshot from 2016-09-19 18:06:40.png "width=" to "height=" "101" border= "0" Hspace= "0" vspace= "0" alt= "wkiol1ffunqqo0jpaabphp7olre553.png"/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/87/BA/wKiom1ffujWToBsoAACHCYZBYAw614.png "style=" width : 700px;height:152px; "title=" screenshot from 2016-09-19 18:11:17.png "width=" "height=" "border=" 0 "hspace=" 0 " Vspace= "0" alt= "wkiom1ffujwtobsoaachcyzbyaw614.png"/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/B7/wKioL1ffujuQoU54AAnxmNlqsgQ487.png "style=" width : 750px;height:560px; "title=" screenshot from 2016-09-19 18:12:30.png "width=" "" height= "560" border= "0" hspace= "0" Vspace= "0" alt= "wkiol1ffujuqou54aanxmnlqsgq487.png"/>





This article from the "Technology life, Simple not simple" blog, please be sure to keep this source http://willis.blog.51cto.com/11907152/1854195

Dhcp+vsftpd+tftp+kickstart build PXE environment for batch automation system installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.