Linux: PXE network installation

To achieve this, the following services need to be enabled

dhcp --- boot computer without u disk or CD will look for the boot in the network

tftp --- used to boot the system

ftp&& http --- Make a yum warehouse to let the guided system find rpm packages on ftp or http


1.ftp&& http yum warehouse construction

Linux: YUM Warehouse Service_Bao Haichao-GNUBHCkalitarro's Blog-CSDN Blog


2.tftp

yum -y install tftp-server 

vim /etc/xinetd.d/tftp 

Modify it to the following

server_args             = -s /var/lib/tftpboot

disable                 = no

systemctl  start  tftp 

systemctl  enable  tftp 

cd /mnt/images/pxeboot/

# mnt is the mount point of the disc, where you mount the disc, go there images/pxeboot/

cp vmlinuz  initrd.img  /var/lib/tftpboot/ 

yum -y install syslinux 

cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ 


3.dhcp 

yum -y install dhcp 

vim /etc/dhcp/dhcpd.conf

to write

ddns-update-style none;
subnet 网段 netmask 子网掩码 {
   
    option routers 网关;

    option domain-name-servers 域名服务器;

    range 地址起始 地址结束;

    next-server 服务器地址;

    filename "pxelinux.0";
}

 

systemctl  start dhcpd

systemctl  enable dhcpd 


4. Default boot menu file 

mkdir /var/lib/tftpboot/pxelinux.cfg 

vim /var/lib/tftpboot/pxelinux.cfg/default 

# write

default auto

prompt 1

label auto

    kernel vmlinuz
    append initrd=initrd.img method=ftp://192.168.254.11/centos

# The following ftp://need to write to the yum warehouse ip

In addition to this there is

#【文本模式安装】
label linux text
    kernel vmlinuz
    append text initrd=initrd.img method=ftp://192.168.10.1/centos

#【进入救援模式】
label linux rescue
    kernel vmlinuz
    append rescue initrd=initrd.img method=ftp://192.168.10.1/centos

It's just that these two are not commonly used, just use the first one


At this time, we create a new machine for testing, do not install mirroring, and do not use the network card to assign dhcp, just let the new machine and our server be in the same network

The memory should be set to 2g or more

 

Enter directly, and wait patiently 

 

Guess you like

Origin blog.csdn.net/w14768855/article/details/131617268