DHCP 配置文件错误: no option named architecture-type in space dhcp

最近在研究PXE+Kickstart安装系统,在配置DHCP是出现了错误:

/etc/dhcp/dhcpd.conf line 11: no option named architecture-type in space dhcp
      if option architecture-type =
                 ^
/etc/dhcp/dhcpd.conf line 13: expecting a parameter or declaration
      } else 
       ^
Configuration file errors encountered -- exiting

我的/etc/dhcp/dhcpd.conf配置文件如下:

subnet 192.168.56.0 netmask 255.255.255.0 {
  range 192.168.56.101 192.168.56.200;
      next-server 192.168.56.101;
      if option architecture-type = 00:07 {
        filename "uefi/shim.efi";
      } else {
        filename "pxelinux/pxelinux.0";
      }
}

网上怎么搜索也搜索不到是什么原因导致的,没有人遇到和我一样的情况.最后才发现我是我的配置文件少了几行:

option space pxelinux;
option pxelinux.magic code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
option architecture-type code 93 = unsigned integer 16;

这么一个问题折腾了我一晚上,感觉智商跟不上了.
完整的配置文件应该是这样子的:

# /etc/dhcp/dhcpd.conf
option space pxelinux;
option pxelinux.magic code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
option architecture-type code 93 = unsigned integer 16;
subnet 192.168.56.0 netmask 255.255.255.0 {
  range 192.168.56.101 192.168.56.200;
      next-server 192.168.56.101;
      if option architecture-type = 00:07 {
        filename "uefi/shim.efi";
      } else {
        filename "pxelinux/pxelinux.0";
      }
}

然后重启dhcpd服务:

systemctl restart dhcpd.service

你可能感兴趣的:(工作日志,dhcp)