PXE 启动期间未找到 DHCP 服务器

PXE 启动期间未找到 DHCP 服务器

我正在尝试运行 PXE 服务器并遇到“PXE-E51:未收到 DHCP 或 proxyDHCP 提供”错误,这通常意味着

PXE 客户端未收到对其 DHCPDISCOVER 消息的回复。此问题的可能原因如下:

  1. 没有 DHCP 或 BOOT 服务器
  2. DHCP 或 BOOTP 服务器未运行
  3. DHCP 或 BOOTP 服务器未配置为服务于您的 PXE 客户端
  4. DHCP 或 BOOTP 服务器位于不同的子网,并且没有有效的 DHCP 或 BOOTP 转发机制

我的设置和配置与ServerFault 上也有类似的问题;不同之处在于,与问题的作者不同,我DHCPDISCOVER在 DHCP 服务器的日志中完全看不到任何内容,也dhcpdump -i eth0没有显示任何内容。

当我尝试使用另一台机器启动时,我在日志中看到DHCPDISCOVER和条目,并且机器开始查询 TFTP。当我通过 PXE 启动虚拟机时也会发生同样的事情。DHCPOFFER

我认为这意味着交换机没有阻止 DHCP 流量(而且 DHCP 监听被禁用)。这也意味着防火墙配置正确(为确保万无一失,我禁用了主机和 DHCP 服务器上的防火墙)。

如果我断开真实机器与交换机的连接,PXE 启动会明确指示连接有问题,所以这不应该是以太网电缆的问题。

这样就排除了前三个可能的原因。至于第四个,我不确定我应该检查什么。交换机、路由器、主机和 DHCP 服务器的广播和网络掩码值相同。

这看起来很像STP 问题,但交换机上已禁用 STP。

我还需要检查什么?


配置端口镜像以将 Tx/Rx 镜像到开发机器使用的端口后,dhcpdump显示以下内容:

  TIME: 2016-06-08 22:34:12.722
    IP: 0.0.0.0 (0:0:0:0:0:0) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 01000000
  SECS: 4
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 ( 24) Parameter Request List      1 (Subnet mask)
                          2 (Time offset)
                          3 (Routers)
                          5 (Name server)
                          6 (DNS server)
                         11 (Resource location server)
                         12 (Host name)
                         13 (Boot file size)
                         15 (Domainname)
                         16 (Swap server)
                         17 (Root path)
                         18 (Extensions path)
                         43 (Vendor specific info)
                         54 (Server identifier)
                         60 (Vendor class identifier)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        
OPTION:  57 (  2) Maximum DHCP message size 1260
OPTION:  97 ( 17) UUID/GUID                 0000020003000400 ........
                        0500060007000800 ........
                        09               .
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:34:14.724
    IP: 0.0.0.0 (0:0:0:0:0:0) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 02000000
  SECS: 6
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 ( 24) Parameter Request List      1 (Subnet mask)
                          2 (Time offset)
                          3 (Routers)
                          5 (Name server)
                          6 (DNS server)
                         11 (Resource location server)
                         12 (Host name)
                         13 (Boot file size)
                         15 (Domainname)
                         16 (Swap server)
                         17 (Root path)
                         18 (Extensions path)
                         43 (Vendor specific info)
                         54 (Server identifier)
                         60 (Vendor class identifier)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        
OPTION:  57 (  2) Maximum DHCP message size 1260
OPTION:  97 ( 17) UUID/GUID                 0000020003000400 ........
                        0500060007000800 ........
                        09               .
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:34:18.729
    IP: 0.0.0.0 (0:0:0:0:0:0) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 03000000
  SECS: 10
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 ( 24) Parameter Request List      1 (Subnet mask)
                          2 (Time offset)
                          3 (Routers)
                          5 (Name server)
                          6 (DNS server)
                         11 (Resource location server)
                         12 (Host name)
                         13 (Boot file size)
                         15 (Domainname)
                         16 (Swap server)
                         17 (Root path)
                         18 (Extensions path)
                         43 (Vendor specific info)
                         54 (Server identifier)
                         60 (Vendor class identifier)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        
OPTION:  57 (  2) Maximum DHCP message size 1260
OPTION:  97 ( 17) UUID/GUID                 0000020003000400 ........
                        0500060007000800 ........
                        09               .
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:34:26.739
    IP: 0.0.0.0 (0:0:0:0:0:0) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 04000000
  SECS: 18
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 ( 24) Parameter Request List      1 (Subnet mask)
                          2 (Time offset)
                          3 (Routers)
                          5 (Name server)
                          6 (DNS server)
                         11 (Resource location server)
                         12 (Host name)
                         13 (Boot file size)
                         15 (Domainname)
                         16 (Swap server)
                         17 (Root path)
                         18 (Extensions path)
                         43 (Vendor specific info)
                         54 (Server identifier)
                         60 (Vendor class identifier)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        
