Re: dhcpleased with option dhcp-client-identifier

2021-09-20 Thread Stuart Henderson
On 2021-08-27, Olivier Cherrier  wrote:
> Thanks you Florian for the detailed explanation. Appreciated.

quick update for the archives etc, a change to handle this was committed:
https://marc.info/?l=openbsd-cvs=163213837512278=2


-- 
Please keep replies on the mailing list.



Re: dhcpleased with option dhcp-client-identifier

2021-08-27 Thread Olivier Cherrier
On Wed, Aug 18, 2021 at 07:48:10PM +0200, flor...@openbsd.org wrote:
> > 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 you Florian for the detailed explanation. Appreciated.
Best.

-- 
Olivier Cherrier
Phone: +352691570680
mailto:o...@symacx.com



Re: dhcpleased with option dhcp-client-identifier

2021-08-18 Thread Florian Obser
On 2021-08-18 12:48 UTC, Olivier Cherrier  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:    6382 5363 3501 030c 0372  ..c.Sc5r
> <   0120: 6578 370b 011c 0279 030f 7706 0c43 423d  ex7y..w..CB=
> <   0130: 0372 6578 ff00       .rex
> <   0140:          
> ---
>>   0110:    6382 5363 3501 030c 0762  ..c.Sc5b
>>   0120: 726f 7773 6572 3d08 0062 726f 7773 6572  rowser=..browser
>>   0130: 3708 0103 060c 0f1c 7779 3204 c0a8 0162  7...wy2b
>>   0140: ff00         
>
>
> 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.



dhcpleased with option dhcp-client-identifier

2021-08-18 Thread Olivier Cherrier
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:    6382 5363 3501 030c 0372  ..c.Sc5r
<   0120: 6578 370b 011c 0279 030f 7706 0c43 423d  ex7y..w..CB=
<   0130: 0372 6578 ff00       .rex
<   0140:          
---
>   0110:    6382 5363 3501 030c 0762  ..c.Sc5b
>   0120: 726f 7773 6572 3d08 0062 726f 7773 6572  rowser=..browser
>   0130: 3708 0103 060c 0f1c 7779 3204 c0a8 0162  7...wy2b
>   0140: ff00         


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 ?

Thanks for any advice.
Best.

-- 
Olivier Cherrier
Phone: +352691570680
mailto:o...@symacx.com
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" 
PR:SM+BR+TZ+121+DG+DN+119+NS+HN+BF+TFTP CID:114.101.120 [tos 0x10] (ttl 128, id 
38490, len 328)
  : fee1 bad0 b7ec fee1 bbd1 c2c4 0800 4510  ..E.
  0010: 0148 965a  8011 1f03 c0a8 01db c0a8  .H.Z
  0020: 010c 0044 0043 0134 aa3e 0101 0600 fbdf  ...D.C.4.>..
  0030: b850 105c  c0a8 01db     .P.\
  0040:    fee1 bbd1 c2c4    
  0050:          
  0060:          
  0070:          
  0080:          
  0090:          
  00a0:          
  00b0:          
  00c0:          
  00d0:          
  00e0:          
  00f0:          
  0100:          
  0110:    6382 5363 3501 030c 0372  ..c.Sc5r
  0120: 6578 370b 011c 0279 030f 7706 0c43 423d  ex7y..w..CB=
  0130: 0372 6578 ff00       .rex
  0140:          
  0150:      ..

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" CID:0.98.114.111.119.115.101.114 PR:SM+DG+NS+HN+DN+BR+119+121 
RQ:192.168.1.98 [tos 0x10] (ttl 128, id 0, len 328) 
   
  :    fee1 bbd1 b292 0800 4510  ..E.
  0010: 0148   8011 3996     .H..9...
  0020:  0044 0043 0134 9006 0101 0600 0ba9  ...D.C.4
  0030: 62e2         b...
  0040:    fee1 bbd1 b292    
  0050:          
  0060:          
  0070:          
  0080:          
  0090:          
  00a0:          
  00b0:          
  00c0:          
  00d0:          
  00e0:          
  00f0:          
  0100: