码迷,mamicode.com
首页 > 其他好文 > 详细

pxe 手动装centos7

时间:2018-07-12 23:58:10      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:yum   drive   tftpboot   ofo   outer   share   end   ini   x64   

一、安装软件
yum install httpd xinetd syslinux tftp-server dhcp -y

二、配置pxe
cd /usr/share/syslinux/
cp pxelinux.0 menu.c32 memdisk mboot.c32 chain.c32 /var/lib/tftpboot/
vi /etc/xinetd.d/tftp #change “disable=yes” to “no”
mount -o loop /dev/cdrom /mnt/
mkdir /var/lib/tftpboot/centos7_x64
cp -fr /mnt/* /var/lib/tftpboot/centos7_x64/
chmod -R 755 /var/lib/tftpboot/centos7_x64/
mkdir /var/lib/tftpboot/pxelinux.cfg
cat > /var/lib/tftpboot/pxelinux.cfg/default << ‘HERE‘
default menu.c32
prompt 0
timeout 300
ONTIMEOUT local

menu title ########## PXE Boot Menu ##########

label 1
menu label ^1) Install CentOS 7
kernel centos7_x64/images/pxeboot/vmlinuz
append initrd=centos7_x64/images/pxeboot/initrd.img method=http://192.168.57.14/centos7_x64 devfs=nomount

label 2
menu label ^2) Boot from local drive localboot
HERE

三、配置dhcp
cat /etc/dhcp/dhcpd.conf
subnet 192.168.57.0 netmask 255.255.255.0 {
range 192.168.57.100 192.168.57.200;
option domain-name-servers 192.168.57.14;
option routers 192.168.57.4;
default-lease-time 600;
max-lease-time 7200;
next-server 192.168.57.14;
tftp-root /var/lib/tftpboot;
filename "pxelinux.0";
}

四、配置http
ln -s /var/lib/tftpboot/centos7_x64 /var/www/html/

五、开启服务
systemctl restart xinetd
systemctl restart httpd
systemctl restart dhcpd
systemctl restart tftpd
systemctl enable xinetd
systemctl enable httpd
systemctl enable dhcpd
systemctl enable tftpd

pxe 手动装centos7

标签:yum   drive   tftpboot   ofo   outer   share   end   ini   x64   

原文地址:http://blog.51cto.com/11578535/2141198

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!