Configure PXE network startup server in RHEL/CentOS 7

Source: Internet
Author: User

Configure PXE network startup server in RHEL/CentOS 7

PXE Server -- pre-start execution environment -- instructs the client computer to Start, Run, or install the operating system directly from the network interface, without burning a CD/DVD or using a certain physical media, it can reduce the workload of installing the Linux release on multiple machines on your network at the same time.

Set PXE network startup in RHEL/CentOS 7

Pre-reading
  • CentOS 7 minimal installation steps
  • RHEL 7 minimal installation steps
  • Configure static IP addresses in RHEL/CentOS 7
  • Remove services not in RHEL/CentOS 7
  • Install the NTP server to set the correct time for RHEL/CentOS 7

This article describes how to install and configure a PXE Server on RHEL/CentOS 7 64-bit with a local image installed repository. The repository source is provided by the ISO image of CentOS 7 DVD, DNS is provided by the DNSMASQ server.

This machine provides DNS and DHCP services for the Syslinux package for network boot and guidance, TFTP-Server-provides a boot image that can be downloaded using the small File Transfer Protocol over the network, and the VSFTPD server that provides locally Mounted DVD images-it will assume the role of the Official RHEL/CentOS 7 image installation repository, where the installer will extract the required package.

Step 1: install and configure the DNSMASQ Server

1. you do not need to be reminded to determine your network interface card. Unless your server has multiple network interface cards, the NIC must have a static IP address, the IP address must be in the network segment where you want to provide the PXE service.

Then, after you have configured the static IP address, update your system and perform other initial settings. Run the following command to install the DNSMASQ process.

  1. # Yum install dnsmasq

Install the dnsmasq package

2. The default main configuration file of DNSMASQ is located in the/etc directory. Although it can be understood without any instructions, it is indeed quite difficult to edit, even if there are detailed descriptive annotations.

First, make sure that you have backed up the file so that you can recover it later. Then, use your favorite text editor to create a new empty configuration file. The command is as follows.

  1. # Mv/etc/dnsmasq. conf/etc/dnsmasq. conf. backup
  2. # Nano/etc/dnsmasq. conf

3. copy and paste the following configuration to the dnsmasq. conf file, and make sure to modify the configuration according to the following instructions to adapt to your network settings.

  1. Interface = eno16777736, lo
  2. # Bind-interfaces
  3. Domain = centos7.lan
  4. # DHCP range-leases
  5. Dhcp-range = eno16777736, 192.168.1.3, 192.168.1.253, 255.255.255.0, 1 h
  6. # PXE
  7. Dhcp-boot = pxelinux.0, pxeserver, 192.168.1.20
  8. # Gateway
  9. Dhcp-option = 3, 192.168.1.1
  10. # DNS
  11. Dhcp-option = 6, 92.161.1, 8.8.8.8
  12. Server = 8.8.4.4
  13. # Broadcast Address
  14. Dhcp-option = 28, 10.0.0.255
  15. # NTP Server
  16. Dhcp-option = 42, 0.0.0.0
  17.  
  18. Pxe-prompt = "Press F8 for menu.", 60
  19. Pxe-service = x86PC, "Install CentOS 7 from network server 192.168.1.20", pxelinux
  20. Enable-tftp
  21. Tftp-root =/var/lib/tftpboot

Dnsmasq Configuration

The statements you need to modify include the following:

  • Interface-the network interface that the server needs to listen to and provide services.
  • Bind-interfaces-uncomment to bind to this network interface
  • Domain-Replace with your domain name.
  • Dhcp-range-replace the network segment defined for your network mask.
  • Dhcp-boot-replace this IP address with your network interface IP address.
  • Dhcp-option = 3, 192.168.1.1-replace this IP address with the gateway of your network segment.
  • Dhcp-option = 6, 92.161.1-replace this IP address with your DNS server IP-you can define multiple IP addresses.
  • Server = 8.8.4.4-the IP address of the DNS forwarding server is placed here.
  • Dhcp-option = 28, 10.0.0.255-replace the IP address with the network broadcast address-optional.
  • Dhcp-option = 42, 0.0.0.0-put the network clock server here -- Optional (0.0.0.0 Address indicates refer to itself ).
  • Pxe-prompt-keep default -- press F8 to enter the menu and wait for 60 seconds.
  • Pxe = service-use x86PC as the 32/64-bit architecture, and enter the menu description prompt in the string quote. Other types of values can be: PC98, IAEFI, Alpha, ArcX86, IntelLeanClient, IA32EFI, BCEFI, XscaleEFI and X86-64EFI.
  • Enable-tftp-enable the built-in TFTP server.
  • Tftp-root-use/var/lib/tftpboot-location of all network startup files.

For other advanced options related to the configuration file, see the dnsmasq manual.

Step 2: Install SYSLINUX Boot Loader

4. After editing and saving the main configuration file of DNSMASQ, we will continue to install Syslinux PXE to start the loader. The command is as follows.

  1. # Yum install syslinux

Install Syslinux Boot Loader

5. the PXE Boot Loader file is located in the absolute path of the/usr/share/syslinux system. You can view it by listing the content in this path. This step is not required, but you may need to know the path, because in the next step, we will copy all the content under this path to the TFTP server path.

  1. # Ls/usr/share/syslinux

Syslinux File

Step 3: Install TFTP-Server and add SYSLINUX to load the starter

6. Now, let's go to the next step and install TFTP-Server. Then, copy the Syslinux package in the above location to provide all the boot loader files to the/var/lib/tftpboot path. The command is as follows.

  1. # Yum install tftp-server
  2. # Cp-r/usr/share/syslinux/*/var/lib/tftpboot

Install the TFTP Server

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • 3
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.