OPTION:  57 (  2) Maximum DHCP message size 1260
OPTION:  97 ( 17) UUID/GUID                 0000020003000400 ........
                        0500060007000800 ........
                        09               .
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:34:42.759
    IP: 0.0.0.0 (0:0:0:0:0:0) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 05000000
  SECS: 34
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 ( 24) Parameter Request List      1 (Subnet mask)
                          2 (Time offset)
                          3 (Routers)
                          5 (Name server)
                          6 (DNS server)
                         11 (Resource location server)
                         12 (Host name)
                         13 (Boot file size)
                         15 (Domainname)
                         16 (Swap server)
                         17 (Root path)
                         18 (Extensions path)
                         43 (Vendor specific info)
                         54 (Server identifier)
                         60 (Vendor class identifier)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        
OPTION:  57 (  2) Maximum DHCP message size 1260
OPTION:  97 ( 17) UUID/GUID                 0000020003000400 ........
                        0500060007000800 ........
                        09               .
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:35:14.817
    IP: 0.0.0.0 (0:0:0:0:0:0) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 06000000
  SECS: 66
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 ( 24) Parameter Request List      1 (Subnet mask)
                          2 (Time offset)
                          3 (Routers)
                          5 (Name server)
                          6 (DNS server)
                         11 (Resource location server)
                         12 (Host name)
                         13 (Boot file size)
                         15 (Domainname)
                         16 (Swap server)
                         17 (Root path)
                         18 (Extensions path)
                         43 (Vendor specific info)
                         54 (Server identifier)
                         60 (Vendor class identifier)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        
OPTION:  57 (  2) Maximum DHCP message size 1260
OPTION:  97 ( 17) UUID/GUID                 0000020003000400 ........
                        0500060007000800 ........
                        09               .
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:36:18.800
    IP: 0.0.0.0 (0:0:0:0:0:0) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 07000000
  SECS: 130
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 ( 24) Parameter Request List      1 (Subnet mask)
                          2 (Time offset)
                          3 (Routers)
                          5 (Name server)
                          6 (DNS server)
                         11 (Resource location server)
                         12 (Host name)
                         13 (Boot file size)
                         15 (Domainname)
                         16 (Swap server)
                         17 (Root path)
                         18 (Extensions path)
                         43 (Vendor specific info)
                         54 (Server identifier)
                         60 (Vendor class identifier)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        
OPTION:  57 (  2) Maximum DHCP message size 1260
OPTION:  97 ( 17) UUID/GUID                 0000020003000400 ........
                        0500060007000800 ........
                        09               .
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
---------------------------------------------------------------------------

相比之下,这是虚拟机从 PXE 成功启动时的转储:

  TIME: 2016-06-08 22:43:33.301
    IP: 0.0.0.0 (52:54:0:7c:82:35) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: e5cf9a4f
  SECS: 4
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 52:54:00:7c:82:35:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  57 (  2) Maximum DHCP message size 1472
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
OPTION:  77 (  4) User-class Identification 69505845         iPXE
OPTION:  55 ( 21) Parameter Request List      1 (Subnet mask)
                          3 (Routers)
                          6 (DNS server)
                          7 (Log server)
                         12 (Host name)
                         15 (Domainname)
                         17 (Root path)
                         43 (Vendor specific info)
                         60 (Vendor class identifier)
                         66 (TFTP server name)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        175 (???)
                        203 (???)
                        
OPTION: 175 ( 48) ???                       b1050110ec813918 ......9.
                        0101220101190101 ..".....
                        210101100102eb03 !.......
                        0100001301011401 ........
                        0111010117010115 ........
                        0101270101120101 ..'.....                 
OPTION:  61 (  7) Client-identifier         01:52:54:00:7c:82:35
OPTION:  97 ( 17) UUID/GUID                 00b818a0926b2af5 .....k*.
                        e854b1abacc0fd2d .T.....-
                        ba               .
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:43:34.302
    IP: 0.0.0.0 (52:54:0:7c:82:35) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: e5cf9a4f
  SECS: 8
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 52:54:00:7c:82:35:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  57 (  2) Maximum DHCP message size 1472
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
OPTION:  77 (  4) User-class Identification 69505845         iPXE
OPTION:  55 ( 21) Parameter Request List      1 (Subnet mask)
                          3 (Routers)
                          6 (DNS server)
                          7 (Log server)
                         12 (Host name)
                         15 (Domainname)
                         17 (Root path)
                         43 (Vendor specific info)
                         60 (Vendor class identifier)
                         66 (TFTP server name)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        175 (???)
                        203 (???)
                        
