Dhcp-Server

拒絕未知客戶端 dhcpd.conf

  • October 27, 2017

我無法弄清楚如何設置我的 dhcpd.conf。我對此很陌生。我想允許啟動並且只允許下面列出的客戶端獲取它們的固定地址。

我不知道如何在這個文件中正確放置項目。

我做錯了什麼,我該如何解決?這是我的文件,其中隱藏了明顯的 IP 地址:

allow booting;
option domain-name "my domain";
option domain-name-servers ip1, ip2;
subnet ip.0 netmask 255.255.255.128 {
   option routers ip.1;
   pool {
           range ip.10 ip.14;
           allow members of "clients";
           deny unkown-clients;
   }
}
class "clients" {
   host client1 {
           option host-name "client1.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.10;

   }
   host client2 {
           option host-name "client2.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.11;
   }
   host client3 {
           option host-name "client3.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.12;
   }
   host client4 {
           option host-name "client4.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.13;
   }
   host client5 {
           option host-name "client5.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.14;
   }
}

您的課程中沒有 match 語句,因此實際上並未使用它。您似乎也誤解了課程的用途,這絕對不是需要課程(或池)的情況。以下將做:

allow booting;
option domain-name "my domain";
option domain-name-servers ip1, ip2;
subnet ip.0 netmask 255.255.255.128 {
   option routers ip.1;
   deny unkown-clients;
   host client1 {
           option host-name "client1.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.10;

   }
   host client2 {
           option host-name "client2.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.11;
   }
   host client3 {
           option host-name "client3.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.12;
   }
   host client4 {
           option host-name "client4.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.13;
   }
   host client5 {
           option host-name "client5.nlothame.nbr.cs.uiowa.edu";
           fixed-address ip.14;
   }
}

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