CentOS 6 PXE Unattended Installation
Preface
PXE: working in the Client/Server network mode. It allows workstation to download images from remote servers over the network and starts the operating system over the network, the terminal requires the server to assign an IP address, and then download a startup package to the local memory for execution using the trivial file transfer protocol. The startup package completes the basic software settings of the terminal, to guide the terminal operating system pre-installed on the server
When enterprises need to install multiple server systems at the same time, a PXE (preboot execute environment pre-start execution environment) is required to facilitate, speed, standardize, and reduce manual repetitive work) servers help us install the system. PXE network installation can also reduce the use of the CD, and it is not a good choice.
PXE Server Environment:
Centos6.4: Server Operating System
IP: 192.168.100.1
DHCP: Dynamic Host Configuration Protocol
TFTP: simple File Transfer Protocol
HTTP: Hypertext Transfer Protocol
Syslinux: Change the Boot Sector on the disk
System-config-kickstart: configure the System installation script on the graphic page
1. DHCP
DHCP (Dynamic Host Configuration Protocol) is a LAN network Protocol that uses UDP Protocol for two purposes: 1. automatically assign IP addresses to internal network or network service providers. it provides users or internal network administrators with central management measures for all computers.
Usually used in a large local area network environment, the main function is to centrally manage and assign IP addresses, so that hosts in the network environment dynamically obtain IP addresses, Gateway Addresses, DNS server addresses, and other information, and can improve the address usage.
yuminstalldhcp# Installing dhcprpm-qldhcp# View dhcp file generationcat/etc/dhcp/dhcpd.conf# Viewing dhcp configuration files
The newly installed dhcp configuration file is as follows:
##DHCPServerConfigurationfile.#see/usr/share/doc/dhcp*/dhcpd.conf.sample#see'man5dhcpd.conf'#
Copy related scripts as prompted
cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.conf# Copy a scriptvim/etc/dhcp/decpd.conf# Open the configuration file as follows:
The Information allocated to the client starting with option, and the operating characteristics of ducp defined by non-option
optiondomain-name"magedu.com";# Configure a domain nameoptiondomain-name-servers8.8.8.8;# Configure the DNS addressdefault-lease-time80000;# Default address lease time (in seconds)max-lease-time280000;# Maximum lease timelog-facilitylocal7;# Dhcp logsubnet192.168.100.0netmask255.255.255.0{# Specify the network segment where dhcp works and subnet maskrange192.168.100.10192.168.100.200;# Specify the ip address segment that can be allocatedoptionrouters192.168.100.1;# Specify a gatewaynext-server192.168.100.1;# Specify the pxe service addressfilename"pxelinux.0";# Specify the pxe boot file}Detect configuration files and restart services
servicedhcpdconfigtest# Check the Configuration File Syntaxservicedhcpdforce-reload# Restart script2. TFTP
TFTP (Trivial File Transfer Protocol, simple File Transfer Protocol) is implemented based on the UDP Protocol and provides File Transfer services that are not complex and costly. The port number is 69.
yuminstalltftp-server# Install the tftp servicechkconfigtftpon# Auto startservicexinetdrestart# The tftp service is monitored by the xinetd process. To modify the tftp configuration, restart the xinetd service.netstat-unlp|grep69# Check whether the service is started3. Syslinux
When syslinux is installed, the boot sector on the disk is changed. syslinux is a powerful boot loader and compatible with various media. It aims to simplify Linux installation time and create a boot disk for repair or other special purposes.
yuminstallsyslinux# Install syslinuxcp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot# Copy the file to the tftp directory4. HTTP
HyperText Transfer Protocol (HTTP, HyperText Transfer Protocol) is the most widely used network Protocol on the Internet. A client initiates a specified port to the server (the default port is 80).
yuminstallhttpd# Install httpmkdir-pv/var/www/html/centos/6/x86_64# Creating a directorymount/dev/cdrom/media/cdrom# Mount directorymount--bind/media/cdrom/var/www/html/centos/6/x86_64# Bind a directoryservicehttpdstart# Start httpnetstat-tnlp|grep"httpd"# Check whether startup is normal
5. Provide boot files
After Pxelinux is loaded by the client, it will go to the tftp server to find the vmlinuz and ramdisk files. The files are in the images/pxeboot installation disc and need to be copied to the tftp directory.
cp/media/cdrom/images/pxeboot/{vmlinuz,initrd.img}/var/lib/tftpboot/# Copying the kernel ramdiskcp/media/cdrom/isolinux/{splash.jpg,vesamenu.c32}/var/lib/tftpboot# Copy the menu frame and background imagemkdir/var/lib/tftpboot/prelinux.cfg# Create unique directory pxe format requirementscp/media/isolinux/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/default# Copy an option menu file6. Create a kickstart Startup File
You can use the graphic interface to create a kickstart file.
yuminstallsystem-config-kickstart# Installation GUI windowsystem-config-kickstart# Start the graphic interfaceSave the centos6.cfg file (the file name is customized but must end with. cfg)
12mvcentos6.cfg/var/www/html/# Move the file to the/var/www/html directoryvim/var/lib/tftpboot/pxelinux.cfg/default# Add ks = http: // 192.168.100.1/centos6.cfg as follows:7. Set the client startup Item
You can install the operating system automatically.
The above is the entire unattended Automatic Installation Process of PXE. If you have any omissions, please kindly advise. Thank you!
This article from the "linux O & M learning" blog, please be sure to keep this source http://5990383.blog.51cto.com/5980383/1636636