PXE 启动失败并显示“无法找到启动服务器”。

PXE 启动失败并显示“无法找到启动服务器”。

我启用 PXE 的目标计算机从 dnsmasq 接收租约并打印一条消息

UD: 192.168.10.123

这是我的 dnsmasq/tftp 服务器的地址,但随后因“无法找到启动服务器”而无法再进行任何操作。

这是我的 dnsmasq 文件。

port=0
domain-needed
bogus-priv
interface=eth1
listen-address=192.168.10.123
bind-interfaces
domain=chacha.mo
dhcp-range=eth1,192.168.10.200,192.168.10.207,255.255.255.0,8h
dhcp-option=3,192.168.10.1
dhcp-option=6,192.168.10.2
dhcp-option=42,192.168.10.1
enable-tftp
tftp-root=/var/lib/tftpboot
dhcp-boot=pxelinux.0
pxe-prompt="Press F8 for PXE Network boot.", 20
pxe-service=x86PC, "Install CentOS via PXE", pxelinux

我在另一台服务器 @192.168.10.3 上设置了 CentOS 7.6.1810 安装树。我已经使用 virt-install 成功使用了这个 http install dist。

这是我的 /var/lib/tftpboot/pxelinux.cfg/default 文件。

default menu.c32
prompt 0
timeout 300
ONTIMEOUT local

menu title ########## PXE Boot Menu ##########
label 1
menu label ^1) Install CentOS 7.6 x64 with Local Repo using Kickstart
kernel vmlinuz
append initrd=initrd.img inst.repo=http://192.168.10.3/pub/centos/7.6.1810/os/x86_64/  inst.ks=http://192.168.10.3/pub/kicker.ks inst.ks.sendmac

在前台启动 dnsmasq。没看到错误。

Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 available DHCP range: 192.168.10.200 -- 192.168.10.207
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 vendor class: PXEClient:Arch:00000:UNDI:002001
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 DHCPREQUEST(eth1) 192.168.10.202 00:1b:21:6c:00:93
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 tags: eth1
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 DHCPACK(eth1) 192.168.10.202 00:1b:21:6c:00:93
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 1:netmask, 2:time-offset, 3:router, 4, 5,
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 6:dns-server, 11, 12:hostname, 13:boot-file-size,
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 15:domain-name, 16:swap-server, 17:root-path,
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 18:extension-path, 22:max-datagram-reassembly,
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 23:default-ttl, 28:broadcast, 40:nis-domain,
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 41:nis-server, 42:ntp-server, 43:vendor-encap,
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 50:requested-address, 51:lease-time, 54:server-identifier,
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 58:T1, 59:T2, 60:vendor-class, 66:tftp-server,
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 67:bootfile-name, 128, 129, 130, 131, 132,
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 requested options: 133, 134, 135
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 next server: 192.168.10.123
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 broadcast response
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  1 option: 53 message-type  5
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  4 option: 54 server-identifier  192.168.10.123
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  4 option: 51 lease-time  8h
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size: 11 option: 67 bootfile-name  pxelinux.0
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  4 option: 58 T1  4h
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  4 option: 59 T2  7h
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  4 option: 28 broadcast  192.168.10.255
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  7 option: 15 domain-name  chacha.mo
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size: 24 option:210   66:74:70:3a:2f:2f:31:39:32:2e:31:36:38:2e...
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size: 26 option:209   2f:76:61:72:2f:6c:69:62:2f:74:66:74:70:62...
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  4 option: 42 ntp-server  192.168.10.1
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  4 option:  6 dns-server  192.168.10.2
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  4 option:  3 router  192.168.10.1
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  4 option:  1 netmask  255.255.255.0
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size:  9 option: 60 vendor-class  50:58:45:43:6c:69:65:6e:74
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size: 17 option: 97 client-machine-id  00:00:00:00:00:00:00:00:00:00:00:00:1f:d0...
Jun  9 20:07:01 dnsmasq-dhcp[21523]: 577503379 sent size: 79 option: 43 vendor-encap  06:01:03:08:07:80:00:01:c0:a8:0a:7b:09:19...

答案1

在 DHCP 协议中,有两种方法指定 PXE 启动文件名和从中加载它的 TFTP 服务器地址:

  • 使用旧版 BOOTP 字段(因为 DHCP 是 BOOTP 的扩展)
  • 或使用较新的 DHCP 选项来达到相同目的。

显然dnsmasq默认情况下使用后一种方法...并且我遇到过一个相当现代的 PXE 固件,该固件在处理较新样式的选项时略有错误。

(如果我没记错的话,它是 2011 年左右生产的主板集成英特尔网卡。我认为它在不属于的地方添加了额外的 0x00 字节。如果是相同的错误,您可能会看到 PXE 固件试图解决“ 192.168.10.123\0”作为 DNS 名称,而不是直接正确使用 IP 地址。)

尝试将此行添加到您的dnsmasq配置中:

dhcp-no-override

它告诉dnsmasq我们使用旧的方法,这是根据dnsmasq手册页的“简单而安全”的方法。

答案2

我在 pxe-boot 服务器的 centos8 版本上遇到了同样的问题...我的问题是 UDP 端口未打开

[root@kickstart /]#firewall-cmd --add-port={4011/udp,69/udp} --永久成功 [root@kickstart /]#firewall-cmd --reload 成功

是我的解决办法。

相关内容