PXE installation condition preparation

step
To implement this case, follow the steps below.
Step 1: deploy the network YUM source of RHEL6
1) provide the client with the YUM source server based on FTP mode

[root@pxesvr ~]# Yum - y install vsftpd / / package loading
[root@pxesvr ~]# MKDIR / var / ftp / rhel6 / / create mount point
[root@pxesvr ~]# cp  -rf  /misc/cd/*  /var/ftp/rhel6/
.. ..  												//Copying disc data
[root@pxesvr ~]# Service vsftpd restart / / start the service
.. ..
[root@pxesvr ~]# chkconfig vsftpd on / / set power on to run automatically

2) access FTP source from client to ensure it is available
Use ftp client command to test:

[root@pc205 ~]# yum -y install ftp / / install the ftp command tool
.. .. 
[root@pc205 ~]# ftp 192.168.4.5
Connected to 192.168.4.5 (192.168.4.5).
220 (vsFTPd 2.2.2)
Name (192.168.4.5:root): ftp  							//Login as anonymous user ftp
331 Please specify the password.
Password:  											//Arbitrary password
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls rhel6  										//View rhel6 directory list
227 Entering Passive Mode (192,168,4,5,243,116).
150 Here comes the directory listing.
.. ..
-r--r--r--    3 0        0           18092 Jun 30  2010 GPL
dr-xr-xr-x    3 0        0            2048 Nov 11  2013 HighAvailability
dr-xr-xr-x    3 0        0            2048 Nov 11  2013 LoadBalancer
dr-xr-xr-x    2 0        0          679936 Nov 11  2013 Packages
-r--r--r--    2 0        0           16435 Sep 02  2010 README
.. ..
ftp> quit
221 Goodbye.
[root@pc205 ~]#

Step 2: provide DNS domain name resolution service
1) use yum to install the required software package for DNS

Step 2: provide DNS domain name resolution service
 1) use yum to install the required software package for DNS
[root@pxesvr ~]# yum -y install bind bind-chroot
.. ..
[root@pxesvr ~]# rpm -q bind
bind-9.8.2-0.17.rc1.el6_4.6.x86_64
[root@pxesvr ~]# rpm -q bind-chroot
bind-chroot-9.8.2-0.17.rc1.el6_4.6.x86_64

2) modify the named.conf main configuration file

[root@pxesvr ~]# vim /etc/named.conf
options {
        directory "/var/named";
};
zone "tedu.cn" IN {  							//Define forward area
        type master;
        file "tedu.cn.zone";
};
zone "4.168.192.in-addr.arpa" IN {  				//Define reverse area
        type master;
        file "192.168.4.arpa";
};

3) establish positive and negative area data files

[root@pxesvr ~]# VIM / var / named / Tedu. CN. Zone / / forward parsing record file
$TTL 1D
@ SOA tedu.cn.  root.tedu.cn.  (
        2015052301
        8H
        2H
        4H
        1D
)
@       IN      NS      ns.tedu.cn.
ns      IN      A       192.168.4.5
pxesvr  IN      A       192.168.4.5
ftp     IN      A       192.168.4.5
$GENERATE  10-200      pc$     IN      A       192.168.4.$

[root@pxesvr ~]# VIM / var / named / 192.168.4. ARPA / / reverse parsing the record file
$TTL 1D
@ SOA tedu.cn.  root.tedu.cn.  (
        2015052301
        8H
        2H
        4H
        1D
)
@       IN      NS      ns.tedu.cn.
5       IN      PTR     pxesvr.tedu.cn.
$GENERATE  10-200      $       IN      PTR     pc$.tedu.cn.

4) start the named service and set it to start automatically

[root@pxesvr ~]# service  named  restart
[root@pxesvr ~]# chkconfig  named  on

5) make sure that DNS resolution of Pan domain name is available

[root@pxesvr ~]# vim /etc/resolv.conf
nameserver 192.168.4.5

[root@pxesvr ~]# nslookup pc20.tedu.cn / / query the forward record
Server:		192.168.4.5
Address:	192.168.4.5#53

Name:	pc20.tedu.cn
Address: 192.168.4.20

[root@pxesvr ~]# nslookup 192.168.4.20 / / query the reverse record
Server:		192.168.4.5
Address:	192.168.4.5#53

20.4.168.192.in-addr.arpa	name = pc20.tedu.cn.

Step 3: provide DHCP service supporting PXE boot
1) use yum to install the software package required for DHCP service

[root@pxesvr ~]# yum -y install dhcp
.. ..

2) establish DHCP service configuration

[root@pxesvr ~]# vim /etc/dhcp/dhcpd.conf
option domain-name "tedu.cn"; 
option domain-name-servers 192.168.4.5;
default-lease-time 7200;
max-lease-time 14400;
subnet  192.168.4.0  netmask  255.255.255.0  {
    range  192.168.4.10  192.168.4.200;
    option routers 192.168.4.254;
    next-server  192.168.4.5;            			//Specify the IP address of the PXE server
    filename  "pxelinux.0";           				//Specify PXE default file
}

3) start dhcpd service and set it to start automatically

[root@pxesvr ~]# service dhcpd restart 
Close dhcpd: [OK]
Starting dhcpd: [OK]

4) test from the client to ensure that the DHCP service is available

[root@pc205 ~]# dhclient -d eth0  
Internet Systems Consortium DHCP Client 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:0c:29:65:21:3c
Sending on   LPF/eth0/00:0c:29:65:21:3c
Sending on   Socket/fallback
DHCPOFFER from 192.168.4.5
DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x73b1002c)
DHCPACK from 192.168.4.5 (xid=0x73b1002c)
bound to 192.168.4.1 -- renewal in 2728 seconds.
^C  											//Press Ctrl+c
[root@pc205 ~]#

Tags: ftp yum DNS vim

Posted on Sun, 10 Nov 2019 07:55:22 -0800 by bravo14