歡迎您光臨本站 註冊首頁

dhcp.lease文件下的UID是做什麼用的呀?

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

dhcp.lease文件下的UID是做什麼用的呀?

dhcp.lease文件下的UID是做什麼用的呀?為什麼有的能顯示出client-hostname.有的就沒有呢!謝謝!:em14:

lease 192.168.1.101 {
  starts 2 2009/02/17 00:51:08;
  ends 2 2009/02/17 05:00:52;
  tstp 2 2009/02/17 05:00:52;
  binding state free;
  hardware ethernet 00:1c:bf:3e:**;
  uid "\001\000\034\277>P\204";
}
lease 192.168.1.198 {
  starts 2 2009/02/17 00:24:27;
  ends 2 2009/02/17 12:24:27;
  binding state active;
  next binding state free;
  hardware ethernet 00:16:6f:0c:**;
  uid "\001\000\026o\014\257\366";
  client-hostname "sherry";
《解決方案》

應該是你服務配置的問題,檢查你的dhcpd.conf文件中是否有hosts選項?
《解決方案》

我不懂樓上說的是什麼意思,我把我的dhcpd.conf文件全貼上來,麻煩幫看看。
subnet 192.168.1.0 netmask 255.255.255.0 {

# --- default gateway
        option routers                  192.168.1.1;
        option subnet-mask              255.255.255.0;

        option domain-name-servers      192.168.1.250;

        option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              192.168.1.1;
#       option netbios-name-servers     192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
#       option netbios-node-type 2;

        range dynamic-bootp 192.168.1.15 192.168.1.220;
        default-lease-time 43200;
        max-lease-time 43200;

        # we want the nameserver to appear at a fixed address
        host ns {
                next-server marvin.redhat.com;
                hardware ethernet 12:34:56:78:AB:CD;
                fixed-address 207.175.42.254;
        }
《解決方案》

回復 #3 zsy0583 的帖子

計算機名稱

[ 本帖最後由 rhlei 於 2009-5-19 07:42 編輯 ]
《解決方案》

這是英文原文,我也不會翻譯。

uid client-identifier;

                                                                2

dhcpd.leases(5)                                   dhcpd.leases(5)

       The uid statement records the client  identifier  used  by
       the  client  to  acquire  the  lease.    Clients  are  not
       required to send client identifiers,  and  this  statement
       only  appears if the client did in fact send one.   Client
       identifiers are normally an ARP type (1 for ethernet) fol-
       lowed by the MAC address, just like in the hardware state-
       ment, but this is not required.

       The client identifier is  recorded  as  a  colon-separated
       hexadecimal  list  or  as  a  quoted  string.    If  it is
       recorded as a quoted string and it contains  one  or  more
       non-printable characters, those characters are represented
       as octal escapes - a backslash character followed by three
       octal digits.
《解決方案》

看著像是代碼,\後面跟數字都是特定符號。
《解決方案》

回復 #1 zsy0583 的帖子

hardware ethernet 00:16:6f:0c:**;
  uid "\001\000\026o\014\257\366";

UID如何取值是DHCP協議沒說清楚。不同實現之間的理解有偏差。是string還是data string....不過只是影響顯示。不妨礙將uid作為關鍵字。

0x01可能表示網路類型(如乙太網)。
後面為網卡的MAC地址。

000\026o\014\257\366"; 是8進位的顯示每個字元3位(8*8*8> 256)
如果是可列印字元就直接列印。\000= 0, \026 = 0x16, 'o '=0x6F

很cool的討論:
http://forums.opensuse.org/network-internet/399162-dhcp-client-identifier-matching.html
ASCII碼查表:
http://www.cnblogs.com/sekihin/archive/2007/06/11/779047.html

:oops: 能加分嗎?

[火星人 ] dhcp.lease文件下的UID是做什麼用的呀?已經有1344次圍觀

http://coctec.com/docs/service/show-post-22624.html