当前位置:网站首页>PXE网络装机
PXE网络装机
2022-07-28 14:39:00 【不会调制解调的猫】
目录
环境准备
安装启用DHCP并配置文件
检查是否安装dhcp,没有则直接yum安装
yum install -y dhcp
复制
cp -rfp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
修改配置文件
vim /etc/dhcp/dhcpd.conf
subnet 192.168.150.0 netmask 255.255.255.0 { #配置IP和子网掩码
range 192.168.150.100 192.168.150.200; #配置地址池
option domain-name-servers 114.114.114.114; #配置域名解析
option routers 192.168.150.1; #配置网关
next-server 192.168.150.1;
filename "pxelinux.0" #配置引导文件
}

配置网卡
配置完成后去添加一块新的网卡

此时我们ifconfig检查一下,会发现多了一块网卡出来

然后我们拷贝一份ens33到ens37里面,并进入ens37网卡里面进行设置

配置TFTP
yum -y install tftp-server
yum -y install xinetd
vim /etc/xinetd.d/tftpservice tftp
{
socket_type = dgram
protocol = udp
wait = yes
//wait no表示客户机可以多台一起连接,yes表示客户机只能一台一台连接,表示是否开启多线程一起工作,否则需要等待
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
//指定TFTP根目录(引导文件的存储路径) -c允许上传
disable = no //修改 disable no表示开启TFTP服务
per_source = 11
//通过限制一个主机的最大连接数,从而防止某个主机独占某个服务,这里每个IP地址的连接数是11个
cps = 100 2
//表示服务器最多启动100个连接,如果达到这个数目将停止启动新服务2秒。在此期间不接受任何请求
flags = IPv4
}systemctl enable tftp
systemctl start tftp引导文件vmlinuz 和 initrd.img
mount /dev/cdrom /mnt
cp /mnt/images/pxeboot/initrd.img vmlinuz /var/lib/tftpboot/ systemctl start xinetd
systemctl enable xinetd
systemctl start tftp
systemctl enable tftp 引导文件pxelinux.0
pxelinux.0是个二进制文件,主要作用相当于一个系统安装步骤的指引,引导客户端如何安装系统
yum provides */pxelinux.0 查找其位置并复制到/var/lib/tftpbooot/
rpm -ql syslinux | grep pxelinux.0
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ 配置启动菜单文件
因为由pxelinux.0这个文件决定是/var/lib/tftpboot/pxelinux.cfg/default文件,所以我们只要在/var/lib/tftpboot/下手动创建
mkdir /var/lib/tftpboot/pxelinux.cfg
vim /var/lib/tftpboot/pxelinux.cfg/default default auto //指定默认入口名称 ,对应下面的label auto
prompt 1
//设置是否等待用户选择,1 表示等待用户控制,0表示不等待用户控制,安装时会出现boot:如果按回车
表示选择auto模式
label auto //默认的图形安装
kernel vmlinuz
append initrd=initrd.img method=ftp://192.168.150.30/centos7
//method必须指定网络路径
label linux text //文本安装模式,出现boot:时输入linux text
kernel vmlinuz
append text initrd=initrd.img method=ftp://192.168.150.30/centos7
label linux rescue //救援模式,出现boot:时输入linux rescue
kernel vmlinuz
append rescue initrd=initrd.img method=ftp://192.168.150.30/centos7 kickstart
安装system-config-kickstart
yum install -y system-config-kickstart
打开Kickstart配置程序窗口








保存至/var/ftp/下,文件名 ks.cfg
可以对ks进行优化
vi /var/lib/tftpboot/pxelinux.cfg/default
default auto
prompt 1
label auto
kernel vmlinuz
append initrd=initrd.img method=ftp://192.168.150.30/centos7 ks=ftp://192.168.100.100/ks.cfg
label linux text
kernel vmlinuz
append text initrd=initrd.img method=ftp://192.168.150.30/centos7 ks=ftp://192.168.100.100/ks.cfg
label linux rescue
kernel vmlinuz
append rescue initrd=initrd.img method=ftp://192.168.150.30/centos7 ks=ftp://192.168.100.100/ks.cfg边栏推荐
- MIT指出公开预训练模型不能乱用
- Camera连拍自动化测试shell脚本
- [jspwiki]jspwiki installation deployment and configuration
- 2、开源GPS项目HD-GR GNSS的自叙
- 位运算的一些操作
- Stateflow逻辑系统建模
- Nftscan and nftplay have reached strategic cooperation in the field of NFT data
- Explain the difference set, intersection set and union set of complex type set in detail.Net
- 19、通道分配任务定义
- 1200 times faster! MIT develops a new generation of drug research and development AI, and suspends the old model
猜你喜欢

Baidu proposes a dynamic self distillation method to realize dense paragraph retrieval by combining interactive model and double tower model

一篇文章了解RSocket协议

AS如何不区分大小写去进行智能提示

最小堆提升每次排序的效率

CANoe使用教程

Canoe tutorial

flowable工作流所有业务概念

Easy start, swagger

About the pictures inserted in the word document, only the following part is displayed

Easyexcel complex header export (one to many)
随机推荐
Leetcode - number of operations, non repeating numbers, diagonal traversal, Joseph Ring
Stateflow logic system modeling
有道云笔记去除底部广告
3. Basic constants and macro definitions
How to write a JMeter script common to the test team
Deepfacelab model parameters collection
Opencv - draw mask images of multiple instances
4.8 HD-GR GNSS导航软件源码
Five connection modes of QT signal and slot
Close independent windows and close other windows at the same time
字符串(3)
软件架构与设计(六)-----层次结构体
已拿下华为85亿元屏幕订单?维信诺回应:客户要求保密,无法回复!
全国211院校考研信息汇总整理
Framework定制系列(六)-----屏蔽FallbackHome手机启动中弹窗直接进入Launcher
Qt创建文件夹的两种方式区别
Pytorch - sequential and modulelist
Endnote is associated with word
腾讯面试之--请你设计一个实现线程池顺序执行
subst命令将一个文件夹镜像成本地的一个磁盘