PXE的安装

一、实验环境
一台红帽7.9的主机,配置网络可用。
1、开启RHEL7的机子,确保有图形界面

# 下载图形界面

yum group install "Server with GUI" 

# 切换到图形界面

init 5 

2.安装httpd服务

安装httpd:[root@localhost ~]# yum install httpd -y
开启httpd:[root@localhost ~]# systemctl start httpd

二、实验过程

1、安装图形化生成kickstart自动安装脚本的工具

[root@nginx ~]# cat /root/anaconda-ks.cfg
[root@nginx ~]# yum install system-config-kickstart

2、启动图形制作工具
[root@nginx ~]# system-config-kickstart

安装方式:http://172.25.254.150/rherl7 

保存

保存到Root里面:

3.安装HTTP并共享文件

#下载httpd

[root@nginx ~]yum install httpd -y

#将文件复制到默认发布目录

[root@nginx ~]cp /root/ks.cfg /var/www/html/

[root@nginx ~]ln -s /rhel7/ /var/www/html/

[root@nginx ~]# cd /var/www/html/

[root@nginx html]# ls

ks.cfg  rhel7

4.测试

5.安装dhcp服务器

[root@nginx ~]# yum install dhcp -y

[root@nginx ~]# rpm -qc dhcp

[root@nginx ~]# cat /etc/dhcp/dhcpd.conf

DHCP Server Configuration file.

see /usr/share/doc/dhcp*/dhcpd.conf.example

see dhcpd.conf(5) man page

[root@nginx ~]# \cp -f /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf

[root@nginx ~]# vim /etc/dhcp/dhcpd.conf

公司域名,对外说的dns地址----------------------------“zyq.org”

 网络位、子网掩码------------------------------------------subnet 172.25.254.0 netmask 255.255.255.0

地址池----------------------------------------------------------range 172.25.254.30 172.25.254.50;

网关-------------------------------------------------------------option routers 172.25.254.2;

删除37行以后的内容

# 重启dhcp

[root@nginx ~]systemctl enable --now dhcpd

6、安装配置syslinux和tftp

[root@nginx ~]yum install syslinux.x86_64 -y

[root@nginx ~]yum install tftp-server.x86_64 -y

# 启动tftp来共享pxelinux.0数据文件

[root@nginx ~]systemctl enable --now tftp

# 将所需资源导入/var/lib/tftpboot/

[root@nginx ~]cp /rhel7/isolinux/* /var/lib/tftpboot/

[root@nginx ~]cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

# 查看/var/lib/tftpboot/

[root@nginx ~]cd /var/lib/tftpboot/

[root@node1 tftpboot]# ls
boot.cat  grub.conf   isolinux.bin  memtest     splash.png  upgrade.img   vmlinuz
boot.msg  initrd.img  isolinux.cfg  pxelinux.0  TRANS.TBL   vesamenu.c32

# 进入dhcp配置文件添加

[root@nginx ~]vim /etc/dhcp/dhcpd.cof

subnet 172.25.254.0 netmask 255.255.255.0 {

range 172.25.254.30 172.25.254.50;

option routers 172.25.254.2;

next-server 172.25.254.20;

filename"pxelinux.0"

7、修改文件

[root@nginx tftpboot]# vim /etc/dhcp/dhcpd.conf

lable linux 
menu  lablle  ^Install Red Hat Enterprise Linux 7.9
menu defautt
kernel vmtinuz
append initrd=initrd.img  repo=http://172.25.254.150/rhel7    ks=http://172.25.254.150/ks.cfg  quiet
label check
menu label Test^media & install Red Hat Enterprise Linux 7.9
#menu default
Kerneu vmlinuz
append initrd=initrd.img    inst.stage2=hd: LABEL=RHEL-7.9\x20server.x86_64 rd.live. check quiet

三、测试

1、进入固件

选择网卡启动   将Network boot from Intel E1000 放到最上面

2、安装好之后,立即关机,防止一直安装

3.开启虚拟机

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值