host statement scope rules (ISC DHCP 3.0.5b1)

Simon Hobson dhcp1 at thehobsons.co.uk
Wed Aug 2 14:51:19 UTC 2006


kalyanasundaram S wrote:

>It is better to see with some examble.
>I dont understand something here.
>(I have changed IP address so the subnet mask will be wrong..)

Unfortunately, your subnets as written here overlap, so it is 
impossible to see properly what is going on !

>subnet 121.99.155.0 netmask 255.255.255.0 {   ##first subnet
>subnet 121.99.154.0 netmask 255.255.254.0 { ##sescond subnet



>My servers is in 121.99.155.94
>client is in same subnet.. i have no router it is standalone setup 
>connected via switch )..

So your configuration is not valid for the network. Where is the 
121.99.154.0 subnet if it isn't connected locally and isn't connected 
via a router ?


So here we have confusion caused by an invalid config, it's no wonder 
you can't figure out what's happening !


Looking at your first case again :

>subnet 121.99.155.0 netmask 255.255.255.0 {   ##first subnet
>   range 121.99.155.20 121.99.155.35;
>	default-lease-time 50;
>	max-lease-time 100;
>	ddns-domainname "example.com";
>	option domain-name "example.com";
>     host test {
>               hardware ethernet 00:03:47:1f:3d:e2;
>	      ddns-hostname "m3";
>############  fixed-address 121.99.155.16;
>}
>
>}
>
>subnet 121.99.154.0 netmask 255.255.254.0 { ##sescond subnet
>	range 121.99.154.10 121.99.154.19;
>	default-lease-time 67;
>	max-lease-time 77;
>	ddns-domainname "test.com";
>	option domain-name "test.com";
>}
>
>from the client side:
>
>IPADDR=121.99.154.19
>NETMASK=255.255.254.0
>NETWORK=121.99.154.0
>BROADCAST=121.99.155.255
>
>DOMAIN='example.com'
>DNS=121.99.155.94
>DHCPSID=121.99.155.94
>DHCPGIADDR=0.0.0.0
>DHCPSIADDR=0.0.0.0
>DHCPCHADDR=00:03:47:1F:3D:E2
>DHCPSHADDR=00:11:25:57:59:30
>DHCPSNAME=''
>LEASETIME=100
>RENEWALTIME=50
>REBINDTIME=87
>INTERFACE='eth0'
>CLASSID='Linux 2.6.5-7.179-default i686'
>CLIENTID=00:03:47:1F:3D:E2
>
>So as what Ted Lemon was saying that..
>1. IP address configuration scope: based on this it got IP address 
>from the  outter subnet.(need not stick with where it is declared)
>2. IP allocation configaration scope: it got option domain and lease 
>info from the subnet where it is declared..
>
>(I also found that if i remove option domain-name "example.com" it 
>gets from other subnet like "test.com" so options are not overridden 
>if available)

Here is an example of why I think allowing such configs should be 
deprecated. it is just plain wrong IMHO.

You have a client which should have a domain name of "test.com" but 
it actually gets sent "example.com" - that may or may not be correct. 
However, you have not included the routers option which is required 
for virtually any operational network, and if it behaves the same 
then your client will get the WRONG ROUTER and so will NOT be able to 
participate in the network.

I feel sure that this is the likely cause of some "my client got the 
wrong options" messages on this list.


Since the client would normally inherit the correct options when it 
is allocated to a subnet, then that should be the way things work. If 
the administrator specifically wants to apply different values, then 
he can do so by adding options to the host statement itself (or an 
enclosing group {} ) which would have the effect some people 
apparently want (but haven't spoken up to say so) but in a manner 
that is immediately obvious from a perusal of the config.

Given the number of 'rtfm' questions/problems that already come up, I 
don't think it's going to be practical to adequately document the 
behaviour of hosts statements within subnet declarations in the man 
pages. Given the pitfalls, and the fact that there is a perfectly 
workable alternative for anyone that needs it, I suggest that the 
warning already there should stay and the 'feature' should be 
considered deprecated - it's the cleanest way to handle it.


Simon



More information about the dhcp-users mailing list