help with custom option request in dhclient

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

help with custom option request in dhclient

Tom Pusateri
I have defined an encapsulated option and am requesting it in dhclient. However, I’m not seeing the request in a tcpdump trace of the request. I included other dhcp options in the request and they are present but not my custom one. Any ideas to what I’m doing wrong? hex 0017 and 0027 are the dhcp6.fqdn and dhcp6.name-servers options you can see in the tcpdump below but the length is 0004 so it’s not trying to add more options I don’t think.

dhclient.conf
————————————
option space foo;
option foo.first code 226 = ip6-address;
option foo.second code 227 = unsigned integer 16;
option foo.third code 228 = domain-list;
option foo.fourth code 229 = text;
option foo-encapsulation code 225 = encapsulate foo;

request dhcp6.fqdn, dhcp6.name-servers, foo.first, foo.second, foo.third;
——————————————————

I’ve also tried:
request dhcp6.fqdn, dhcp6.name-servers, foo-encapsulation with the same result.


# /usr/local/sbin/dhclient --version
isc-dhclient-4.4.1
# /usr/local/sbin/dhclient -v -d -1 -S -p 1067 -cf ./dhclient.conf -lf ./dhclient.leases -pf ./dhclient.pid en0

% tcpdump -i en0 -vvvv udp -s 1500 port 1067
tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 1500 bytes


15:50:42.915158 IP6 (flowlabel 0x92cce, hlim 1, next-header UDP (17) payload length: 40) butte-480.local.instl_boots > ff02::1:2.dhcpv6-server: [udp sum ok] dhcp6 inf-req (xid=7b23c6 (client-ID hwaddr type 1 784f434f30b5) (option-request DNS-server Client-FQDN) (elapsed-time 625))
        0x0000:  6009 2cce 0028 1101 fe80 0000 0000 0000
        0x0010:  1471 b2e9 a8fa 9e1b ff02 0000 0000 0000
        0x0020:  0000 0000 0001 0002 042b 0223 0028 cef1
        0x0030:  0b7b 23c6 0001 000a 0003 0001 784f 434f
        0x0040:  30b5 0006 0004 0017 0027 0008 0002 0271

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: help with custom option request in dhclient

Tom Pusateri

> On Apr 11, 2018, at 6:01 PM, Tom Pusateri <[hidden email]> wrote:
>
> I have defined an encapsulated option and am requesting it in dhclient. However, I’m not seeing the request in a tcpdump trace of the request. I included other dhcp options in the request and they are present but not my custom one. Any ideas to what I’m doing wrong? hex 0017 and 0027 are the dhcp6.fqdn and dhcp6.name-servers options you can see in the tcpdump below but the length is 0004 so it’s not trying to add more options I don’t think.
>
> dhclient.conf
> ————————————
> option space foo;
> option foo.first code 226 = ip6-address;
> option foo.second code 227 = unsigned integer 16;
> option foo.third code 228 = domain-list;
> option foo.fourth code 229 = text;
> option foo-encapsulation code 225 = encapsulate foo;
>
> request dhcp6.fqdn, dhcp6.name-servers, foo.first, foo.second, foo.third;
> ——————————————————
>
> I’ve also tried:
> request dhcp6.fqdn, dhcp6.name-servers, foo-encapsulation with the same result.
>
>
> # /usr/local/sbin/dhclient --version
> isc-dhclient-4.4.1
> # /usr/local/sbin/dhclient -v -d -1 -S -p 1067 -cf ./dhclient.conf -lf ./dhclient.leases -pf ./dhclient.pid en0
>
> % tcpdump -i en0 -vvvv udp -s 1500 port 1067
> tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 1500 bytes
>
>
> 15:50:42.915158 IP6 (flowlabel 0x92cce, hlim 1, next-header UDP (17) payload length: 40) butte-480.local.instl_boots > ff02::1:2.dhcpv6-server: [udp sum ok] dhcp6 inf-req (xid=7b23c6 (client-ID hwaddr type 1 784f434f30b5) (option-request DNS-server Client-FQDN) (elapsed-time 625))
> 0x0000:  6009 2cce 0028 1101 fe80 0000 0000 0000
> 0x0010:  1471 b2e9 a8fa 9e1b ff02 0000 0000 0000
> 0x0020:  0000 0000 0001 0002 042b 0223 0028 cef1
> 0x0030:  0b7b 23c6 0001 000a 0003 0001 784f 434f
> 0x0040:  30b5 0006 0004 0017 0027 0008 0002 0271
>

I tried a simple option definition and it failed in the same way. Am I running into Bug #35902? Should I open a new bug?

https://bugs.isc.org/Public/Bug/Display.html?id=35902

Bug 35902 has been open for 4 years which doesn’t give me much hope.

Tom


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: help with custom option request in dhclient

Thomas Markwalder
Hi Tom:

Try it this way:

On the server:

option space foo;
option foo.first code 226 = ip6-address;
# Note "dhcp6." prefix
option dhcp6.foo-encapsulation code 225 = encapsulate foo;

subnet6 xxxxxxx {
     :
     option foo.first 2000:1::;
}


And on the client side:

option space foo;
option foo.first code 226 = ip6-address;
# Note "dhcp6." prefix
option dhcp6.foo-encapsulation code 225 = encapsulate foo;

also request dhcp6.foo-encapsulation;


regards,

Thomas

On 04/12/2018 03:22 PM, Tom Pusateri wrote:

>> On Apr 11, 2018, at 6:01 PM, Tom Pusateri <[hidden email]> wrote:
>>
>> I have defined an encapsulated option and am requesting it in dhclient. However, I’m not seeing the request in a tcpdump trace of the request. I included other dhcp options in the request and they are present but not my custom one. Any ideas to what I’m doing wrong? hex 0017 and 0027 are the dhcp6.fqdn and dhcp6.name-servers options you can see in the tcpdump below but the length is 0004 so it’s not trying to add more options I don’t think.
>>
>> dhclient.conf
>> ————————————
>> option space foo;
>> option foo.first code 226 = ip6-address;
>> option foo.second code 227 = unsigned integer 16;
>> option foo.third code 228 = domain-list;
>> option foo.fourth code 229 = text;
>> option foo-encapsulation code 225 = encapsulate foo;
>>
>> request dhcp6.fqdn, dhcp6.name-servers, foo.first, foo.second, foo.third;
>> ——————————————————
>>
>> I’ve also tried:
>> request dhcp6.fqdn, dhcp6.name-servers, foo-encapsulation with the same result.
>>
>>
>> # /usr/local/sbin/dhclient --version
>> isc-dhclient-4.4.1
>> # /usr/local/sbin/dhclient -v -d -1 -S -p 1067 -cf ./dhclient.conf -lf ./dhclient.leases -pf ./dhclient.pid en0
>>
>> % tcpdump -i en0 -vvvv udp -s 1500 port 1067
>> tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 1500 bytes
>>
>>
>> 15:50:42.915158 IP6 (flowlabel 0x92cce, hlim 1, next-header UDP (17) payload length: 40) butte-480.local.instl_boots > ff02::1:2.dhcpv6-server: [udp sum ok] dhcp6 inf-req (xid=7b23c6 (client-ID hwaddr type 1 784f434f30b5) (option-request DNS-server Client-FQDN) (elapsed-time 625))
>> 0x0000:  6009 2cce 0028 1101 fe80 0000 0000 0000
>> 0x0010:  1471 b2e9 a8fa 9e1b ff02 0000 0000 0000
>> 0x0020:  0000 0000 0001 0002 042b 0223 0028 cef1
>> 0x0030:  0b7b 23c6 0001 000a 0003 0001 784f 434f
>> 0x0040:  30b5 0006 0004 0017 0027 0008 0002 0271
>>
> I tried a simple option definition and it failed in the same way. Am I running into Bug #35902? Should I open a new bug?
>
> https://bugs.isc.org/Public/Bug/Display.html?id=35902
>
> Bug 35902 has been open for 4 years which doesn’t give me much hope.
>
> Tom
>
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: help with custom option request in dhclient

Tom Pusateri
I just tested the client and it definitely works!

Will test the server later today.

Thanks so much.

Tom

