PXE+TFTP+DHCP network automatically boots and installs Linux

  

PXE (preboot execute environment) is the latest technology developed by Intel Corporation. It works in the network mode of Client/Server and supports workstations to download images from remote servers through the network. This supports the boot process of the operating system
from the network. During the startup process, the terminal requests the server to assign an IP address, and then downloads a protocol using the TFTP (trivial file transfer protocol) or MTFTP (multicast trivial file transfer protocol) protocol. The software package is started and executed in the local memory, and the terminal basic software setting is completed by the startup software package, thereby guiding the terminal operating system
pre-installed in the server. PXE can boot a variety of operating systems
, such as: Windows
95/98/2000/xp/2003/vista/2008, linux, etc.

The most direct performance of PXE is that the workstation can save the hard disk in the network environment, but it is not the concept of the diskless station, because the PC using this technology runs at the speed of the network mode. More than 3 times faster than a disk PC. Of course, the PC using PXE is not a TERMINAL terminal in the traditional sense, because the PC using PXE does not consume the CPU, RAM and other resources of the server, so the hardware requirements of the server are extremely low. Network cloning PXE is now the most widely used one is the diskless technology of Internet cafes. In the network maintenance and installation of the disk field, PXE can be the best booting technology for the unified installation and maintenance of the Internet cafe system. The boot speed and stability of PXE are first-class!

A: Installation environment

A Linux server, you need to install tftp+dhcp on the linux service as a remote installation network server. The client host, which is the host that needs to install the Linux system, must support booting from the network.

Second: Install and configure the necessary software tftp and dhcp on the Linux network server

1: Check if tftp[root@webserver html]# rpm -qa tftp*tftp-server-0.42 is installed. -3.1.el5.centostftp-0.42-3.1.el5.centos If it is not displayed, it means no installation. If your system supports yum, execute [root@webserver html]# yum install *tftp*2: check if dhcp is followed. Service [root@webserver html]# rpm -qa dhcp* dhcpv6-client-1.0.10-16.el5dhcp-3.0.5-18.el5 If dhcp is not installed, you can also perform yum installation. [root@webserver html]#yum install dhcp*3: Configure tftp service for dhcp service (1) Configure tftp service Tftp is bound to xinetd service by default. Therefore, you need to modify tftp file to /etc/xinetd. Completed under d, the modified tftp file is as follows, where the “disable“ option is changed from “yes” to “or” and “no” is added to the server_args option to allow any user to access. [root@webserver html]# more /etc/xinetd.d/tftp# default: off# description: The tftp server serves files using the trivial file transfer \\# protocol. The tftp protocol is often used to boot diskless \\# workstations, Download configuration files to network-aware printers, \\# and to start the installation process for some operating systems.service tftp{socket_type = dgramprotocol = udpwait = yesuser = rootserver = /usr/sbin/in.tftpd

server_args = -u nobody -s /tftpbootdisable = noper_source = 11cps = 100 2flags = IPv4}(2) Configure the default dhcp configuration file for the dhcp service in /etc/dhcpd.Conf. This file is an empty file by default, so we copy a dhcpd first. The template file of the configuration file comes over and can be modified. [root@webserverhtml]# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf The default /etc/dhcpd.conf has the following meaning: ddns-update-style interim; //Set dhcp interactive update mode ignore client-updates; //ignore client update subnet 192.168.12.0 netmask 255.255.255.0 { //set the subnet declaration # --- default gatewayoption routers 192.168.12.1; //set the client default gateway Option subnet-mask 255.255.255.0; //Set the client terminal netmask option nis-domain "ixdba.net "; //Set the NIS domain option domain-name " ixdba.net "; //Set the DNS domain Option domain-name-servers 192.168.12.1; //Set the DNS server address option time-offset -18000; # Eastern Standard Time //Set the time offset# option ntp-servers 192.168.12.1;# option netbios-name-servers 192.168. 12.1;# --- Selects point-to-point node (default is hybrid). Don't change this unless# -- you understand Netbios very well# option netbios-node-type 2; range dynamic-bootp 192.168.12.128 192.168 .12.254; //Set the address pool default-lease-time 21600; //Set the default lease period in seconds max-lease-time 43200; //Set the maximum lease duration of the client in seconds # we want the nameserver to appear at a fixed addresshost ns { //The following settings assign static IP Address, not much explanation. Next-server marvin.redhat.com;hardware ethernet 12:34:56:78:AB:CD; fixed-address 207.175.42.254;}} will work fine with the default, but we can also according to our needs To make changes. Other notes: range 192.168.12.2 192.168.12.125; The range of assigned IP addresses can be limited. If you want to assign a fixed IP address to an IP, modify the host one, bind the Mac card's Mac address and IP, and the last one is changed to the corresponding one. The network segment defined in the subnet should be consistent with the network segment where your network card IP is located. That is to say, for example, your network card is 192.168.0.x, and the dhcp service is not available for the 10.1.1.0 subnet. Can't start. In the experimental environment of this article, my dhcpd.conf content is as follows: [root@webserver html]# more /etc/dhcpd.conf ddns-update-style interim;ignore client-updates;

subnet 192.168.12.0 Netmask 255.255.255.0 {

option routers 192.168.12.1;option subnet-mask 255.255.255.0;

option nis-domain "ixdba.net";

option domain -name "ixdba.net";option domain-name-servers 192.168.12.1;

Copyright © Windows knowledge All Rights Reserved