ISC DHCP Server 同时支持UEFI和BIOS网络引导iPXE的示例
/etc/dhcp/dhcpd.conf
代码: 全选
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.199;
option domain-name-servers 192.168.1.1,114.114.114.114;
option domain-name "internal.example.org";
option subnet-mask 255.255.255.0;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
ping-check true;
class "pxeclient" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if substring (option vendor-class-identifier, 15, 5) = "00000" {
# BIOS client
if exists user-class and option user-class = "iPXE" {
filename "boot.ipxe";
} else {
filename "undionly.kpxe";
}
}
elsif substring (option vendor-class-identifier, 15, 5) = "00006" {
# EFI client 32 bit
if exists user-class and option user-class = "iPXE" {
filename "boot.ipxe";
} else {
filename "snponly.efi";
}
}
else {
# default to EFI 64 bit
if exists user-class and option user-class = "iPXE" {
filename "boot.ipxe";
} else {
filename "snponly.efi";
}
}
}
}
snponly.efi 是 UEFI 模式下 PXE 的引导文件,请从 http://boot.ipxe.org/ 获取
undionly.kpxe 是 BIOS 模式下 PXE 的引导文件,请从 http://boot.ipxe.org/ 获取
boot.ipxe 是你的 iPXE 启动配置脚本,实质是个txt文件,不过要符合 iPXE 的规则。
在 UEFI 模式时请关闭 secure boot ,这个是因为 snponly.efi 还没有数字签名。也可以考虑用签名过的带PXE网络的GRUB2来代替。