免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5857 | 回复: 6
打印 上一主题 下一主题

dhcp.lease文件下的UID是做什么用的呀? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-17 16:59 |只看该作者 |倒序浏览
dhcp.lease文件下的UID是做什么用的呀?为什么有的能显示出client-hostname.有的就没有呢!谢谢!

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>\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";

论坛徽章:
0
2 [报告]
发表于 2009-02-18 08:32 |只看该作者
应该是你服务配置的问题,检查你的dhcpd.conf文件中是否有hosts选项?

论坛徽章:
0
3 [报告]
发表于 2009-02-18 09:18 |只看该作者
我不懂楼上说的是什么意思,我把我的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;
        }

论坛徽章:
0
4 [报告]
发表于 2009-02-23 17:18 |只看该作者

回复 #3 zsy0583 的帖子

计算机名称

[ 本帖最后由 rhlei 于 2009-5-19 07:42 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2009-04-23 09:26 |只看该作者
这是英文原文,我也不会翻译。

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.

论坛徽章:
34
亥猪
日期:2015-03-20 13:55:11戌狗
日期:2015-03-20 13:57:01酉鸡
日期:2015-03-20 14:03:56未羊
日期:2015-03-20 14:18:30子鼠
日期:2015-03-20 14:20:14丑牛
日期:2015-03-20 14:20:31辰龙
日期:2015-03-20 14:35:34巳蛇
日期:2015-03-20 14:35:56操作系统版块每日发帖之星
日期:2015-11-06 06:20:00操作系统版块每日发帖之星
日期:2015-11-08 06:20:00操作系统版块每日发帖之星
日期:2015-11-19 06:20:00黄金圣斗士
日期:2015-11-24 10:43:13
6 [报告]
发表于 2009-04-23 11:54 |只看该作者
看着像是代码,\后面跟数字都是特定符号。

论坛徽章:
0
7 [报告]
发表于 2009-05-18 16:06 |只看该作者

回复 #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/netwo ... ifier-matching.html
ASCII码查表:
http://www.cnblogs.com/sekihin/archive/2007/06/11/779047.html

能加分吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP