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.
yum
install
dhcp
# Installing dhcp
rpm-qldhcp
# View dhcp file generation
cat
/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 script
vim
/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 name
optiondomain-name-servers8.8.8.8;
# Configure the DNS address
default-lease-
time
80000;
# Default address lease time (in seconds)
max-lease-
time
280000;
# Maximum lease time
log-facilitylocal7;
# Dhcp log
subnet192.168.100.0netmask255.255.255.0{
# Specify the network segment where dhcp works and subnet mask
range192.168.100.10192.168.100.200;
# Specify the ip address segment that can be allocated
optionrouters192.168.100.1;
# Specify a gateway
next-server192.168.100.1;
# Specify the pxe service address
filename
"pxelinux.0"
;
# Specify the pxe boot file
}
Detect configuration files and restart services
servicedhcpdconfigtest
# Check the Configuration File Syntax
servicedhcpdforce-reload
# Restart script
2. 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.
yum
install
tftp-server
# Install the tftp service
chkconfigtftpon
# Auto start
servicexinetdrestart
# The tftp service is monitored by the xinetd process. To modify the tftp configuration, restart the xinetd service.
netstat
-unlp|
grep
69
# Check whether the service is started
3. 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.
yum
install
syslinux
# Install syslinux
cp
/usr/share/syslinux/pxelinux
.0
/var/lib/tftpboot
# Copy the file to the tftp directory
4. 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).
yum
install
httpd
# Install http
mkdir
-pv
/var/www/html/centos/6/x86_64
# Creating a directory
mount
/dev/cdrom
/media/cdrom
# Mount directory
mount
--bind
/media/cdrom
/var/www/html/centos/6/x86_64
# Bind a directory
servicehttpdstart
# Start http
netstat
-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 ramdisk
cp
/media/cdrom/isolinux/
{splash.jpg,vesamenu.c32}
/var/lib/tftpboot
# Copy the menu frame and background image
mkdir
/var/lib/tftpboot/prelinux
.cfg
# Create unique directory pxe format requirements
cp
/media/isolinux/isolinux
.cfg
/var/lib/tftpboot/pxelinux
.cfg
/default
# Copy an option menu file
6. Create a kickstart Startup File
You can use the graphic interface to create a kickstart file.
yum
install
system-config-kickstart
# Installation GUI window
system-config-kickstart
# Start the graphic interface
Save the centos6.cfg file (the file name is customized but must end with. cfg)
12mv
centos6.cfg
/var/www/html/
# Move the file to the/var/www/html directory
vim
/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