DHCP服务器:多子网不工作

DHCP服务器:多子网不工作

我想让 DHCP 服务器为不同的 MAC 地址组提供不同的子网地址。

我已成功为 DHCP 客户端提供多子网地址。

我已经使用“class”作为 mac 地址的过滤器,但它不起作用。

下面是我的 dhcpd.conf

class "class1" {
   match if
   (substring(hardware,1,6) = 04:7d:7b:f1:69:b2) or
   (substring(hardware,1,6) = 04:7d:7b:d8:bb:60);
}

subnet 172.16.51.0 netmask 255.255.255.0 {
  pool {
     deny members of "class1";
     deny unknown-clients;
     range 172.16.51.100 172.16.51.200;
  }
  option subnet-mask 255.255.255.0;
  option routers 172.16.51.254;
  option broadcast-address 172.16.51.255;
  option domain-name-servers 8.8.8.8;
}

subnet 172.16.52.0 netmask 255.255.255.0 {
  pool {
    allow members of "class1";
    deny unknown-clients;
    range 172.16.52.100 172.16.52.200;
  }
  option subnet-mask 255.255.255.0;
  option routers 172.16.52.254;
  option broadcast-address 172.16.52.255;
  option domain-name-servers 8.8.8.8;
}


subnet 172.16.50.0 netmask 255.255.255.0 {
  pool {
    range 172.16.50.100 172.16.50.200;
    deny known-clients;
    allow unknown-clients;
  }
  option subnet-mask 255.255.255.0;
  option routers 172.16.50.254;
  option broadcast-address 172.16.50.255;
  option domain-name-servers 8.8.8.8;
  if exists user-class and option user-class = "iPXE" {
    filename "bootstrap.ipxe";
  } else {
    filename "undionly.kpxe";
  }
  next-server   172.16.50.31;
}

现在,我有一台名为“M”的新机器,其 mac 为 54:ab:3a:3d:2c:7a。我不想让它获得172.16.51.0/24和172.16.52.0/24中的ip,而是172.16.50.0/24中的ip。然而,这并没有奏效。

我确信我已经删除了 DHCP 服务器和 DHCP 客户端的记录。

我应该怎么办?

相关内容