omshell reservation

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

omshell reservation

Gregory Sloop
omshell reservation I'm trying to accomplish a "reservation" using omshell.

But just like Unicorns, Santa, and the Easter Bunny, I'm not sure it really exists!
Ok, ok. Yeah, it probably does - but I can't find an example anywhere that's confirmed to work.

This quote from long ago summarizes my feelings so far. [probably nearly everyone's, actually]

> involves a rather fragile and often misbehaving omshell
> process where the only "documentation" is half a mailing list thread
> from ten years ago 

So, from what I've gleaned, this is what I'm doing.
After you get into omshell
---
port xxx
server localhost
key...
set ip-sddress=1.2.3.4
open
---

I get a listing of the lease for 1.2.3.4
Then it looks like I should use
set flag = 8
update
[And surprisingly the update takes. It feels like magic when you finally hit on the right incantation!]

So, my questions
1) Is setting flags = 8 the right thing to set for a reserved lease? (I'm guessing from that even less than half a thread from 10y ago.)

2) How can I tell if it actually took?
[hidden email]
[hidden email] And perhaps realated to #2 - what's this mean in the lease: set remote-handle = %3; (I see that after setting flag = 8

TIA
-Greg
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

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

Re: omshell reservation

glenn.satchell
Great sleuthing there Greg. omshell typically writes something into the
leases file, so have a look for the *last* record for the given IP
address and see what is in it, especially compared to earlier ones.

regards,
-glenn

On 2020-07-18 08:02, Gregory Sloop wrote:

> I'm trying to accomplish a "reservation" using omshell.
>
> But just like Unicorns, Santa, and the Easter Bunny, I'm not sure it
> really exists!
> Ok, ok. Yeah, it probably does - but I can't find an example anywhere
> that's confirmed to work.
>
> This quote from long ago summarizes my feelings so far. [probably
> nearly everyone's, actually]
>
>> involves a rather fragile and often misbehaving omshell
>> process where the only "documentation" is half a mailing list thread
>> from ten years ago
>
> So, from what I've gleaned, this is what I'm doing.
> After you get into omshell
> ---
> port xxx
> server localhost
> key...
> set ip-sddress=1.2.3.4
> open
> ---
>
> I get a listing of the lease for 1.2.3.4
> Then it looks like I should use
> set flag = 8
> update
> [And surprisingly the update takes. It feels like magic when you
> finally hit on the right incantation!]
>
> So, my questions
> 1) Is setting flags = 8 the right thing to set for a reserved lease?
> (I'm guessing from that even less than half a thread from 10y ago.)
>
> 2) How can I tell if it actually took?
>
> 3) And perhaps realated to #2 - what's this mean in the lease: set
> remote-handle = %3; (I see that after setting flag = 8
>
> TIA
> -Greg
> _______________________________________________
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

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

Re: omshell reservation

Gregory Sloop
Re: omshell reservation Still struggling with this.

Perhaps I wasn't clear, but question #3 was about what I see in the leases file.

After the lease is expired, here's what I find in the leases file.
---
lease 10.8.20.229 {
  starts 5 2020/07/17 22:42:54;
  ends 5 2020/07/17 22:42:52;
  tstp 5 2020/07/17 22:42:54;
  tsfp 5 2020/07/17 22:42:54;
  atsfp 5 2020/07/17 22:42:54;
  cltt 5 2020/07/17 18:42:52;
  binding state backup;
  hardware ethernet 98:01:a7:ff:ff:ff;
  uid "\000\000\000\000\000\000";
  set remote-handle = %3;
  set vendor-class-identifier = "MSFT 5.0";
}

---

The only thing that I noticed that changed after setting flags was the
  set remote-handle = %3;
And I can't find any detail about what "remote-handle" is.
Does it even apply to reservations?

TIA
-Greg


gsuca> Great sleuthing there Greg. omshell typically writes something into the
gsuca> leases file, so have a look for the *last* record for the given IP
gsuca> address and see what is in it, especially compared to earlier ones.

gsuca> regards,
gsuca> -glenn

gsuca> On 2020-07-18 08:02, Gregory Sloop wrote:
>> I'm trying to accomplish a "reservation" using omshell.

>> But just like Unicorns, Santa, and the Easter Bunny, I'm not sure it
>> really exists!
>> Ok, ok. Yeah, it probably does - but I can't find an example anywhere
>> that's confirmed to work.

>> This quote from long ago summarizes my feelings so far. [probably
>> nearly everyone's, actually]

>>> involves a rather fragile and often misbehaving omshell
>>> process where the only "documentation" is half a mailing list thread
>>> from ten years ago

>> So, from what I've gleaned, this is what I'm doing.
>> After you get into omshell
>> ---
>> port xxx
>> server localhost
>> key...
>> set ip-sddress=1.2.3.4
>> open
>> ---

>> I get a listing of the lease for 1.2.3.4
>> Then it looks like I should use
>> set flag = 8
>> update
>> [And surprisingly the update takes. It feels like magic when you
>> finally hit on the right incantation!]

>> So, my questions
>> 1) Is setting flags = 8 the right thing to set for a reserved lease?
>> (I'm guessing from that even less than half a thread from 10y ago.)

>> 2) How can I tell if it actually took?

>> 3) And perhaps realated to #2 - what's this mean in the lease: set
>> remote-handle = %3; (I see that after setting flag = 8

>> TIA
>> -Greg
>> _______________________________________________
>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at
https://www.isc.org/contact/ for more
>> information.

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

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

Re: omshell reservation

Thomas Markwalder
Set flags value to 4:

A bit of bash:


omshell 1>$errfile 2>&1 << END_OF_INPUT
server localhost
port 7911
connect
new lease
set ip-address = $addr
open
set flags = 4
update
END_OF_INPUT



You should see the word "reserved" added to the lease:

lease 178.16.1.100 {
  starts 1 2020/07/20 14:00:00;
  ends 1 2020/07/20 15:00:00;
  tstp 1 2020/07/20 15:00:00;
  cltt 1 2020/07/20 14:00:00;
  binding state free;
  reserved;
  hardware ethernet 08:00:27:25:d3:f4;
  set remote-handle = %1;
}

On 7/20/20 9:18 AM, Gregory Sloop wrote:
Re: omshell reservation Still struggling with this.

Perhaps I wasn't clear, but question #3 was about what I see in the leases file.

After the lease is expired, here's what I find in the leases file.
---
lease 10.8.20.229 {
  starts 5 2020/07/17 22:42:54;
  ends 5 2020/07/17 22:42:52;
  tstp 5 2020/07/17 22:42:54;
  tsfp 5 2020/07/17 22:42:54;
  atsfp 5 2020/07/17 22:42:54;
  cltt 5 2020/07/17 18:42:52;
  binding state backup;
  hardware ethernet 98:01:a7:ff:ff:ff;
  uid "\000\000\000\000\000\000";
  set remote-handle = %3;
  set vendor-class-identifier = "MSFT 5.0";
}

---

The only thing that I noticed that changed after setting flags was the
  set remote-handle = %3;
And I can't find any detail about what "remote-handle" is.
Does it even apply to reservations?

TIA
-Greg


gsuca> Great sleuthing there Greg. omshell typically writes something into the
gsuca> leases file, so have a look for the *last* record for the given IP
gsuca> address and see what is in it, especially compared to earlier ones.

gsuca> regards,
gsuca> -glenn

gsuca> On 2020-07-18 08:02, Gregory Sloop wrote:
>> I'm trying to accomplish a "reservation" using omshell.

>> But just like Unicorns, Santa, and the Easter Bunny, I'm not sure it
>> really exists!
>> Ok, ok. Yeah, it probably does - but I can't find an example anywhere
>> that's confirmed to work.

>> This quote from long ago summarizes my feelings so far. [probably
>> nearly everyone's, actually]

>>> involves a rather fragile and often misbehaving omshell
>>> process where the only "documentation" is half a mailing list thread
>>> from ten years ago

>> So, from what I've gleaned, this is what I'm doing.
>> After you get into omshell
>> ---
>> port xxx
>> server localhost
>> key...
>> set ip-sddress=1.2.3.4
>> open
>> ---

>> I get a listing of the lease for 1.2.3.4
>> Then it looks like I should use
>> set flag = 8
>> update
>> [And surprisingly the update takes. It feels like magic when you
>> finally hit on the right incantation!]

>> So, my questions
>> 1) Is setting flags = 8 the right thing to set for a reserved lease?
>> (I'm guessing from that even less than half a thread from 10y ago.)

>> 2) How can I tell if it actually took?

>> 3) And perhaps realated to #2 - what's this mean in the lease: set
>> remote-handle = %3; (I see that after setting flag = 8

>> TIA
>> -Greg
>> _______________________________________________
>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at
https://www.isc.org/contact/ for more
>> information.

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

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


_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

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

Re: omshell reservation

Gregory Sloop
Re: omshell reservation Ohhhh... Very cool bash script, BTW.
(my bash-foo is weak! Grasshopper will remember this tidbit!)

I owe you a beer, or something!
Thanks a bunch!

[BTW, where/how do you determine what flag values to use - other than asking a dev? Is it documented somewhere other than just source code?]

Again, thanks so much!

-Greg



Set flags value to 4:

A bit of bash:


omshell 1>$errfile 2>&1 << END_OF_INPUT
server localhost
port 7911
connect
new lease
set ip-address = $addr
open
set flags = 4
update
END_OF_INPUT



You should see the word "reserved" added to the lease:

lease 178.16.1.100 {
  starts 1 2020/07/20 14:00:00;
  ends 1 2020/07/20 15:00:00;
  tstp 1 2020/07/20 15:00:00;
  cltt 1 2020/07/20 14:00:00;
  binding state free;
  reserved;
  hardware ethernet 08:00:27:25:d3:f4;
  set remote-handle = %1;
}

On 7/20/20 9:18 AM, Gregory Sloop wrote:

Re: omshell reservation
Still struggling with this.

Perhaps I wasn't clear, but question #3 was about what I see in the leases file.

After the lease is expired, here's what I find in the leases file.
---
lease 10.8.20.229 {
  starts 5 2020/07/17 22:42:54;
  ends 5 2020/07/17 22:42:52;
  tstp 5 2020/07/17 22:42:54;
  tsfp 5 2020/07/17 22:42:54;
  atsfp 5 2020/07/17 22:42:54;
  cltt 5 2020/07/17 18:42:52;
  binding state backup;
  hardware ethernet 98:01:a7:ff:ff:ff;
  uid "\000\000\000\000\000\000";
  set remote-handle = %3;
  set vendor-class-identifier = "MSFT 5.0";
}

---

The only thing that I noticed that changed after setting flags was the
  set remote-handle = %3;
And I can't find any detail about what "remote-handle" is.
Does it even apply to reservations?

TIA
-Greg


gsuca> Great sleuthing there Greg. omshell typically writes something into the
gsuca> leases file, so have a look for the *last* record for the given IP
gsuca> address and see what is in it, especially compared to earlier ones.

gsuca> regards,
gsuca> -glenn

gsuca> On 2020-07-18 08:02, Gregory Sloop wrote:
>> I'm trying to accomplish a "reservation" using omshell.

>> But just like Unicorns, Santa, and the Easter Bunny, I'm not sure it
>> really exists!
>> Ok, ok. Yeah, it probably does - but I can't find an example anywhere
>> that's confirmed to work.

>> This quote from long ago summarizes my feelings so far. [probably
>> nearly everyone's, actually]

>>> involves a rather fragile and often misbehaving omshell
>>> process where the only "documentation" is half a mailing list thread
>>> from ten years ago

>> So, from what I've gleaned, this is what I'm doing.
>> After you get into omshell
>> ---
>> port xxx
>> server localhost
>> key...
>> set ip-sddress=1.2.3.4
>> open
>> ---

>> I get a listing of the lease for 1.2.3.4
>> Then it looks like I should use
>> set flag = 8
>> update
>> [And surprisingly the update takes. It feels like magic when you
>> finally hit on the right incantation!]

>> So, my questions
>> 1) Is setting flags = 8 the right thing to set for a reserved lease?
>> (I'm guessing from that even less than half a thread from 10y ago.)

>> 2) How can I tell if it actually took?

>> 3) And perhaps realated to #2 - what's this mean in the lease: set
>> remote-handle = %3; (I see that after setting flag = 8

>> TIA
>> -Greg
>> _______________________________________________
>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at
https://www.isc.org/contact/ for more
>> information.

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at
https://www.isc.org/contact/ for more information.

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

--
Gregory Sloop, Principal: Sloop Network & Computer Consulting
Voice: 503.251.0452 x121
EMail:
[hidden email]
http://www.sloop.net
---
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

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

Re: omshell reservation

glenn.satchell
In reply to this post by Gregory Sloop
Hi Greg,

Oh, sorry didn't pick that up. In the dhcpd.leases(5) man page it
suggests that it should write the keyword 'reserved;' into the lease
entry. Note this is the only place in that man page that has the word
"flags".

        bootp;
        reserved;

        If  present, they indicate that the BOOTP and RESERVED failover
flags (respectively) should be set.  BOOTP and RESERVED dynamic leases
are treated differently than normal dynamic leases, as they may
        only be used by the client to which they are currently allocated.

So maybe setting flags = 0 is not the right thing. Perhaps some other
value or some other name?

Quite likely you may need to look at the source code to get further into
it. I started here:

https://gitlab.isc.org/isc-projects/dhcp/-/blob/master/dhcpctl/omshell.c

but there are a few levels of indirection to work through and it's a few
years since I've done much C :)

https://gitlab.isc.org/isc-projects/dhcp/-/blob/master/includes/dhcpd.h

in includes/dhcpd.h in the definition of struct lease near line 590 it
has:

struct lease {
...
         u_int8_t flags;
...
#       define RESERVED_LEASE           4
#       define MS_NULL_TERMINATION      8

so maybe 4 is the value to set the flags to in OMSHELL? Looking at
server/omapi.c around line 312 the new value is OR'd in with the
existing flags.

So I tested this, the only bit different to your recipe was set flags =
4

omshell
key name value (these are from /etc/dhcpd.conf)
connect
new lease
set ip-address = 192.168.14.219
open
set flags = 4
update

and after giving the update command this is the new lease entry with the
reserved flag:

lease 192.168.14.219 {
   starts 4 2018/12/20 07:31:58;
   ends 4 2018/12/20 07:33:58;
   tstp 4 2018/12/20 07:33:58;
   cltt 4 2018/12/20 07:31:58;
   binding state free;
   reserved;
   hardware ethernet e0:66:78:50:f0:e8;
   uid "\[hidden email]";
   set remote-handle = %2;
   set param-req-list = "1,121,3,6,15,119,252";
   client-hostname "Ashleighs-iPad";
}

ta da!

regard,
Glenn Satchell

On 2020-07-20 23:18, Gregory Sloop wrote:

> Still struggling with this.
>
> Perhaps I wasn't clear, but question #3 was about what I see in the
> leases file.
>
> After the lease is expired, here's what I find in the leases file.
> ---
> lease 10.8.20.229 {
>   starts 5 2020/07/17 22:42:54;
>   ends 5 2020/07/17 22:42:52;
>   tstp 5 2020/07/17 22:42:54;
>   tsfp 5 2020/07/17 22:42:54;
>   atsfp 5 2020/07/17 22:42:54;
>   cltt 5 2020/07/17 18:42:52;
>   binding state backup;
>   hardware ethernet 98:01:a7:ff:ff:ff;
>   uid "\000\000\000\000\000\000";
>   set remote-handle = %3;
>   set vendor-class-identifier = "MSFT 5.0";
> }
>
> ---
>
> The only thing that I noticed that changed after setting flags was the
>   set remote-handle = %3;
> And I can't find any detail about what "remote-handle" is.
> Does it even apply to reservations?
>
> TIA
> -Greg
>
> gsuca> Great sleuthing there Greg. omshell typically writes something
> into the
> gsuca> leases file, so have a look for the *last* record for the given
> IP
> gsuca> address and see what is in it, especially compared to earlier
> ones.
>
> gsuca> regards,
> gsuca> -glenn
>
> gsuca> On 2020-07-18 08:02, Gregory Sloop wrote:
>>> I'm trying to accomplish a "reservation" using omshell.
>
>>> But just like Unicorns, Santa, and the Easter Bunny, I'm not sure
> it
>>> really exists!
>>> Ok, ok. Yeah, it probably does - but I can't find an example
> anywhere
>>> that's confirmed to work.
>
>>> This quote from long ago summarizes my feelings so far. [probably
>>> nearly everyone's, actually]
>
>>>> involves a rather fragile and often misbehaving omshell
>>>> process where the only "documentation" is half a mailing list
> thread
>>>> from ten years ago
>
>>> So, from what I've gleaned, this is what I'm doing.
>>> After you get into omshell
>>> ---
>>> port xxx
>>> server localhost
>>> key...
>>> set ip-sddress=1.2.3.4
>>> open
>>> ---
>
>>> I get a listing of the lease for 1.2.3.4
>>> Then it looks like I should use
>>> set flag = 8
>>> update
>>> [And surprisingly the update takes. It feels like magic when you
>>> finally hit on the right incantation!]
>
>>> So, my questions
>>> 1) Is setting flags = 8 the right thing to set for a reserved
> lease?
>>> (I'm guessing from that even less than half a thread from 10y ago.)
>
>>> 2) How can I tell if it actually took?
>
>>> 3) And perhaps realated to #2 - what's this mean in the lease: set
>>> remote-handle = %3; (I see that after setting flag = 8
>
>>> TIA
>>> -Greg
>>> _______________________________________________
>>> ISC funds the development of this software with paid support
>>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>>> information.
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

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