Is there any way to include dynamic info in the DHCP REQUEST?

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

Is there any way to include dynamic info in the DHCP REQUEST?

Fredrik Persson
Hi, new to the list!

Is there a way to include dynamic information in a "send" to the dhcp server?

Something like this (I know that this does not work, but it gives an idea of what I am looking for):

interface "eth0" {
    send <some parameter> $SOME_ENV_VAR;
    request subnet-mask,
            broadcast-address,
/* ... */
}

Thanks in advance,

Fredrik Persson

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

Re: Is there any way to include dynamic info in the DHCP REQUEST?

Simon Hobson
Fredrik Persson <[hidden email]> wrote:

> Is there a way to include dynamic information in a "send" to the dhcp server?
>
> Something like this (I know that this does not work, but it gives an idea of what I am looking for):
>
> interface "eth0" {
>     send <some parameter> $SOME_ENV_VAR;
>     request subnet-mask,
>             broadcast-address,
> /* ... */
> }

Is this a Linux/Unix like system ? I know on GNU/Linux systems, the ISC client is typically called by a script, and also calls a script to configure the OS when it gets a lease or the lease expires.
Depending on how dynamic the information needs to be, then you can configure the client to add customer options - and if you configure the scripts correctly, to do something with options returned. You may have issues changing the information - you may have to detect the change, and restart the client for it to take effect.


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

Re: Is there any way to include dynamic info in the DHCP REQUEST?

Fredrik Persson
Perhaps I was not clear in my original question.

Yes, this is a linux system. I know that there is a script (dhclient-script) that is run when the lease is aquired but I want to send things to the dhcp server in the request. And the thing I want to send is read (in ways not related to the question) from the system during boot.

On Thu, Jun 4, 2015 at 2:20 PM, Simon Hobson <[hidden email]> wrote:
Fredrik Persson <[hidden email]> wrote:

> Is there a way to include dynamic information in a "send" to the dhcp server?
>
> Something like this (I know that this does not work, but it gives an idea of what I am looking for):
>
> interface "eth0" {
>     send <some parameter> $SOME_ENV_VAR;
>     request subnet-mask,
>             broadcast-address,
> /* ... */
> }

Is this a Linux/Unix like system ? I know on GNU/Linux systems, the ISC client is typically called by a script, and also calls a script to configure the OS when it gets a lease or the lease expires.
Depending on how dynamic the information needs to be, then you can configure the client to add customer options - and if you configure the scripts correctly, to do something with options returned. You may have issues changing the information - you may have to detect the change, and restart the client for it to take effect.


_______________________________________________
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: Is there any way to include dynamic info in the DHCP REQUEST?

Sean McMurray
In reply to this post by Fredrik Persson
man dhclient includes documentation for:
-I <dhcp-client-identifier>
              Specify the dhcp-client-identifier option to send to the DHCP server.
-H <host-name>
              Specify  the  host-name option to send to the DHCP server.
-V <vendor-class-identifier>
              Specify the vendor-class-identifier option to send to the DHCP server.
-R <option>[,<option>...]
              Specify the list of options the client is to request from the server.
              The default option list is:
                  subnet-mask, broadcast-address, time-offset, routers,
                  domain-search, domain-name, domain-name-servers, host-name,
                  nis-domain, nis-servers, ntp-servers, interface-mtu



On 06/04/2015 04:33 AM, Fredrik Persson wrote:
Hi, new to the list!

Is there a way to include dynamic information in a "send" to the dhcp server?

Something like this (I know that this does not work, but it gives an idea of what I am looking for):

interface "eth0" {
    send <some parameter> $SOME_ENV_VAR;
    request subnet-mask,
            broadcast-address,
/* ... */
}

Thanks in advance,

Fredrik Persson


_______________________________________________
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: Is there any way to include dynamic info in the DHCP REQUEST?

Fredrik Persson
Thanks, those would be great and in principal this is what I need.

However, what I am looking for is to set the option 125 ("vivso") in this way. (I am aware that vivso is also something that can be requested from the dhcp server, but I am working with the part that sends vivso *from* the client *to* the server, as required in the TR111 spec.)

On Thu, Jun 4, 2015 at 4:17 PM, Sean McMurray <[hidden email]> wrote:
man dhclient includes documentation for:
-I <dhcp-client-identifier>
              Specify the dhcp-client-identifier option to send to the DHCP server.
-H <host-name>
              Specify  the  host-name option to send to the DHCP server.
-V <vendor-class-identifier>
              Specify the vendor-class-identifier option to send to the DHCP server.
-R <option>[,<option>...]
              Specify the list of options the client is to request from the server.
              The default option list is:
                  subnet-mask, broadcast-address, time-offset, routers,
                  domain-search, domain-name, domain-name-servers, host-name,
                  nis-domain, nis-servers, ntp-servers, interface-mtu




On 06/04/2015 04:33 AM, Fredrik Persson wrote:
Hi, new to the list!

Is there a way to include dynamic information in a "send" to the dhcp server?

Something like this (I know that this does not work, but it gives an idea of what I am looking for):

interface "eth0" {
    send <some parameter> $SOME_ENV_VAR;
    request subnet-mask,
            broadcast-address,
/* ... */
}

Thanks in advance,

Fredrik Persson


_______________________________________________
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: Is there any way to include dynamic info in the DHCP REQUEST?

Peter Rathlev
Hi Fredrik,

On Thu, 2015-06-04 at 17:06 +0200, Fredrik Persson wrote:
> However, what I am looking for is to set the option 125 ("vivso") in
> this way. (I am aware that vivso is also something that can be
> requested from the dhcp server, but I am working with the part that
> sends vivso *from* the client *to* the server, as required in the
> TR111 spec.)

You could probably do this by composing a custom dhclient.conf with the
relevant "send" statements and then starting dhclient with that.

I don't think there's a way to directly read e.g. environment variables
in dhclient.conf.

--
Peter



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