制作pxe网络引导到安装

在制作之前需要准备的包

yum install tftp-server dhcp vsftpd syslinux

NO.1 在配置好的dhcp中加入这几个选项

subnet 192.168.0.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.0.102 192.168.0.111;
option routers 192.168.0.254;
filename "pxelinux.0";
next-server 192.168.0.79;
}

其中(有关dhcp的配置就不多说了

filename “pxelinux.0”是tftp根目录的相对路径

next-server是指向tftp的服务器

/etc/init.d/dhcpd restart

NO.2 Tftp的配置文件

[root@server37 httpd]# cd /etc/xinetd.d/
[root@server37 xinetd.d]# vim tftp

service tftp
{
socket_type             = dgram
protocol                = udp
wait                    = yes
user                    = root
server                  = /usr/sbin/in.tftpd
server_args             = -s /var/lib/tftpboot
disable                 = yes
per_source              = 11
cps                     = 100 2
flags                   = IPv4
}
~
~
~
~
/etc/init.d/xinted restart

 

NO.3 配置pxe开始

cd /var/lib/tftpboot/
mkdir pxelinux.cfg

 

挂载一个iso文件

[root@desktop13 rhel6.0]# ls
EFI                       RELEASE-NOTES-es-ES.html  RELEASE-NOTES-si-LK.html
EULA                      RELEASE-NOTES-fr-FR.html  RELEASE-NOTES-ta-IN.html
GPL                       RELEASE-NOTES-gu-IN.html  RELEASE-NOTES-te-IN.html
HighAvailability          RELEASE-NOTES-hi-IN.html  RELEASE-NOTES-zh-CN.html
images                    RELEASE-NOTES-it-IT.html  RELEASE-NOTES-zh-TW.html
isolinux                  RELEASE-NOTES-ja-JP.html  repodata
LoadBalancer              RELEASE-NOTES-kn-IN.html  ResilientStorage
media.repo                RELEASE-NOTES-ko-KR.html  RPM-GPG-KEY-redhat-beta
Packages                  RELEASE-NOTES-ml-IN.html  RPM-GPG-KEY-redhat-release
README                    RELEASE-NOTES-mr-IN.html  ScalableFileSystem
RELEASE-NOTES-as-IN.html  RELEASE-NOTES-or-IN.html  Server
RELEASE-NOTES-bn-IN.html  RELEASE-NOTES-pa-IN.html  TRANS.TBL
RELEASE-NOTES-de-DE.html  RELEASE-NOTES-pt-BR.html
RELEASE-NOTES-en-US.html  RELEASE-NOTES-ru-RU.html

 

 

cp isolinux/* /var/lib/tftpboot
cp /var/lib/tftpboot/isolinux.cfg   /var/lib/tftpboot/pxelinux.cfg/default
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

 

 

NO.4配置好FTP服务,保证源文件的引导

ftp://192.168.1.252/pub/rhel6
ftp://192.168.1.252/pub/ks.cfg

制作ks.cfg可以使用kickstart的图形界面进行制作

 

 

NO.5在default的文件中加入ks.cfg

label small-install
menu label rhel6-install
kernel vmlinuz
append initrd=initrd.img ks=ftp://192.168.1.252/pub/ks.cfg noipv6

 

本文出自 “永无止境” 博客,转载请与作者联系!

你可能感兴趣的:(pxe)