在做拓展练习的时候,自动安装linux操作系统(kickstart),通过yum安装dhcpd服务,然后发现遇到这个问题:
No subnet declaration for eno16777736 (192.168.75.132).
3325]: ** Ignoring requests on eno16777736. If this is not what
3325]: you want, please write a subnet declaration
3325]: in your dhcpd.conf file for the network segment
3325]: to which interface eno16777736 is attached. **
然后如下是我的配置:
subnet 192.168.75.0 netmask 255.255.255.0 {
allow booting;
allow bootp;
allow unknown-clients;
option routers 192.168.75.2;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.75.2;
option time-offset -18000; # Eastern Standard Time
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.75.134 192.168.75.254;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.75.132;
filename "pxelinux.0";
看上去完全没问题是不是。当时看错误日志,上网查资料不知道是什么问题。
其实有一个细节是比较容易忽略的,那就是配置文件的位置(centOS7的启动脚本都放到了/usr/lib/systemd/system/目录下了)
因为我们是按照铭哥的步骤一步步来尝试完成这个实验,而我们往往没有留意一些参数是否正确,所以造成了问题。
这个问题是由于铭哥当时编写那篇文章的时候可能是dhcpd的版本较低,配置文件定义为了/etc/dhcpd.conf,而本人做实验的时候出现了问题,我们可以看到在启动脚本上已经明确定义了配置文件dhcpd.conf的位置了
因此问题解决
附注:其实2015/04/05 PXE网络装机这篇文章里面就已经把配置文件路径纠正了
编辑回复