On 2021-08-18 12:48 UTC, Olivier Cherrier <o...@symacx.com> wrote:
>       Hi,
>
> I have a DHCP setup using dhcp-client-identifier option.
>
> On the DHCP server side, i use something similar to this:
> ---8<---- /etc/dhcpd.conf
>         host rex {
>               option dhcp-client-identifier "rex";
>               fixed-address 192.168.1.219;
>       }
> --->8----
>
>
> On the clients, I use to configure them like that:
> $ grep -v '^#' /etc/dhclient.conf 
> send dhcp-client-identifier "rex";
> $
>
>
> Using -current and dhcpleased, I tried to configure it this way:
> ---8<---- /etc/dhcpleased.conf
> interface vio0 {
>       send client id browser
> }
> --->8----
>
>
> But the generated packet doesn't seem to be well interpreted by dhcpd.
> Old packet (from dhclient machine called 'rex') is attached
> in packet_dhclient.txt and the new packet (from dhcpleased machine
> called 'browser') is attached in packet_dhcpleased.txt.
>
> The diff show some differences:
>
> 19,22c19,22
> <   0110: 0000 0000 0000 6382 5363 3501 030c 0372  ......c.Sc5....r
> <   0120: 6578 370b 011c 0279 030f 7706 0c43 423d  ex7....y..w..CB=
> <   0130: 0372 6578 ff00 0000 0000 0000 0000 0000  .rex............
> <   0140: 0000 0000 0000 0000 0000 0000 0000 0000  ................
> ---
>>   0110: 0000 0000 0000 6382 5363 3501 030c 0762  ......c.Sc5....b
>>   0120: 726f 7773 6572 3d08 0062 726f 7773 6572  rowser=..browser
>>   0130: 3708 0103 060c 0f1c 7779 3204 c0a8 0162  7.......wy2....b
>>   0140: ff00 0000 0000 0000 0000 0000 0000 0000  ................
>
>
> It seems dhcpleased is automatically adding the hostname of the machine
> in the DHCP message. That's the first instance of "browser" seen above.
>
> dhcpd(8) doesn't seem to catch correctly the client identifier. Is it
> supposed to work like that ?

They both send the hostname, that's not the problem. Opinions differ on how
the client ID should be encoded.

> Aug 13 18:10:11.599556 fe:e1:bb:d1:b2:92 ff:ff:ff:ff:ff:ff 0800 342:
> 0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] xid:0xba962e2
> vend-rfc1048 DHCP:REQUEST HN:"browser"
                            ^^^^ hostname

> CID:0.98.114.111.119.115.101.114 PR:SM+DG+NS+HN+DN+BR+119+121
  ^^^ client id

> RQ:192.168.1.98 [tos 0x10] (ttl 128, id 0, len 328)

> Aug 13 18:12:13.530188 fe:e1:bb:d1:c2:c4 fe:e1:ba:d0:b7:ec 0800 342:
> 192.168.1.219.68 > 192.168.1.12.67: [udp sum ok] xid:0xfbdfb850
> secs:4188 C:192.168.1.219 vend-rfc1048 DHCP:REQUEST HN:"rex"
                                                      ^^^ hostname
> PR:SM+BR+TZ+121+DG+DN+119+NS+HN+BF+TFTP CID:114.101.120 [tos 0x10]
                                          ^^^ client id
> (ttl 128, id 38490, len 328)

dhclient sends this as client id:
CID:114.101.120

Which is hardware type 114 and hardware address 101.120 (in decimal)
Interpreted as ascii this is of course "rex".

RFC 2132 has this:
   The client identifier MAY consist of type-value pairs similar to the
   'htype'/'chaddr' fields defined in [3]. For instance, it MAY consist
   of a hardware type and hardware address. In this case the type field
   SHOULD be one of the ARP hardware types defined in STD2 [22].  A
   hardware type of 0 (zero) should be used when the value field
   contains an identifier other than a hardware address (e.g. a fully
   qualified domain name).

dhcpleased sends this:
CID:0.98.114.111.119.115.101.114

Which is hardware type 0 + "browser"

dhcpleased.conf has this:
     send client id client-id
             Send the dhcp client identifier option with a value of client-id.
             If client-id consists of a series of octets of two-digit
             hexadecimal numbers separated by colons, the first octet is used
             as the type and the rest as value.  The MAC address
             00:53:FF:AA:BB:CC would be configured as

                   send client id "01:00:53:FF:AA:BB:CC"

             Otherwise the string client-id is sent verbatim with type zero.
             The default is to send the interface's MAC address as client
             identifier.

now, what will probably work for you is:

        send client id "00:62:72:6f:77:73:65:72"

So in short, everything is terrible.

Should dhcpleased do what dhclient does?
People who actually use this please speak up.


>
> Thanks for any advice.
> Best.
>
> -- 
> Olivier Cherrier
> Phone: +352691570680
> mailto:o...@symacx.com
>
>
>

-- 
I'm not entirely sure you are real.

Reply via email to