Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install pxe Automation system

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you about how to install the pxe automation system. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.

Pxe automatic installation system

Pxe automatic installation, the required services are: dhcp server, tftp server, http server

For pxe automatic installation, the required package groups and related installation files are: syslinux and the answer file selinux for the automated installation system.

The experiment shows that

In this experiment, a CentOS7 is used as the dhcp server, tftp server, and http server to provide automatic installation to the hosts in this network segment.

Prepare host system IPCentOS7CentOS7192.168.73.120 1, install dhcp service, tftp-server service, httpd service and syslinux package group [root@centos7 ~] # yum install dhcp tftp-server httpd syslinux-y 2, create answer file

1. Use system-config-kickstart to generate ks6.cfg

[root@centos7 ~] # system-config-kickstart [root@centos7 ~] # vim ks6.cfg#platform=x86, AMD64 Or Intel EM64T#version=DEVEL# Firewall configurationfirewall-disabled# Install OS instead of upgradeinstall# Use network installationurl-url= "http://192.168.73.120/centos/6/os/x86_64"# Root passwordrootpw-iscrypted $1 $6oVXZR1R$QOASc6inirmHCZmQ.W9Hg0# System authorization informationauth-useshadow-passalgo=sha512# Use text mode installtext# System keyboardkeyboard us# System languagelang en_US# SELinux configurationselinux-disabled# Do not configure the X Window Systemskipx# Installation logging levellogging-level=info# Reboot after installationreboot# System timezonetimezone Asia/Shanghai# Network informationnetwork-- Bootproto=dhcp-device=eth0-onboot=on# System bootloader configurationbootloader-location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart-all-initlabel # Disk partitioning informationpart / boot-fstype= "ext4"-size=200part /-fstype= "ext4"-size=20000part swap-fstype= "swap"-size=1024%packages@core%end

two。 Copy ks6.cfg to ks7.cfg and modify some parameters

[root@centos7 ~] # cp ks6.cfg ks7.cfg [root@centos7 ~] # vim ks7.cfg#platform=x86, AMD64 Or Intel EM64T#version=DEVEL# Firewall configurationfirewall-- disabled# Install OS instead of upgradeinstall# Use network installationurl-- url= "http://192.168.73.120/centos/7/os/x86_64" # change url to 7 url# Root passwordrootpw-- iscrypted $1 $6oVXZR1R$QOASc6inirmHCZmQ.W9Hg0# System authorization informationauth-- useshadow-- passalgo=sha512# Use text mode installtext# System keyboardkeyboard us# System languagelang en_US# SELinux configurationselinux-- disabled# Do not configure the X Window Systemskipx# Installation logging levellogging-- level=info# Reboot after installationreboot# System Timezonetimezone Asia/Shanghai# Network informationnetwork-- bootproto=dhcp-- device=ens33-- onboot=on # modify the name of the Nic to ens33# System bootloader configurationbootloader-- location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart-- all-- initlabel # Disk partitioning informationpart / boot-- fstype= "ext4"-- size=200part /-- fstype= "ext4"-- size=20000part swap-- fstype= "swap"-- size=1024%packages@core%end 3. Configure the httpd service

1. Create a http directory

[root@centos7 ~] # mkdir-pv / var/www/html/ {centos/ {6pm 7} / os/x86_64 Ksdir} mkdir: created directory'/ var/www/html/centos'mkdir: created directory'/ var/www/html/centos/6'mkdir: created directory'/ var/www/html/centos/6/os'mkdir: created directory'/ var/www/html/centos/6/os/x86_64'mkdir: created directory'/ var/www/html/centos/7'mkdir: created directory'/ var/www/html/centos/7/os'mkdir: created directory'/ var/www/html/centos/ 7/os/x86_64'mkdir: created directory'/ var/www/html/ksdir'

two。 Hang the CD files of CentOS6 and 7 to the relevant directory (you can copy the CD image directly to the directory at work)

[root@centos7 ~] # lsblk | grep srsr0 11:0 1 10G 0 rom / mntsr1 11:1 13.7G 0 rom [root@centos7 ~] # mount / dev/sr0 / var/www/html/centos/7/os/x86_64/mount: / dev/sr0 is write-protected, mounting read-only [root@centos7 ~] # mount / dev/sr1 / var/www/html/centos/6/os/x86_64/mount: / dev/sr1 is write-protected Mounting read-only [root@centos7 ~] # lsblk | grep srsr0 11:0 1 10G 0 rom / var/www/html/centos/7/os/x86_64sr1 11:1 1 3.7 G 0 rom / var/www/html/centos/6/os/x86_64

3. Copy the prepared answer file to the directory

[root@centos7 ~] # cp ks6.cfg / var/www/html/ksdir [root@centos7 ~] # cp ks7.cfg / var/www/html/ksdir

4. Start the httpd service and set it to boot automatically

