Host Declaration

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

Host Declaration

Jérôme BECOT
Hello everyone,

I'm wondering about the difference between declaring hosts at the global level and in their respective subnets. It looks like the same to me but I may miss something about it. They would inherit the subnet parameters the same way, wouldn't it ?

subnet 10.10.10.0/24 {
  option X value;
  host zero { .. }
}

group "site-A hosts" {
  host one { 10.10.10.1; }
}

....

Also, what happen if I declare a group of subnets and a separate group of hosts outside, like :

group "site-B subnets" {
  option A value1;
  subnet 10.0.0.0/8{ ... }
  subnet 172.16.0.0./16 { ... }
}

group "site-B hosts" {
  host zero { fixed-address: 10.0.0.1; }
}

Is host 0 receiving the option A value as well ?

Thanks

JEROME BECOT
Ingénieur Système et Réseau
DSIRN
Bureau n°4.29
 
Institut national des langues et civilisations orientales
65 rue des Grands Moulins
Paris 75013, France

01 81 70 10 78
jerome.becot@inalco.fr
www.inalco.fr


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

Re: Host Declaration

Simon Hobson
Jérôme BECOT <[hidden email]> wrote:

> I'm wondering about the difference between declaring hosts at the global level and in their respective subnets. It looks like the same to me but I may miss something about it.

The difference you've missed is that you get "interesting" inheritance problems !

Host statements are always global in scope regardless of where they are declared. However, as a quirk of implementation, they can inherit from where they are defined. The result of this is that you can have a client that gets an address from one subnet, but options like gateway from a different subnet - something that's obscure and hard to pin down.

In many cases you'll get away with it. If you define hosts with a single IP address, then they'll either use that host declaration in that subnet, or if in another subnet they won't use it. It's only when you define multiple addresses, or none at all, that the problem shows up.

TL;DR version :
Always put your hosts in the global scope - or in a group if you want to assign common options to multiple hosts.

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

Re: Host Declaration

Bill Shirley-2
In reply to this post by Jérôme BECOT
host statements are global.

Example:
subnet 10.10.10.0 netmask 255.255.255.0 {
    ddns-updates          on;
    default-lease-time    3600;    # 1 hour
}

group "storage" {
    ddns-updates          off;
    option log-servers    10.10.10.1;
    host storage-1        { hardware ethernet ff:ca:ff:26:30:4b;    fixed-address 10.10.10.4; }
    host storage-2        { hardware ethernet ff:ca:ff:26:30:4b;    fixed-address 10.10.10.5;    default-lease-time    7200; }
}


In the above example, host storage-1 will have 'ddns-updates off' and 'option log-servers 10.10.10.1'
and a lease time of 3600 when allocated from the 10.10.10.0 subnet.

Host storage-2 will have 'ddns-updates off' and 'option log-servers 10.10.10.1' and a lease time of 7200;

What problem are you trying to solve?

Bill


On 9/22/2017 9:16 AM, Jérôme BECOT wrote:
Hello everyone,

I'm wondering about the difference between declaring hosts at the global level and in their respective subnets. It looks like the same to me but I may miss something about it. They would inherit the subnet parameters the same way, wouldn't it ?

subnet 10.10.10.0/24 {
  option X value;
  host zero { .. }
}

group "site-A hosts" {
  host one { 10.10.10.1; }
}

....

Also, what happen if I declare a group of subnets and a separate group of hosts outside, like :

group "site-B subnets" {
  option A value1;
  subnet 10.0.0.0/8{ ... }
  subnet 172.16.0.0./16 { ... }
}

group "site-B hosts" {
  host zero { fixed-address: 10.0.0.1; }
}

Is host 0 receiving the option A value as well ?

Thanks

JEROME BECOT
Ingénieur Système et Réseau
DSIRN
Bureau n°4.29
 
Institut national des langues et civilisations orientales
65 rue des Grands Moulins
Paris 75013, France

01 81 70 10 78
jerome.becot@inalco.fr www.inalco.fr


_______________________________________________
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: Host Declaration

Jérôme BECOT
I'd like to know if I declare the host group outside the subnet it would be the same as declaring them directly inside the subnet block. Isc doesn't complain both ways.

If the client configuration would be the same, then what is the best way (best practice) to declare them (inside or outside the subnet) ?


I think you have already answered saying host statments are global, but please confirm.

Thank you

JEROME BECOT
Ingénieur Système et Réseau
DSIRN
Bureau n°4.29
 
Institut national des langues et civilisations orientales
65 rue des Grands Moulins
Paris 75013, France

01 81 70 10 78
jerome.becot@inalco.fr
www.inalco.fr



De: "Bill Shirley" <[hidden email]>
À: "Users of ISC DHCP" <[hidden email]>
Envoyé: Samedi 23 Septembre 2017 06:39:34
Objet: Re: Host Declaration

host statements are global.

Example:
subnet 10.10.10.0 netmask 255.255.255.0 {
    ddns-updates          on;
    default-lease-time    3600;    # 1 hour
}

group "storage" {
    ddns-updates          off;
    option log-servers    10.10.10.1;
    host storage-1        { hardware ethernet ff:ca:ff:26:30:4b;    fixed-address 10.10.10.4; }
    host storage-2        { hardware ethernet ff:ca:ff:26:30:4b;    fixed-address 10.10.10.5;    default-lease-time    7200; }
}


In the above example, host storage-1 will have 'ddns-updates off' and 'option log-servers 10.10.10.1'
and a lease time of 3600 when allocated from the 10.10.10.0 subnet.

Host storage-2 will have 'ddns-updates off' and 'option log-servers 10.10.10.1' and a lease time of 7200;

What problem are you trying to solve?

Bill


On 9/22/2017 9:16 AM, Jérôme BECOT wrote:
Hello everyone,

I'm wondering about the difference between declaring hosts at the global level and in their respective subnets. It looks like the same to me but I may miss something about it. They would inherit the subnet parameters the same way, wouldn't it ?

subnet 10.10.10.0/24 {
  option X value;
  host zero { .. }
}

group "site-A hosts" {
  host one { 10.10.10.1; }
}

....

Also, what happen if I declare a group of subnets and a separate group of hosts outside, like :

group "site-B subnets" {
  option A value1;
  subnet 10.0.0.0/8{ ... }
  subnet 172.16.0.0./16 { ... }
}

group "site-B hosts" {
  host zero { fixed-address: 10.0.0.1; }
}

Is host 0 receiving the option A value as well ?

Thanks

JEROME BECOT
Ingénieur Système et Réseau
DSIRN
Bureau n°4.29
 
Institut national des langues et civilisations orientales
65 rue des Grands Moulins
Paris 75013, France

01 81 70 10 78
jerome.becot@inalco.fr www.inalco.fr


_______________________________________________
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: Host Declaration

Simon Hobson
Jérôme BECOT <[hidden email]> wrote:

> I'd like to know if I declare the host group outside the subnet it would be the same as declaring them directly inside the subnet block. Isc doesn't complain both ways.
>
> If the client configuration would be the same, then what is the best way (best practice) to declare them (inside or outside the subnet) ?

As I wrote previously, they are global in scope and you should not declare them inside a subnet unless you really understand the ramifications of some weird option inheritance issues. I don't recall anyone actually coming up with a use for that inheritance.

> I think you have already answered saying host statments are global, but please confirm.

Yes, they are global in scope regardless of where defined.
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users