使用ipxe安装现有的装机环境

iPXE和传统PXE区别

iPXE和传统PXE(Pre-boot Execution Environment,预启动执行环境)的主要区别在于它们的功能和协议支持。以下是两者的主要区别:

  1. 协议支持:

    • PXE仅支持TFTP(trivial file transfer protocol)协议,这可能导致下载速度较慢,尤其是在下载较大的启动软件包时。
    • iPXE不仅支持TFTP,还支持HTTP、NFS等多种网络协议,这大大提高了下载速度和灵活性。
  2. 功能和安全性:

    • PXE的功能相对较少,它主要通过网络启动操作系统,并在启动过程中通过TFTP或MTFTP协议下载启动软件包。
    • iPXE提供了更多的功能,包括支持多种网络协议、HTTPS网络安全通信、自定义脚本启动流程设置等,这使得iPXE比PXE更加强大和灵活。
  3. 服务器从盘启动:

    • iPXE支持服务器从盘启动,这是一种通过以太网存储协议如iSCSI挂载启动盘到服务器,然后以类似本地加载的方式获取第二阶段的BootLoader,从而加载kernel并进入操作系统的启动方式。这种方式对于无盘工作站非常有用。
    • 需要注意的是,从安全性和可靠性的角度来看,iPXE的云盘启动可能不如本地磁盘启动。
  4. 其他优点:

    • PXE的优点包括规模化(同时装配多台服务器)、自动化(安装系统和配置服务)和远程实现(不需要安装介质),但这些优点依赖于在同一广播域中的使用。

综上所述,iPXE相比传统PXE提供了更多的网络协议支持、更强大的功能和安全性,以及服务器从盘启动的额外能力。这些特点使得iPXE成为了一个更先进、更灵活的网络启动解决方案。

iPXE使用线上内核装机测试

cat /etc/dhcp/dhcpd.conf

bash 复制代码
include "/etc/dhcp/ipxe.conf";

ddns-update-style interim;
ignore client-updates;
allow unknown-clients;
allow bootp;
allow booting;
ping-check true;
default-lease-time 1800;
max-lease-time 1800;

group host_pool {
    allow bootp;
    allow booting;
    default-lease-time 1800;
    max-lease-time 2400;

    next-server 10.4.24.29;
    filename "gpxelinux.0";
 
    if exists user-class and option user-class = "iPXE" {
        filename "uefipxe/BOOTX64.EFI";
    }
    else if option client-arch != 00:00 {
        filename "ipxe.efi";
    }
    else {
        filename "gpxelinux.0";
    }

subnet 10.4.0.0 netmask 255.255.255.0 {
    option routers 10.4.0.254;
    option subnet-mask 255.255.255.0;
    range  dynamic-bootp 10.4.0.200 10.4.0.240;
} 
subnet 10.4.24.0 netmask 255.255.255.0 {
    option routers 10.4.24.254;
    option subnet-mask 255.255.255.0; 
    range  dynamic-bootp 10.4.24.200 10.4.24.240; 
}
subnet 10.4.25.0 netmask 255.255.255.0 {
    option routers 10.4.25.254;
    option subnet-mask 255.255.255.0; 
    range  dynamic-bootp 10.4.25.200 10.4.25.240; 
}
subnet 10.4.33.0 netmask 255.255.255.0 {
    option routers 10.4.33.254;
    option subnet-mask 255.255.255.0;
    range  dynamic-bootp 10.4.33.200 10.4.33.240;
}
}

cat /var/lib/tftpboot/pxelinux.cfg/default

bash 复制代码
label linux
  kernel http://10.4.24.29/centos7-pxe/vmlinuz
  append initrd=http://10.4.24.29/centos7-pxe/initrd2.cpio.gz  devfs=nomount ramdisk_size=9960000 idle=poll inst.gpt
  ipappend 2

装机测试

​解决方法:修改default文件,添加关于界面显示的参数

bash 复制代码
default vesamenu.c32
timeout 600

display boot.msg

menu background splash.png
menu title CentOS 8.X
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13

# Border Area
menu color border * #00000000 #00000000 none

# Selected item
menu color sel 0 #ffffffff #00000000 none

# Title bar
menu color title 0 #ff7ba3d0 #00000000 none

# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none

# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none

# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none

# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none

# Help text
menu color help 0 #ffffffff #00000000 none

# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none

# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none

# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none

# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.


label linux
  kernel http://10.4.24.29/centos7-pxe/vmlinuz
  append initrd=http://10.4.24.29/centos7-pxe/initrd2.cpio.gz  devfs=nomount ramdisk_size=9960000 idle=poll inst.gpt
  ipappend 2

再次尝试重启,可以正常装机

cat /var/log/httpd/access_log

​pxe环境测试是否能使用http服务

pxelinux.0为测试版本

pxe环境下,default文件配置http协议,拉取文件时卡住

结论:pxe环境不支持http协议

pxelinux.0为公司版本

不使用http

能正常装机

使用http
复制代码
[root@10-4-70-200 pxelinux.cfg]# cat default
label linux
kernel http://10.4.24.29/centos7-pxe/vmlinuz
append initrd=http://10.4.24.29/centos7-pxe/initrd2.cpio.gz devfs=nomount ramdisk_size=9960000 idle=poll
ipappend 1

结论:pxe不支持http协议

相关推荐
zhouwy1132 天前
ARM汇编指令集详解
汇编·arm开发
山后太阳2 天前
Keil5(MDK-ARM)完整下载安装教程+入门教程:从零搭建STM32开发环境
arm开发·stm32·嵌入式硬件
zz_lzh2 天前
arm版AI牛马:armbian(rk3588)设备部署openclaw
arm开发·人工智能·arm
lanxiao88883 天前
F1C100S 内核
arm开发
杰杰桀桀桀4 天前
基于stm32ARM库函数的IIR二阶巴特沃斯低通滤波器--附完整代码
arm开发·stm32·嵌入式硬件·数字滤波器·巴特沃斯低通滤波
TBrL7UtdTELTTdut4BAL4 天前
ARM Cortex-A53 (无AES)平台加密网络转发性能测试与对比分析
arm开发·集成测试
AI服务老曹4 天前
架构实战:如何基于 GB28181 与异构计算构建跨平台(X86/ARM)AI 视频管理系统?源码交付深度解析
arm开发·人工智能·架构
CinzWS5 天前
A53 FPGA原型验证:从RTL到可运行系统的挑战
arm开发·嵌入式·芯片验证·原型验证·a53
AI服务老曹5 天前
深度解析:支持 GB28181/RTSP 及异构计算(X86/ARM+GPU/NPU)的 AI 视频管理平台架构方案(附源码交付与 Docker 部署)
arm开发·人工智能·音视频
2302_813806225 天前
基础环境篇 – 交叉编译环境搭建与NFS服务配置
arm开发