大网数据广告活动
服务器运维问答

How can I check my PXE-server configuration

· 52CE 我爱测

Is it possible to check the things the dhcp-server delivers? When I configure my dhcp-server I tell it what file to boot from, ex: pxelinux.0 , and where it should find it, ex: 192.168.0.112 . Could I verify that this is whats de…

问题原文

原帖链接 · UlfR · CC BY-SA 4.0

Is it possible to check the things the dhcp-server delivers?

When I configure my dhcp-server I tell it what file to boot from, ex: pxelinux.0, and where it should find it, ex: 192.168.0.112.

Could I verify that this is whats delivered from the dhcp-server somehow without having to actually netboot a machine? I think I'm searching for a some commandline trick here, something like:

I have read this https://serverfault.com/a/875791/243665 but it does not tell me everything. The bootfile name is shown, but the location of the pxeserver (192.168.0.112) is missing. Ex:

$ sudo nmap --script broadcast-dhcp-discover

Starting Nmap 7.60 ( https://nmap.org ) at 2019-12-02 08:49 CET
Pre-scan script results:
| broadcast-dhcp-discover: 
|   Response 1 of 1: 
|     IP Offered: 192.168.0.36
|     DHCP Message Type: DHCPOFFER
|     Server Identifier: 192.168.0.1
|     IP Address Lease Time: 5m00s
|     Subnet Mask: 255.255.255.0
|     Router: 192.168.0.1
|     Domain Name Server: 192.168.100.10, 192.168.100.11
|     Domain Name: ulfexample.com
|     Renewal Time Value: 2m30s
|     Rebinding Time Value: 4m22s
|_    Bootfile Name: /pxelinux.0

已采纳解答

原帖链接 · Pat · CC BY-SA 4.0

$ sudo nmap --script broadcast-dhcp-discover

uses the script broadcast-dhcp-discover found here:

https://svn.nmap.org/nmap/scripts/broadcast-dhcp-discover.nse

you should replace:

result_table["IP Offered"] = r.yiaddr_str

with:

result_table["IP Offered"] = r.yiaddr_str
result_table["IP TFTP Server"] = r.siaddr_str

Alternatively you could also use

$ sudo nmap --script dhcp-discover  

the script is:

https://svn.nmap.org/nmap-exp/patrik/nmap-brute/scripts/dhcp-discover.nse

you should replace:

table.insert(response, string.format("IP Offered: %s", result.yiaddr_str))

with:

table.insert(response, string.format("IP Offered: %s", result.yiaddr_str))
table.insert(response, string.format("IP TFTP Server: %s", result.siaddr_str))

in both cases you should be able to get the PXE info if the NBP is stored in the file field of the DHCP offer and the TFTP server IP is stored in the siaddr field of the DHCP offer

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-11-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。