In a recent study of the RHCE course, the previous article briefly tells you how to use Ftp+http+kickstart as a KVM VM network installation process, read: http://gshao.blog.51cto.com/3512873/1882392
Today we talked about PXE installation RHEL7
Environment:
Virtual Host: RHEL 7.0
Hardware: 4vcpu+8g+40gdisk
IP Address: 172.16.38.10
1. Making a local source
[[email protected] ~]# Mkdir/mnt/dvd #创建/mnt/dvd directory for mounting cdrom[[email protected] ~]# Mount/dev/sr0/mnt/dvd #挂载光盘
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M02/8B/B5/wKiom1hV_bKCHfLTAAAvreWKH7o596.png "height=" 124 "/>
[Email protected] ~]# Vim/etc/yum.repos.d/rhel.repo #新建本地源配置文件 [[email protected] ~]# Cat/etc/yum.repos.d/rhel.repo #显示本地源配置文件 [Rhel7] name=rhel7 Baseurl=file:///mnt/dvd enabled=1 gpgcheck=0
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M02/8B/B1/wKioL1hV_bLCPeHwAAAahOSqhpE024.png "height="/>
2. Install the FTP service and publish the KS file;
[email protected] ~]# Yum install vsftpd-y #安装vsftpd服务
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M00/8B/B5/wKiom1hV_bPCw44sAABBxCcVcVI675.png "height=" 424 "/>
Start the service;
[Email protected] ~]# systemctl restart vsftpd #启动服务 [[email protected] ~]# systemctl enable vsftpd #启用服务ln-S '/usr/ Lib/systemd/system/vsftpd.service '/etc/systemd/system/multi-user.target.wants/vsftpd.service ' [[Email protected ] ~]# systemctl status vsftpd #查看服务状态
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M02/8B/B5/wKiom1hV_bPQKWLOAABJFZqG8Vo652.png "height=" 194 "/>
3. In fact, we can use the first time we installed the system after the Ks.cfg file, I do not talk about kickstart service here;
[Email protected] ~]# cp/root/anaconda-ks.cfg/var/ftp/pub/ks.cfg #复制ks文件
From can see we install CD installation into HTTP mode, and fill in the corresponding URL address;
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M01/8B/B5/wKiom1hV_bTDS7piAAA2UoYDlXs227.png "height=" 245 "/>
4. Install HTTP
[email protected] ~]# Yum install httpd-y #安装httpd服务
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M00/8B/B1/wKioL1hV_bSSzd8-AABUa-O1zo8298.png "height=" 381 "/>
[Email protected] ~]# systemctl restart httpd #重启服务 [[email protected] ~]# systemctl enable httpd #启用服务 [[Email Pro Tected] ~]# systemctl status Httpd.service #查看服务状态
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M02/8B/B5/wKiom1hV_bXBn4wCAABdSHF3hHQ527.png "height=" 249 "/>
[[email protected] ~]# Mkdir/var/www/html/dvd #新建dvd目录, installation source for HTTP [[email protected] ~]# MOUNT/DEV/SR0/VAR/WWW/HTML/DV D #挂载光盘
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M01/8B/B1/wKioL1hV_bXiRWeyAAB42A8i3bo622.png "height=" 579 "/>
5. Install DHCP
[email protected] ~]# Yum install dhcp-y #安装DHCP服务
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M00/8B/B5/wKiom1hV_baRForPAAA7de66eCs138.png "height=" 419 "/>
[[email protected] ~]# cp /usr/share/doc/dhcp-4.2.5/ dhcpd.conf.example /etc/dhcp/dhcpd.conf #复制配置模板到/etc/dhcp/dhcpd.conf[[email protected] ~]# vim /etc/dhcp/dhcpd.conf #编辑dhcpd配置文件 [[email protected] ~]# cat /etc/dhcp/dhcpd.conf #显示dhcpd. conf file Information subnet 172.16.38.0 netmask 255.255.255.0 { range 172.16.38.20 172.16.38.25 ; next-server 172.16.38.10; filename "pxelinux.0"; }
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M02/8B/B1/wKioL1hV_bbBlZTeAAAYcRuefvo141.png "height=" 107 "/>
[Email protected] ~]# systemctl restart DHCPD #重启服务 [[email protected] ~]# systemctl status Dhcpd.service #查看服务状态
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M00/8B/B1/wKioL1hV_bfCoAzNAABzE7tizdY694.png "height=" 347 "/>
6. Install the TFTP service;
[email protected] ~]# Yum install tftp-server–y #安装tftp服务
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M01/8B/B5/wKiom1hV_bjj43T_AAA24FMbWN4826.png "height=" 291 "/>
[[email protected] ~]# vim/etc/xinetd.d/tftp #修改保护进程文件, let tftp start
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M01/8B/B1/wKioL1hV_biSMQrWAAAlJjAykcI022.png "height=" 191 "/>
[Email protected] ~]# systemctl restart Xinetd.service #重启服务
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M02/8B/B1/wKioL1hV_biBsUogAAAYPX92xQg120.png "height="/>
7. Installation of syslinux services;
[[email protected] ~]# Yum install syslinux-y #安装syslinux服务, providing boot files, cores, mirrors, etc.
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M01/8B/B1/wKioL1hV_bmTqCwqAAA8KpiDYoo574.png "height=" 412 "/>
[Email protected] ~]# cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot/#复制文件 [[email protected] ~]# Ll/mnt/dvd/isol inux/#查看文件
Total 72811
-r--r--r--. 1 GSH GSH 2048 May 7 Boot.cat
-r--r--r--. 1 GSH GSH 7 boot.msg
-r--r--r--. 1 GSH GSH 321 May 7 grub.conf
-r--r--r--. 2 GSh GSH 35544564 May 7 initrd.img
-r--r--r--. 1 GSh gsh 24576 May 7 Isolinux.bin
-r--r--r--. 1 GSH GSH 3166 May 7 isolinux.cfg
-r--r--r--. 1 GSh gsh 176500 Jan 2 memtest
-r--r--r--. 1 GSH GSH 186 Mar 3 splash.png
-r--r--r--. 1 GSh GSH 2438 May 7 TRANS. TBL
-r--r--r--. 2 GSh GSH 33744152 May 7 upgrade.img
-r--r--r--. 1 GSh gsh 155792 VESAMENU.C32
-r-xr-xr-x. 2 GSh GSH 4902000 May 5 Vmlinuz
[Email protected] ~]# cd/mnt/dvd/isolinux/#切换目录 [[email protected] isolinux]# CP isolinux.cfg VESAMENU.C32 Vmlinuz in itrd.img/var/lib/tftpboot/#复制文件
[Email protected] isolinux]# ls/var/lib/tftpboot/#查看文件initrd. img isolinux.cfg pxelinux.0 VESAMENU.C32 vmlinuz
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M00/8B/B1/wKioL1hV_brx0QHCAABuvR0hDh0200.png "height=" 314 "/>
[Email protected] tftpboot]# mkdir pxelinux.cfg #新建目录 [[email protected] tftpboot]# CP isolinux.cfg Pxelinux.cfg/default #复制文件 [[email protected] tftpboot]# vim Pxelinux.cfg/default #修改文件
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M02/8B/B1/wKioL1hV_brwcz6lAAA0aRGnfII234.png "height=" 192 "/>
8. Create a new virtual machine and install the Rhel system via PXE;
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M00/8B/B1/wKioL1hV_bvD0FSrAAAwv8Qdu-U961.png "height=" 561 "/>
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M01/8B/B5/wKiom1hV_buQBecSAAAedOJ6Log467.png "height=" 402 "/>
650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M02/8B/B5/wKiom1hV_bzjQhuhAAHp1f1MPR0915.png "height=" 645 "/>
This article from "Gs_hao" blog, declined reprint!
RHCE Pxe+dhcp+tftp+ftp/http+kickstart for PXE installation RHEL7