Article Title: Use PXE to remotely Install Multiple Linux systems. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Objective: To Install multiple servers at the same time, if one server is installed, the system will vomit blood. To save time, choose PXE.
Lab environment:
Server CentOS5.1
N vm instances (if installed on the VM, the NIC of the VM must have the PXE function)
Software requirements: tftp-server, dhcp, etc.
Lab description:
PXE (Pre-boot Execution Environment) is a protocol designed by Intel that enables computers to start over the network. The Protocol is divided into two ends: client and server. The PXE client is in the ROM of the NIC. When the computer boots, the BIOS transfers the PXE client to the memory for execution and displays the command menu. After the user selects the client, the PXE client downloads the operating system on the remote end to the local computer for running.
The DHCP server assigns an IP address to the PXE client. The DHCP Server is used to dynamically assign IP addresses to the DHCP Client. However, the IP address is assigned to the PXE Client, therefore, when configuring the DHCP Server, you need to add the corresponding PXE-specific configuration.
PXE Client uses the TFTP Client to download the required files to the TFTP Server through the TFTP protocol.
Lab steps;
I don't have these two packages on my machine. install them first. If there are no other packages, install them first.
# Yum-y install dhcp
# Yum-y install tftp-server
1. Configure the nfs server
1. Copy the content to be installed to the hard disk and create a new directory to store it.
# Mkdir/var/isofiles
Because there is an ISO in my FTP, I copied the files in ISO to the directory above.
Mount the ISO file directly to/mnt/. Use the following method:
# Mount/var/ftp/linuxtools/CentOS-5.2-i386-bin-DVD.iso/mnt/-t iso9660-o loop
Copy all the content in the ISO file to the directory just created.
# Cp-r */var/isofiles/
2. Enable the NFS service.
# Vi/etc/exports
Add the following line
/Var/isofiles * (ro, sync)
Run the following command to view the NFS directory:
# Showmount-e changzi. centos
Export list for changzi. centos:
/Var/isofiles *
Enable the NFS service
# Service portmap start
Start portmap: [OK]
# Service nfs start
Start the NFS service: [OK]
Disable NFS quota: [OK]
Start the NFS daemon: [OK]
Start NFS mountd: [OK]
2. Configure the DHCP server and TFTP service
1. DHCP
Copy a template from the document and modify it directly in the template.
# Cp/usr/share/doc/dhcp-3.0.5/dhcpd. conf. sample dhcpd. conf
# Vim/etc/dhcpd. conf
Ddns-update-style interim;
Ignore client-updates;
Filename "pxelinux.0 ";
Subnet 192.168.1.0 netmask 255.255.255.0 {
# --- Default gateway
Option routers 192.168.1.1;
Option subnet-mask limit 255.0;
Option time-offset-18000; # Eastern Standard Time
Range dynamic-bootp 192.168.1.60 192.168.1.62;
Default-lease-time 21600;
Max-lease-time 43200;
# We want the nameserver to appear at a fixed address
Host ns {
Next-server 192.168.1.63;
Hardware ethernet 12: 34: 56: 78: AB: CD;
Fixed-address 207.175.42.254;
}
}
[1] [2] Next page