OPTION: 175 ( 48) ???                       b1050110ec813918 ......9.
                        0101220101190101 ..".....
                        210101100102eb03 !.......
                        0100001301011401 ........
                        0111010117010115 ........
                        0101270101120101 ..'.....                 
OPTION:  61 (  7) Client-identifier         01:52:54:00:7c:82:35
OPTION:  97 ( 17) UUID/GUID                 00b818a0926b2af5 .....k*.
                        e854b1abacc0fd2d .T.....-
                        ba               .
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:43:34.302
    IP: 192.168.1.40 (52:54:0:ed:3d:b7) > 192.168.1.249 (52:54:0:7c:82:35)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: e5cf9a4f
  SECS: 4
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 192.168.1.249
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 52:54:00:7c:82:35:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: pxelinux.0.
OPTION:  53 (  1) DHCP message type         2 (DHCPOFFER)
OPTION:  54 (  4) Server identifier         192.168.1.40
OPTION:  51 (  4) IP address leasetime      43200 (12h)
OPTION:   1 (  4) Subnet mask               255.255.254.0
OPTION:   3 (  4) Routers                   192.168.1.1
OPTION:   6 (  8) DNS server                192.168.1.3,192.168.1.4
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:43:36.405
    IP: 0.0.0.0 (52:54:0:7c:82:35) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: e5cf9a4f
  SECS: 14
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 52:54:00:7c:82:35:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         3 (DHCPREQUEST)
OPTION:  57 (  2) Maximum DHCP message size 1472
OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
OPTION:  77 (  4) User-class Identification 69505845         iPXE
OPTION:  55 ( 21) Parameter Request List      1 (Subnet mask)
                          3 (Routers)
                          6 (DNS server)
                          7 (Log server)
                         12 (Host name)
                         15 (Domainname)
                         17 (Root path)
                         43 (Vendor specific info)
                         60 (Vendor class identifier)
                         66 (TFTP server name)
                         67 (Bootfile name)
                        128 (???)
                        129 (???)
                        130 (???)
                        131 (???)
                        132 (???)
                        133 (???)
                        134 (???)
                        135 (???)
                        175 (???)
                        203 (???)
                        
OPTION: 175 ( 48) ???                       b1050110ec813918 ......9.
                        0101220101190101 ..".....
                        210101100102eb03 !.......
                        0100001301011401 ........
                        0111010117010115 ........
                        0101270101120101 ..'.....                 
OPTION:  61 (  7) Client-identifier         01:52:54:00:7c:82:35
OPTION:  97 ( 17) UUID/GUID                 00b818a0926b2af5 .....k*.
                        e854b1abacc0fd2d .T.....-
                        ba               .
OPTION:  54 (  4) Server identifier         192.168.1.40
OPTION:  50 (  4) Request IP address        192.168.1.249
---------------------------------------------------------------------------

  TIME: 2016-06-08 22:43:36.405
    IP: 192.168.1.40 (52:54:0:ed:3d:b7) > 192.168.1.249 (52:54:0:7c:82:35)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: e5cf9a4f
  SECS: 14
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 192.168.1.249
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 52:54:00:7c:82:35:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: pxelinux.0.
OPTION:  53 (  1) DHCP message type         5 (DHCPACK)
OPTION:  54 (  4) Server identifier         192.168.1.40
OPTION:  51 (  4) IP address leasetime      43200 (12h)
OPTION:   1 (  4) Subnet mask               255.255.254.0
OPTION:   3 (  4) Routers                   192.168.1.1
OPTION:   6 (  8) DNS server                192.168.1.3,192.168.1.4
---------------------------------------------------------------------------

答案1

相关行dhcpdump是:

CHADDR: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

看来主板有故障,导致 PXE 启动时缺少 MAC 地址。反过来,这意味着DHCPDISCOVER来自客户端计算机的所有请求都是在没有有效 的情况下发送的CHADDR,因此从未到达 DHCP 服务器,原因我实际上并不明白(如果它们到达 DHCP 服务器,我会理解,但服务器会决定不回复)。

强制写入 MAC 地址解决了这个问题。

相关内容