0. Basic Requirements
(1) There must be at least two servers: one with no operating system and the other with the operating system installed, we store CentOS installation files.
(2) The network card to install the operating system must support the PXE protocol and have set the motherboard BIOS to "enable the network card ".
1. Installation principles
(1) boot from the NIC after the instance is started;
(2) obtain a temporary IP address through DHCP;
(3) obtain the kernel image file from TFTP and start the installer using the kernel file;
(4) After the installation program is started, select the Remote Installation Method (HTTP, FTP or NFS) for installation.
2. Installation Process
This installation process saves the files required for installation on the centos 5.3 host, and the installation system is centos 5.3.
(1) configure the DHCP server
If the two machines have DHCP servers in the LAN, skip this step. Otherwise, you must configure your own DHCP server.
A) Remove the DHCP installation file from the centos CD and install it (assume that our optical drive is mounted in the/Media/centos_5.3_final directory, the same below ):
# Rpm-IVH/Media/centos_5.3_final/centos/dhcp-3.0.5-18.el5.x86_64.rpm
B) edit the DHCP configuration file as follows:
Ddns-update-style none; <br/> allow booting; <br/> allow bootp; <br/> # Set the DHCP function range of the first Nic, the dhcp of the second Nic is actually used. This segment <br/> # can be omitted, refer to the DHCP configuration of the second Nic <br/> subnet 192.168.20.0 netmask 255.255.255.0 {<br/> option routers 192.168.255.254; <br/> option subnet-mask 255.255.255.0; <br/> option domain-name "centos"; <br/> option domain-name-servers 159.226.39.1; <br/> range 192.168.20.200 192.168.20.250; <br/> default-lease-time 21600; <br/> max-lease-time 43200; <br/>}< br/> # Set the DHCP function range of the second Nic <br/> subnet 10.60.1.0 netmask 255.255.255.0 {<br/> # file required for remote start and installation, the file is stored in the tftp directory. See <br/> filename "pxelinux.0"; <br/> # Next Hop address, the address of the server where tftp is located <br/> next-server 10.60.1.91; <br/> # Set the default gateway <br/> option routers 10.60.1.254; <br/> option subnet-mask limit 255.0; <br/> # Set a domain name without any impact. <br/> option domain-name "centos" can be omitted "; <br/> # setting the domain name resolution server does not affect network installation. You can omit <br/> option domain-name-servers 159.226.39.1; <br/> # IP address distribution range of the DHCP server <br/> range 10.60.1.200 10.60.1.250; <br/> # lease validity period, set the following parameters: <br/> default-lease-time 21600; <br/> max-lease-time 43200; <br/>}
C) restart the DHCP service.
# Service DHCPD restart
D) verify the validity of the DHCP service. Run the following command from any Linux server on the same LAN:
# Dhclient eth0If the IP address can be obtained, the DHCP server starts normally. (2) install and configure TFTP server a) obtain and install the tftp server from the CentOS installation disk: # Rpm-IVH/Media/centos_5.3_final/centos/tftp-server-0.42-3.1.el5.centos.x86_64.rpmB) Configure TFTP and modify/etc/xinetd. d/tftp as follows: # Default: off <br/> # description: The tftp server serves files using the trivial file transfer/<br/> # protocol. the tftp protocol is often used to boot diskless/<br/> # workstations, download configuration files to network-aware printers, /<br/> # and to start the installation process for some operating systems. <br/> service tftp <br/> {<br/> socket_type = dgram <br/> protocol = udp <br/> wait = yes <br/> user = root <br/> server =/usr/sbin/in. tftpd <br/> # tftp file path <br/> server_args =-s/tftpboot <br/> # change to no to start tftp <br/> disable = no <br/> per_source = 11 <br/> cps = 100 2 <br/> flags = IPv4 <br/>}C) restart the xinetd service and start tftp. # Service xinetd startD) test whether tftp is normal in the tftp directory (/tftpboot.pdf creates a file, such as 1.txt. Open the terminal and execute the following command. If the file can be downloaded and modified from tftp, the configuration is successful. # Tftp localhost <br/> tftp> get 1.txtIf there is no tftp Command, you need to install the package: # Rpm-IVH/Media/centos_5.3_final/centos/tftp-0.42-3.1.el5.centos.x86_64.rpmE) Copy several files required for network installation to the/tftpboot directory. # Cp/Media/centos_5.3_final/images/pxeboot/initrd. IMG/tftpboot/<br/> # cp/Media/centos_5.3_final/images/pxeboot/vmlinuz/tftpboot/<br/> # cp/Media/centos_5.3_final/isolinux /*. MSG/tftpboot/<br/> # mkdir/tftpboot/pxelinux. CFG/<br/> # cp/Media/centos_5.3_final/isolinux. CFG/tftpboot/pxelinux. CFG/DefaultIn addition to the above files and a directory, you also need a file: pxelinux.0. This file is located in the Mount disk in the following position:/media/CentOS_5.3_Final/CentOS/syslinux-3.11-4.x86_64.rpm unzip the rpm package, you can find the file from the decompressed package: # Rpm2cpio/Media/centos_5.3_final/centos/syslinux-3.11-4.x86_64.rpm | cpio-Div <br/> # cp./usr/lib/syslinux/pxelinux.0/tftpboot(3) install and configure the ftp server a) install vsftp # Rpm-IVH/Media/centos_5.3_final/centos/vsftpd-2.0.5-12.el5.x86_64.rpmB) Copy all the files in/media/CentOS_5.3_Final/to the/var/ftp directory and test the ftp connectivity. This is a common practice. I will not list the specific practices here. 3. start the network and install it on the machine where the operating system is to be installed. Set the BIOS to start from the NIC, and then start the computer to automatically enter the installation program. When selecting the installation media, select ftp, enter the ftp address xx. xx. xx. xx, select the installation path as/(the ftp root path), and then click "Next" on the single machine. The installation process is the same as that on the CD.