PXE 实验

前置

1.rhel7主机

2.开启主机图形 ,init 5 开图形

3.配置网络可用

4.关闭vmware dhcp功能

实验步骤

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

[root@localhost ~]# yum install system-config-kickstart -y

2.启动图形制作工具

[root@localhost ~]# system-config-kickstart 

3.图形选择

最后点击左上角文件保存到/root即可,默认命名ks.cfg

[root@localhost ~]# ksvalidator ks.cfg 

检验ks.cfg文件是否完整

4.下载httpd包,并移动ks文件,生成软连接

[root@localhost ~]# yum install httpd -y
[root@localhost ~]# mv ks.cfg /var/www/html/
[root@localhost ~]# ln -s /rhel7/ /var/www/html/
[root@localhost ~]# ll /var/www/html/
总用量 4
-rw-r--r--. 1 root root 1187 8月   5 17:12 ks.cfg
lrwxrwxrwx. 1 root root    7 8月   5 17:24 rhel7 -> /rhel7/
[root@localhost ~]# 
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl start httpd

5.浏览器访问ks.cfg文件

6.安装dhcp服务器为其他服务器提供分配ip的功能

[root@localhost ~]# yum install dhcp -y
#生成配置文件
[root@localhost ~]# \cp -f /usr/share/doc/dhcp*/dhcpd.conf.example 
/etc/dhcp/dhcpd.conf 
[root@localhost ~]# vim /etc/dhcp/dhcpd.conf     #看下图
[root@localhost ~]# systemctl enable --now dhcpd
Created symlink from /etc/systemd/system/multi-user.target.wants/dhcpd.service to /usr/lib/systemd/system/dhcpd.service.
[root@localhost ~]# 

修改一下ks.cfg

[root@localhost ~]# vim /var/www/html/ks.cfg 

另外克隆一个虚拟机操作

显示全x就是没有问题

7.共享pxelinux.0数据文件的网络服务

[root@localhost ~]# yum install syslinux.x86_64 -y
[root@localhost ~]# yum install tftp-server.x86_64 
[root@localhost ~]# systemctl enable --now tftp
Created symlink from /etc/systemd/system/sockets.target.wants/tftp.socket to /usr/lib/systemd/system/tftp.socket.
[root@localhost ~]# 
[root@localhost ~]# cp /rhel7/isolinux/* /var/lib/tftpboot/
[root@localhost ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
[root@localhost ~]# cd /var/lib/tftpboot/
[root@localhost tftpboot]# mkdir pxelinux.cfg
[root@localhost tftpboot]# cp isolinux.cfg pxelinux.cfg/default

编辑/etc/dhcp/dhcpd.conf

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

编辑 pxelinux.cfg/default 

[root@localhost tftpboot]# vim pxelinux.cfg/default 

重启服务

[root@localhost tftpboot]# systemctl restart tftp
[root@localhost tftpboot]# systemctl restart dhcpd

在另外虚拟机开机选择 打开电源时进入固体

回车即可

全部显示x基本完成了

  • 7
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值