将dhcp客户端标识符存储在服务器中,以便在稍后的租用期间使用

我想将客户端标识符存储在服务器中,以便稍后尝试将IP地址租赁给其他客户端时,服务器可以引用该值。 每个客户端发出一个标识符,如果另一个客户端显示相同的标识符,我分配主机名称基于该标识符。 (只有2个不同的标识符是可能的,所以我只需要存储两个标识符)。

这是我添加到服务器来存储这个。

#space to store the identifiers option space local code width 2 length width 2; option local.identifier1 code 1 = unsigned integer 8; option local.identifier2 code 2 = unsigned integer 8; #Custom option identifier sent by the client option identifier code 189 = unsigned integer 8; option switch code 190 = unsigned integer 8; /// Storing based on what client sent class "acs" { match if option dhcp-client-identifier = "ACS"; if option switch = 1 { option host-name "acs-01"; option local.identifier1 = option identifier; } elsif option switch = 2 { option host-name "acs-02"; option local.identifier2 = option identifier; } else { option host-name "bos-cart-unknown"; } } #Matching if the identifier matches or not. class "sra" { match if option dhcp-client-identifier = "SRA"; # If what was sent matches what currently is if option local.identifier1 = option identifier { option host-name "sra-01"; } elsif option local.identifier2 = option identifier { option host-name "sra-02"; } else { option host-name "bos-sra-unknown"; } } 

但是,这不起作用,第二个客户端总是获取主机名称bos-sra-unknown。

请让我知道如果我在这里做错了什么/有一个不同的方法来解决这个问题。