> On Apr 30, 2018, at 10:57 AM, Thomas Markwalder <[hidden email]> wrote:
>
> Hi Tom:
>
> Try it this way:
>
> On the server:
>
> option space foo;
> option foo.first code 226 = ip6-address;
> # Note "dhcp6." prefix
> option dhcp6.foo-encapsulation code 225 = encapsulate foo;
>
> subnet6 xxxxxxx {
>     :
>     option foo.first 2000:1::;
> }
>
>
> And on the client side:
>
> option space foo;
> option foo.first code 226 = ip6-address;
> # Note "dhcp6." prefix
> option dhcp6.foo-encapsulation code 225 = encapsulate foo;
>
> also request dhcp6.foo-encapsulation;
>
>
> regards,
>
> Thomas
>
> On 04/12/2018 03:22 PM, Tom Pusateri wrote:
>>> On Apr 11, 2018, at 6:01 PM, Tom Pusateri <[hidden email]> wrote:
>>>
>>> I have defined an encapsulated option and am requesting it in dhclient. However, I’m not seeing the request in a tcpdump trace of the request. I included other dhcp options in the request and they are present but not my custom one. Any ideas to what I’m doing wrong? hex 0017 and 0027 are the dhcp6.fqdn and dhcp6.name-servers options you can see in the tcpdump below but the length is 0004 so it’s not trying to add more options I don’t think.
>>>
>>> dhclient.conf
>>> ————————————
>>> option space foo;
>>> option foo.first code 226 = ip6-address;
>>> option foo.second code 227 = unsigned integer 16;
>>> option foo.third code 228 = domain-list;
>>> option foo.fourth code 229 = text;
>>> option foo-encapsulation code 225 = encapsulate foo;
>>>
>>> request dhcp6.fqdn, dhcp6.name-servers, foo.first, foo.second, foo.third;
>>> ——————————————————
>>>
>>> I’ve also tried:
>>> request dhcp6.fqdn, dhcp6.name-servers, foo-encapsulation with the same result.
>>>
>>>
>>> # /usr/local/sbin/dhclient --version
>>> isc-dhclient-4.4.1
>>> # /usr/local/sbin/dhclient -v -d -1 -S -p 1067 -cf ./dhclient.conf -lf ./dhclient.leases -pf ./dhclient.pid en0
>>>
>>> % tcpdump -i en0 -vvvv udp -s 1500 port 1067
>>> tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 1500 bytes
>>>
>>>
>>> 15:50:42.915158 IP6 (flowlabel 0x92cce, hlim 1, next-header UDP (17) payload length: 40) butte-480.local.instl_boots > ff02::1:2.dhcpv6-server: [udp sum ok] dhcp6 inf-req (xid=7b23c6 (client-ID hwaddr type 1 784f434f30b5) (option-request DNS-server Client-FQDN) (elapsed-time 625))
>>> 0x0000:  6009 2cce 0028 1101 fe80 0000 0000 0000
>>> 0x0010:  1471 b2e9 a8fa 9e1b ff02 0000 0000 0000
>>> 0x0020:  0000 0000 0001 0002 042b 0223 0028 cef1
>>> 0x0030:  0b7b 23c6 0001 000a 0003 0001 784f 434f
>>> 0x0040:  30b5 0006 0004 0017 0027 0008 0002 0271
>>>
>> I tried a simple option definition and it failed in the same way. Am I running into Bug #35902? Should I open a new bug?
>>
>> https://bugs.isc.org/Public/Bug/Display.html?id=35902
>>
>> Bug 35902 has been open for 4 years which doesn’t give me much hope.
>>
>> Tom
>>
>>
>> _______________________________________________
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: help with custom option request in dhclient

Tom Pusateri
Ok, great!  This worked on the server too.

One more question. RFC 3315, Section 22 says:

   "Unless otherwise noted, each option may appear only in the options
   area of a DHCP message and may appear only once.  If an option does
   appear multiple times, each instance is considered separate and the
   data areas of the options MUST NOT be concatenated or otherwise
   combined.”

If I want to define an option that can appear multiple times, is there a way to define it in the server, maybe like this:

  option space foo;
  option foo.first code 226 = ip6-address;
  option foo.second code 227 = unsigned integer 16;

  option dhcp6.foo-encapsulation code 225 = encapsulate foo;

  subnet6 xxxx:xxxx:xxxx:xxxx::/64 {
      option foo.first 1111:22:0:100::33;
      option foo.second 111;

      option foo.first 2222:fe::fe;
      option foo.second 222;
  }

