Redhat

isc dhcp 子網內的類聲明

  • December 15, 2015

我想使用基於子網範圍的類聲明,是否允許?還是所有類都是全域範圍?

這是我的 dhcp.conf 片段:

subnet 10.200.147.0 netmask 255.255.255.224 {
authoritative;
option domain-name-servers     10.200.17.28;
option routers                 10.200.147.1;
option subnet-mask             255.255.255.224;

class "Cisco AP c1240 22nd fl" {
   match if option vendor-class-identifier = "Cisco AP c1240";
   option option-043              f1:0c:0a:c8:d3:46:0a:c3:d3:45:0a:c3:d3:47;
   option vendor-class-identifier "Cisco AP c1240";
   vendor-option-space            Cisco_LWAPP_AP;

}

group {
   option domain-name             "cde.net";

   host ap1.aaa{
       fixed-address                  10.200.147.4;
       hardware ethernet              00:aa:bb:cc:dd:ee;
       option host-name               "ap1.aaa.cde.net";

   }

而這個,也在同一個文件中:

subnet 10.201.147.0 netmask 255.255.255.224 {
authoritative;
option domain-name-servers     10.201.17.28;
option routers                 10.201.147.1;
option subnet-mask             255.255.255.224;

class "Cisco AP c1240 1gp" {
   match if option vendor-class-identifier = "Cisco AP c1240";
   option option-043              f1:08:0a:c2:d2:04:0a:d0:d1:04;
   option vendor-class-identifier "Cisco AP c1240";
   vendor-option-space            Cisco_LWAPP_AP;

}

group {
   option domain-name             "cde.net";

   host ap1.bbb {
       fixed-address                  10.201.147.4;
       hardware ethernet              00:11:22:33:44:55;
       option host-name               "ap1.bbb.cde.net";

   }

我在我的日誌文件中看到了這一點,這讓我認為所有的類聲明都是全域的:

Dec  7 06:22:20 s_local@master.aaa.cde.com dhcpd: too many classes match 00:aa:bb:cc:dd:ee 

我在 isc dhcp 文件中沒有看到任何可以證實我的理論的東西。

所有類都是全域的(當您使用dhcpd -t -cf dhcpd.conf.

我不知道這是否重要,您option vendor-class-identifier在課堂上也有兩次聲明。

引用自:https://serverfault.com/questions/741387