当前位置:网站首页>PXE principle and configuration
PXE principle and configuration
2022-07-24 08:52:00 【IT.cat】
Catalog
Two 、PXE Service construction process
3、 ... and 、 Start configuration PXE
3.1、 Turn off firewall and core firewall
3.2、 Environmental preparation
3.3、 To configure dhcp service
3.4、 Install and configure tftp service
3.5、 Get ready ftp Files that need to be shared
3.6、 Get ready PXE Boot image file pxelinux.0
3.7、 Manual configuration default Menu file
3.8、 install ftp service , Get ready centos7 Install source
3.9、 To configure kickstart Unattended installation
One 、PXE summary
Let's first review Linux System startup process
Power on self test ----MBR guide ----GRUB menu ---- Loading kernel ----initi Process initialization
PXE By intel Network guidance technology developed by the company , Work again C/S In mode , Allows clients to download boot images from remote servers over the network , And load the installation file or the whole system .
PEX Strictly speaking, it is not an installation method , It's a way of guiding . Conduct PXE The necessary condition for installation is that the installed computer contains a PXE Supported network cards (NIC), That is, there must be PXE Client. PXE The protocol enables the computer to start over the network .
The agreement is divided into client and server End ,PEX client On the network card ROM in , When the computer boots ,BIOS hold PXE client Call in memory to execute , from PXE client Download the files placed at the remote end to run locally through the network . function PXE The protocol needs to be set DHCP The server and TFTP The server .DHCP The server is used for PXE client Allocate one IP, Because it's for PXE client Allocation address , So in configuration DHCP The server needs to add what you want PXE Set up .
Two 、PXE Service construction process
1、PXE The client sends DHCP request , towards DHCP Server application IP Address .
2、DHCP Server response PXE Client requests , Automatically from IP Allocate an address in the address pool IP Address to PXE The client , And tell PXE The client :TFTP Server's IP Address and PXE Bootloader file pxelinux.0, Default in TFTP share directory /var/lib/tftoboot Next
3、PXE The client is going to TFTP The server initiates the acquisition pxelinux.0 Request for bootstrap file .
4、TFTP Server response PXE Client requests , Share it pxelinux.0 File transfer to PXE The client .
5、PXE The client starts to the main interface of system installation through the network
6、PXE Client to file sharing server (ftp、http、nfs) Initiate acquisition centos System or windows Request for system installation files .
7、vsftp File sharing service response PXE request , Transfer the shared quota system installation file to PXE The client .
8、PXE The client enters the installation prompt wizard interface , Users need to manually complete the operation of system installation
3、 ... and 、 Start configuration PXE
3.1、 Turn off firewall and core firewall
systemctl stop firewalld
systemctl disable firewalld
setenforce 0

3.2、 Environmental preparation
One function of configuring dual network cards is dhcp, A use network source installation environment package
dhcp Automatically assigned IP Your network card must be net1 Host only mode

ifconfig Check the network card information 
cd /etc/sysconfig/network-scripts # Enter the network card configuration directory
cp ifcfg-ens33 ifcfg-ens36
vim ifcfg-ens36
We need to check it before changing net1 Network segment of network card

So we configure the network card in this way

Restart the network card after configuration
systemctl restart network # Restart the network card service
3.3、 To configure dhcp service
yum -y install dhcp # install dhcp service

vim /etc/dhcp/dhcpd.conf # Go to configuration file

cp -p /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf #-p Copy with file attributes

vim /etc/dhcp/dhcpd.conf # Go back to editing


systemctl start dhcpd # Turn on dhcp service
systemctl enable dhcpd # Boot up
3.4、 Install and configure tftp service
Before configuring, briefly talk about tftp,tftp Is a small and easy to implement file transfer protocol ,tftp Is based on UDP The datagram , We need to have our own corrective measures .tftp Only file transfer is supported , No interaction supported , There is no huge command set . Low security , Authentication is not supported
yum -y install tftp-server
yum -y install xinetd
#tftp By xinetd Escrow ,xinetd Not installed by default , The configuration file
rpm -q tftp-server xinetd # Check if the installation is successful

In this way, the installation is successful and the configuration can begin
vim /etc/xinetd.d/tftp # To configure tftp

The main change is disable This line , Turn on tftp service
3.5、 Get ready ftp Files that need to be shared
mount /dev/cdrom /mnt # Mount the image file

