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

PXE remote deployment installation, advanced version of kickstart unattended installation (real

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

What everyone brings to you today is the contents of PXE remote deployment and kickstart unattended installation, we will analyze and experiment to deploy PXE remote installation service from the following points: 1. Build PXE remote installation server 2, verify PXE network installation to achieve Kickstart unattended installation: 1, prepare to install answer files 2, and realize batch automatic installation.

Batch deployment of servers:

1. Scale: assemble multiple servers at the same time 2, automation: installation system, configuration of various services 3, remote implementation: no need for CD, U disk and other installation media

PXE remote installation experiment:

Experimental environment:

1. It is recommended to use it in the local area network environment (two centos7, one as the PXE server and the other as the bare hardware to be used in the verification experiment). 2. Centos7-1 in the PXE server state requires two network cards: one NAT (online installation software package) and one host-only (communication in the local area network).

Step 1: install a naked hardware in the virtual machine in the upper left corner of the VMware main interface, click File, select New Virtual Machine 1, enter the installation wizard: select Custom, click next step 2, compatibility defaults to: Workstation 14.x, click next step 3, installation Source: choose to install the operating system later. Click next step 4, client operating system: select linux, version select centos 7 64-bit, click next step 5, path selection: self-defined 6, memory: set to 2GB, click next step 7, network connection: select only hosts (so that the network card can communicate in the local area network), click next 8, SCSI controller selection recommendation, virtual disk type selection recommendation Click next step 9, disk selection: create a new virtual disk, click next step 10, disk size: 40GB, click next step 11, virtual disk file: put in the installation path folder, click next step 12, customize hardware: remove the sound card and printer, the difference here and before is that we will mount the ISO image file in 13, CD, but do not need it, just click close. Click finish. At this time, a bare hardware without any system is added. After we have completed all the configurations, we only need to start it when we verify the experimental results.

Next let's configure the PXE server:

Input: ifconfig (check the network card)

Input: cd / etc/sysconfig/network-scripts/ (enter into this directory) input: ls (view details) input: cp-p ifcfg-ens33 ifcfg-ens36 (copy ens33 network card configuration file and rename it to ens36) input: vim ifcfg-ens36 (modify ens36 network card configuration) modify: dhcp for static modify: two places ens33 for ens36 delete: UUID line write: IPADDR=192.168.100.100 (IP address) write: NETMASK=255.255. 255.0 (subnet mask) write: GATEWAY=192.168.100.1 (gateway) input: wq (save exit)

Input: service network restart (restart network service) input: ifconfig (view network card)

We need to use the ens36 network card to address the bare hardware (address is 100 segments), then establish the connection and then install the system.

Step 2: install the service and configure:

Install the DHCP service

Input: yum install dhcp- y (install dhcp service) input: cp/ usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.conf (copy configuration file) input: yes (confirm overwrite) input: vim / etc/dhcp/dhcpd.conf (modify main configuration file) 27 lines: subnet 192.168.100.100 netmask 255.255.255.0 {range 192 .168.100.20 192.168.100.30 (address pool) option routers 192.168.100.100; (gateway, pointing to itself here) option domain-name-servers 8.8.8.8; (assigning DNS address) next-server 192.168.100.100; (pointing to TFTP server) filename "pxelinux.0" (point to the location of the boot file)}

Input: wq save exit input: yum install syslinux-y (install bootstrap file) input: rpm-ql syslinux | grep pxelinux.0 (view file path)

This configuration file should be placed in the TFTP directory. Enter: yum install tftp-server-y (install this service) enter: rpm-ql tftp-server (view site path) where: / etc/xinetd.d/tftp (configuration file) / var/lib/tftpboot (site)

Input: cp / usr / share/syslinux/pxelinux.0 / var/lib/tftpboot (put into bootstrap pxelinux.0) input: ls (check details, you can see pxelinux.0 in the directory) input: vim / etc/xinetd.d/tftp (edit tftp configuration) modify: disable = no (enable service) wq save exit

The image needs to be mounted to the ftp site So you need to install FTP service: input: yum install vsftpd-y (install this service) input: rpm-ql vsftpd (where / var/ftp is the site path) input: cd / var/ftp/ (enter site path) input: mkdir centos7 (create file) input: ls (you can see the created file) input: mount / dev/sr0 / var/ftp/centos7/ (mount the CD image file to the FTP site) input The specific process of df-hT (query mount) is shown below:

Input: cd centos7/ input: ls (for details, we need to put the initialization file and kernel in the site directory All in the images directory) input: cd images/ input: ls (view details) input: cd pxeboot/ input: ls (view details) at this time we need initrd.img (initialization file) and vmlinuz (kernel) input: ls-lh (friendly view details) We need to put the above two files into the TFTP site directory enter: cp initrd.img vmlinuz / var/lib/tftpboot/ input: Ls / var/lib/tftpboot/ (you can see the files are copied to the directory)

Input: cd / var/lib/tftpboot/ input: ls (View details) input: mkdir pxelinux.cfg (create this file, must be this name) input: ls (View details) input: cd pxelinux.cfg/ input: ls (View details) input: vim default (Edit File)

The write is as follows:

Input: systemctl stop firewalld.service (turn off the firewall) enter: setenforce 0 (turn off the security function) to start the following three services: systemctl start dhcpdsystemctl start tftpsystemctl start vsftpd returns to the bare hardware host, press Esc to select network startup and press enter key when turning on

When boot appears, press enter.

The automatic installation will be performed later until you enter the system boot interface:

After selecting Chinese, we check to see which different installation sources of the panel come from the remote server: 192.168.100.100/centos7

After that, you can set up the installation by yourself. The above is the experiment of remote installation of PXE.

Although we use PXE for remote automatic installation, but the subsequent installation settings still need to be operated manually, the next thing we will bring to you is that after entering the startup installation interface, there is no need for manual settings and subsequent installation operations of the powerful technology kickstart unattended technology!

It comes! It comes! It's really coming! Kickstart unmanned installation machine which is more powerful than PXE

About kickstart

Kickstart unattended technology: 1, create answer files, pre-define various installation settings 2, avoid interactive setup process, so as to achieve fully automatic installation 3. By adding% post script, complete various configuration operations after installation kickstart unattended installation experiment: 1. Do not restore the configuration files and installation services of the previous PXE experiment 2. Let's go to centos7-1 and click on the application in the upper left corner of the desktop to select the system tools. At this time, because there is no corresponding service installed, the template of kickstart is not displayed.

Enter: yum install systemc-config- kickstart-y and then return to the desktop of centos7-1, and select kickstart in the upper left corner of the application, system tools.

Then you need to use it to create the basic configuration of the template file: 1, the language is set to simplified Chinese 2, time zone: Shanghai 3, password: abcd1234, reconfirm password 4, check install and restart

Installation method: new installation 1, select FTP: ftp://192.168.100.100/2, directory: centos7

Zone information: click add 1. Create boot 500MB first.

2. Add home 4096MB again

3. Add swap 4096MB again

4. Add the "/" root and choose to use all the unused space on the disk

Network configuration: adding network devices: ens33

Firewall configuration: disablin

Post-installation script: use the interpreter: / bin/bash

Click the file in the upper left corner and choose to save to the directory of / var/ftp

We are entering the terminal interface to enter: cd / var/ftp/ input: ls (for more information, you can see the ks.cfg file we put in)

Enter: vim ks.cfg (in fact, we can see that the content shown in it is what we set up before)

The next package we need to install should be added to the template file, because the template file will be read at startup. Enter: cd / root (enter this directory) input: ls (you can see the template file anaconda.cfg) enter: vim anaconda-ks.cfg (copy what we need in the following figure)

Input: cd-(go back to the ftp directory) enter: vim ks.cfg (edit this file) press big G to the last line, press small o to insert on the following line and paste what we copied here enter: wq (save exit)

If you do not operate the paste component installation package, the selected components cannot be judged after starting the installation, and still need to be selected manually, so there is no significance of automatic deployment and installation. Next, we need to boot, load template: input: cd/ var/lib/tftpboot/ input: cd/pxelinux.cfg/ input: vim default (configure this file) add: ks= ftp://192.168.100.100/ks.cfg to the default load of auto in the default configuration

Back to the bare hardware mainframe, press Esc to select network startup and press enter key when opening.

When boot appears, press enter again

Wait for the completion of the installation schedule and click to complete the configuration to enter the system desktop, so the unattended automatic installation of kickstart is more convenient than PXE remote deployment, and it is suitable for large quantities of installation work, saving the time of manual operation.

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

Network Security

Wechat

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

12
Report