There are multiple installation methods in Linux: HD, USB, CDROM, PXE, and remote management card. During our system O & M career, operating systems are often installed. However, we only maintain one or two machines, the average number of enterprise servers is dozens, hundreds, thousands, or even UEFIPXE.
There are multiple installation methods in Linux: HD, USB, CDROM, PXE, and remote management card. During our system O & M career, operating systems are often installed. However, we only maintain one or two machines, generally, the number of enterprise servers is dozens, hundreds, thousands, or even tens of thousands. If one of these machines is manually installed, our O & M personnel may spend most of their time installing the system. therefore, we usually create a PXE server to deploy systems in batches through the network.
With the upgrading of computer products and the development of IT enterprises, a company has more and more computer models and hard disks. Therefore, our maintenance methods must keep pace with the times. This paper mainly introduces the hardware environment differences, how to build a multi-purpose PXE server, the following CentOS-6.4-x86_64 version as an example, the server configuration.
1. PXE system deployment for general machines
To automatically obtain the IP address, install linux as follows: enable the PXE Nic on the client-end --> broadcast dhcp requests through the Bootp protocol --> DHCP server --> obtain the IP address, TFTP server address --> Download pxelinux.0 and vmlinuz and initrd from TFTP. img --> start the system --> (go to the specified url to download ks. cfg file --> According to ks. cfg file to the NFS/HTTP/FTP server to automatically download the software package) install the system --> complete the installation.
FTP server is mainly used to publish the installation tree for linux systems (NFS, HTTP, or HTTPS can also be used ), the DHCP server assigns an ip address to the client and provides the TFTP server address and the PXE startup file location. the TFTP server provides the boot file for the client. The three services can be installed on the same server or on the three servers.
1. install and configure the FTP server
- [root@pxe ~]# yum install vsftpd
- [root@pxe ~]# chkconfig vsftpd on
- [root@pxe ~]# service vsftpd start
The default configuration file of vsftpd is in/etc/vsftpd. conf. the shared directory is under/var/ftp/pub/. you can directly use it without any modifications. After the installation, copy all the system disk images to this directory or mount them to this directory. I just mounted the disk image here because there is a ks. the cfg file is to be sent here, so I have created a mirror directory and mounted the system image to/var/ftp/pub/mirror.
2. install and configure the DHCP server
- [root@pxe ~]# yum install dhcp
It is important to edit the configuration file.
- [Root @ pxe ~] # Vim/etc/dhcp/dhcpd. conf
- Default-lease-time 600;
- Max-lease-time 7200;
- Ddns-update-style none;
- Subnet 10.12.190.0 netmask 255.255.255.0 {
- Range dynamic-bootp 10.12.190.100 10.12.190.120;
- Option routers 10.12.190.254;
- Option subnet-mask limit 255.0;
- Filename "pxelinux.0"; // if it is not in the TFTP root directory, write the Directory
- Next-server 10.12.190.140; // tftp server address
- }