Enter the kernel file Copy the kernel initialization image file to /var/lib/tftpboot
cd /mnt/images/pxeboot
cp initrd.img vmlinuz /var/lib/tftpboot # Copy the kernel initialization file

vmlinuz: It's steerable 、 Compressed kernel
initrd.img: System initialization file
systemctl start xinetd # Opening service
systemctl enable xinetd
systemctl start tftp
systemctl enable tftp
The above is to convert the kernel file in the image + System initialization file , Throw it tftp In the default shared directory , So that the client can download and use .
3.6、 Get ready PXE Boot image file pxelinux.0
pxelinux.0 It's a binary , The main function is equivalent to the guidance of a system installation step , Guide the client how to install the system
yum provides /pxelinux.0
# Find out which installation package installed this file , Use when not a path and a package
yum -y install syslinux

rpm -ql syslinux | grep pxelinux.0 # lookup pxe The location of the bootstrap

Select the second file to copy ,
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot # Copy tftp Under the root directory of , System boot file

notes , Only installed system-config-kickstart software package , Just can have /usr/share/syslinux/ Directory and files in the directory
3.7、 Manual configuration default Menu file
The Startup menu is used to know the boot process of the client , Including how to call the kernel , How to load drivers . Default
mkdir /var/lib/tftpboot/pxelinux.cfg/
# Default pxelinux.cfg There is no need to manually create , Note that it is a directory, not a directory .cfg ending
vim /var/lib/tftpboot/pxelinux.cfg/default # Configure menu file

3.8、 install ftp service , Get ready centos7 Install source
yum -y install vsftpd # install ftp service
mount /dev/cdroom /mnt # If the front is mounted, you can omit

mkdir /var/ftp/centos7
cp -rf /mnt/* /var/ftp/centos7 # Copy the image to it

systemctl start vsftpd # Turn on ftp service
systemctl enable vsftpd # Boot from boot
3.9、 To configure kickstart Unattended installation
yum -y install system-config-kickstart # install system-config-kickstart Tools

Open the unattended configurator to start configuration










Look at the file

It's just one last step
cd /root # Enter home directory
vim anaconda-ks.cfg

Put the following figure inside , Copied to the var/ftp/ks.cfg in
vim /var/ftp/ks.cfg
Copy the above content to the end

vim /var/lib/tftpboot/pxelinux.cfg/default
# Enter the menu file to optimize , take ks Boot parameters to boot menu file

This completes the configuration
verification :
Create an empty virtual machine

Then restart the virtual machine

It will automatically get ip, Automatic installation , It's going to be a little slow , Just wait patiently
边栏推荐
- Learn the rxjs operator
- Developing ebpf program with go language
- Digital collection =nft? Have you entered the digital collection?
- C # briefly describe the application of Richter's replacement principle
- mysql URL
- 脉脉网友出了道 Go 面试题,你能答对吗?
- How to integrate and use log4net logging plug-in in vs2019 class library
- Change of sheetname
- Scatter chart - date
- Beandefinition three ways to load beans
猜你喜欢

Sed add content after a line

WordPress free theme: document, making reading more convenient

Scatter chart - date

Treap

Pulse netizens have a go interview question, can you answer it correctly?

脉脉网友出了道 Go 面试题,你能答对吗?

Local warehouse associated with remote warehouse

Taking advantage of the momentum, oceanbase promotes the lean growth of digital payment

JMX console unauthorized access vulnerability

office回退版本,从2021到2019
随机推荐
"Problem solution" with score
如何将CAD文件导入图新地球中,与影像地形倾斜模型准确叠加
【一起上水硕系列】EE feedback 详解
Why does the metauniverse need NFT?
Typescript decorator
"Explanation" change exchange
利用opencv 做一个简单的人脸识别
RPC调用方如何实现异步调用:CompletableFuture
Opencv Chinese document 4.0.0 learning notes (updating...)
[FFH] openharmony gnawing paper growth plan -- Application of cjson in traditional c/s model
Rank 3 and count from 0 to 9. How many times does each number appear in total, and how many times does each number appear in the tens of hundreds,
"Move to earn" motion metauniverse, move starts a new journey
Route interceptor
Move protocol starts with running and builds a healthy ecosystem of sports
3587. Connected graph (Jilin University postgraduate entrance examination machine test question)
C语言练习题目+答案:
Source code analysis of BlockingQueue (arraybq and linkedbq)
Treap
情人节
Unity C#工具类 ArrayHelper