Ubuntu DHCP 伺服器上的 DHCP 池無法正常運作

Ubuntu DHCP 伺服器上的 DHCP 池無法正常運作

以“55:a3”和“56:2a”結尾的 Mac 位址也出現在最後一個池中

123    match if binary-to-ascii(16,8,":",substring(hardware, 5, 6)) = "55:a3";                                                                                                                                                                
124 }                                                                                                                                                                                                                                         
125                                                                                                                                                                                                                                           
126 class "esx67" {                                                                                                                                                                                                                           
127    match if binary-to-ascii(16,8,":",substring(hardware, 5, 6)) = "56:2a";                                                                                                                                                                
128 }                                                                                                                                                                                                                                         
129                                                                                                                                                                                                                                           
130 shared-network 20-30 {                                                                                                                                                                                                                    
131    subnet 20.30.0.0 netmask 255.255.0.0 {                                                                                                                                                                                                 
132       option domain-name "nsbucqesystem.test";                                                                                                                                                                                            
133       option domain-name-servers 20.30.0.1;                                                                                                                                                                                               
134       option routers 20.30.0.1;                                                                                                                                                                                                           
135       default-lease-time 2592000;                                                                                                                                                                                                         
136       max-lease-time 2592000;                                                                                                                                                                                                             
137       ping-check true;                                                                                                                                                                                                                    
138    }                                                                                                                                                                                                                                      
139    pool {                                                                                                                                                                                                                                 
140       allow members of "esx65";                                                                                                                                                                                                           
141       range 20.30.1.1 20.30.1.254;                                                                                                                                                                                                        
142    }                                                                                                                                                                                                                                      
143    pool {                                                                                                                                                                                                                                 
144       allow members of "esx67";                                                                                                                                                                                                           
145       range 20.30.2.1 20.30.2.254;                                                                                                                                                                                                        
146    }                                                                                                                                                                                                                                      
147    pool {                                                                                                                                                                                                                                 
148       deny members of "esx67";                                                                                                                                                                                                            
149       deny members of "esx65";                                                                                                                                                                                                            
150       range 20.30.3.1 20.30.254.254;                                                                                                                                                                                                      
151    }                                                                                                                                                                                                                                      
152 }   

誰能指出該配置中的錯誤

答案1

問題出在hardware過濾器的使用。

該文檔指出:

硬體運算子傳回一個資料字串其第一個元素是正在考慮的資料包中指示的網路介面類型,其後續元素是客戶端的連結層位址。如果沒有資料包,或 RFC2131 hlen 欄位無效,則結果為 null。硬體類型包括乙太網路 (1)、令牌環 (6) 和 fddi (8)。硬體類型由 IETF 指定,有關如何定義類型編號的詳細資訊可以在 RFC2131 中找到(在 ISC DHCP 發行版中,這包含在 doc/ 子目錄中)。

換句話說,hardware, 5, 6不會像您所期望的那樣返回MAC 位址的第5 個和第6 個八位元組,而是返回第4 個和第5 個八位元組,因為第一個元素將是類型(0x01,因為它是乙太網路)。

相關內容