And then when the client requests dhcp6.foo-encapsulation, can it get multiple 225 options in the reply?

Thanks,
Tom


> On Apr 30, 2018, at 11:18 AM, Tom Pusateri <[hidden email]> wrote:
>
> I just tested the client and it definitely works!
>
> Will test the server later today.
>
> Thanks so much.
>
> Tom
>
>> On Apr 30, 2018, at 10:57 AM, Thomas Markwalder <[hidden email]> wrote:
>>
>> Hi Tom:
>>
>> Try it this way:
>>
>> On the server:
>>
>> option space foo;
>> option foo.first code 226 = ip6-address;
>> # Note "dhcp6." prefix
>> option dhcp6.foo-encapsulation code 225 = encapsulate foo;
>>
>> subnet6 xxxxxxx {
>>    :
>>    option foo.first 2000:1::;
>> }
>>
>>
>> And on the client side:
>>
>> option space foo;
>> option foo.first code 226 = ip6-address;
>> # Note "dhcp6." prefix
>> option dhcp6.foo-encapsulation code 225 = encapsulate foo;
>>
>> also request dhcp6.foo-encapsulation;
>>
>>
>> regards,
>>
>> Thomas
>>
>> On 04/12/2018 03:22 PM, Tom Pusateri wrote:
>>>> On Apr 11, 2018, at 6:01 PM, Tom Pusateri <[hidden email]> wrote:
>>>>
>>>> I have defined an encapsulated option and am requesting it in dhclient. However, I’m not seeing the request in a tcpdump trace of the request. I included other dhcp options in the request and they are present but not my custom one. Any ideas to what I’m doing wrong? hex 0017 and 0027 are the dhcp6.fqdn and dhcp6.name-servers options you can see in the tcpdump below but the length is 0004 so it’s not trying to add more options I don’t think.
>>>>
>>>> dhclient.conf
>>>> ————————————
>>>> option space foo;
>>>> option foo.first code 226 = ip6-address;
>>>> option foo.second code 227 = unsigned integer 16;
>>>> option foo.third code 228 = domain-list;
>>>> option foo.fourth code 229 = text;
>>>> option foo-encapsulation code 225 = encapsulate foo;
>>>>
>>>> request dhcp6.fqdn, dhcp6.name-servers, foo.first, foo.second, foo.third;
>>>> ——————————————————
>>>>
>>>> I’ve also tried:
>>>> request dhcp6.fqdn, dhcp6.name-servers, foo-encapsulation with the same result.
>>>>
>>>>
>>>> # /usr/local/sbin/dhclient --version
>>>> isc-dhclient-4.4.1
>>>> # /usr/local/sbin/dhclient -v -d -1 -S -p 1067 -cf ./dhclient.conf -lf ./dhclient.leases -pf ./dhclient.pid en0
>>>>
>>>> % tcpdump -i en0 -vvvv udp -s 1500 port 1067
>>>> tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 1500 bytes
>>>>
>>>>
>>>> 15:50:42.915158 IP6 (flowlabel 0x92cce, hlim 1, next-header UDP (17) payload length: 40) butte-480.local.instl_boots > ff02::1:2.dhcpv6-server: [udp sum ok] dhcp6 inf-req (xid=7b23c6 (client-ID hwaddr type 1 784f434f30b5) (option-request DNS-server Client-FQDN) (elapsed-time 625))
>>>> 0x0000:  6009 2cce 0028 1101 fe80 0000 0000 0000
>>>> 0x0010:  1471 b2e9 a8fa 9e1b ff02 0000 0000 0000
>>>> 0x0020:  0000 0000 0001 0002 042b 0223 0028 cef1
>>>> 0x0030:  0b7b 23c6 0001 000a 0003 0001 784f 434f
>>>> 0x0040:  30b5 0006 0004 0017 0027 0008 0002 0271
>>>>
>>> I tried a simple option definition and it failed in the same way. Am I running into Bug #35902? Should I open a new bug?
>>>
>>> https://bugs.isc.org/Public/Bug/Display.html?id=35902
>>>
>>> Bug 35902 has been open for 4 years which doesn’t give me much hope.
>>>
>>> Tom
>>>
>>>
>>> _______________________________________________
>>> dhcp-users mailing list
>>> [hidden email]
>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>
>> _______________________________________________
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users