[root@centos7 ~] # systemctl start httpd [root@centos7 ~] # systemctl enable httpd IV. Configure tftp server

1. Create the relevant file directory under the tftp working directory

[root@centos7 ~] # mkdir-pv / var/lib/tftpboot/ {kernel {6 var/lib/tftpboot/kernel6'mkdir 7}, pxelinux.cfg} mkdir: created directory'/ var/lib/tftpboot/kernel6'mkdir: created directory'/ var/lib/tftpboot/kernel7'mkdir: created directory'/ var/lib/tftpboot/pxelinux.cfg'

two。 Copy the kernel and virtual file system of centos6 and centos7 to the corresponding kernel directory under the tftp working directory

[root@centos7 tftpboot] # cd / var/lib/tftpboot/kernel6 [root@centos7 kernel6] # cp / var/www/html/centos/6/os/x86_64/isolinux/vmlinuz. [root@centos7 kernel6] # cp / var/www/html/centos/6/os/x86_64/isolinux/initrd.img. [root@centos7 kernel6] # cd / var/lib/tftpboot/kernel7 [root@centos7 kernel7] # cp / var/www/html/centos/7/os/x86_64/isolinux/vmlinuz . [root@centos7 kernel7] # cp / var/www/html/centos/7/os/x86_64/isolinux/initrd.img.

3. Copy the startup-related files to the tftp working directory

[root@centos7 kernel7] # cd / var/lib/tftpboot/ [root@centos7 tftpboot] # cp / usr/share/syslinux/menu.c32. [root@centos7 tftpboot] # cp / usr/share/syslinux/pxelinux.0.

4. Copy the menu file on the CD to the / var/lib/tftpboot/pxelinux.cfg directory and rename it to default. Modify this file.

[root@centos7 tftpboot] # cp / var/www/html/centos/7/os/x86_64/isolinux/isolinux.cfg / var/lib/tftpboot/pxelinux.cfg/default [root@centos7 tftpboot] # vim / var/lib/tftpboot/pxelinux.cfg/defaultdefault menu.c32 # change this line to menu.c32timeout 600menu title CentOS installlabel linux 6 menu label Install CentOS ^ 6 kernel kernel6/vmlinuz # here is the path append initrd=kernel6/initrd.img ks=http:// where the centos6 kernel is located 192.168.73.120/ksdir/ks6.cfg # specify the location of the KS file on the network label linux 7 menu label Install CentOS ^ 7 kernel kernel7/vmlinuz # here specify the location of the KS file on the network label local menu label Boot from ^ local drive localboot 0xffff for the path append initrd=kernel7/initrd.img ks= http://192.168.73.120/ksdir/ks7.cfg # where the KS kernel is located

5. Check the directory structure

[root@centos7 tftpboot] # tree. ├── centos6 │ ├── initrd.img │ └── vmlinuz ├── centos7 │ ├── initrd.img │ └── vmlinuz ├── menu.c32 ├── pxelinux.0 └── pxelinux.cfg └── default

6. Start the tftp service and set it to boot

[root@centos7 ~] # systemctl start tftp [root@centos7 ~] # systemctl enable tftp 5. Configure dhcp service

1. Since the default configuration file for dhcpd is empty, the template configuration file for dhcpd is copied here and modified.

[root@centos7 ~] # cp/ usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.confcp: overwrite'/ etc/dhcp/dhcpd.conf'? Y

two。 Configure the dhcp service

[root@centos7 ~] # vim / etc/dhcp/dhcpd.conf# option definitions common to all supported networks...option domain-name "mylinuxops.com"; # specify the pre-added domain name option domain-name-servers 114.114.114.114; # specify the DNS server default-lease-time 6000 Omitted in the middle. # No service will be given on this subnet, but declaring it helps the # DHCP server to understand the network topology.#subnet 10.152.187.0 netmask 255.255.255.0 {# Note #} # Note # This is a very basic subnet declaration.subnet 192.168.73.0 netmask 255.255.224 {range 192.168.73.1 192.168.73.100 # specify dhcp address pool option routers 192.168.73.254; # specify gateway filename "pxelinux.0"; # specify startup file next-server 192.168.73.120; # specify tftp server path}

3. Start the dhcp server and set it to boot automatically

[root@centos7] # systemctl start dhcpd [root@centos7] # systemctl enable dhcpdCreated symlink from / etc/systemd/system/multi-user.target.wants/dhcpd.service to / usr/lib/systemd/system/dhcpd.service. Note:

1. All services are deployed and before testing, make sure there are no other DHCP services in the network to avoid interference.

2.centos7 requires more than 1G of memory space for automated installation.

3. Pay attention to the size of the physical disk and the disk size in the ks file during installation to ensure that there is enough space for installation.

The above is the editor for you to share how to carry out pxe automation installation system, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report