host statement scope rules (ISC DHCP 3.0.5b1)

kalyanasundaram S s.kalyanasundaram at inbox.com
Wed Aug 2 09:29:06 UTC 2006


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..)

case1 :

ddns-update-style interim;
option domain-name-servers 121.99.155.94;
authoritative;
ddns-updates on;
#############update-static-leases on;
default-lease-time 500;
max-lease-time 1000;
key mine {
  algorithm hmac-md5;
  secret PASSWORD;       
}
zone example.com. {
	primary 121.99.155.94;
	key mine;
}
zone test.com. {
	primary 121.99.155.94;
	key mine;
}

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)

good..

case 2:

ddns-update-style interim;
option domain-name-servers 121.99.155.94;
authoritative;
ddns-updates on;
update-static-leases on;
default-lease-time 500;
max-lease-time 1000;
key mine {
  algorithm hmac-md5;
  secret PASSWORD;       
}
zone example.com. {
	primary 121.99.155.94;
	key mine;
}
zone test.com. {
	primary 121.99.155.94;
	key mine;
}

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";
}

IPADDR=121.99.155.16
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

This is also fine .. fixed-address is assigned and first subnet details are sent to host..


case 3:
ddns-update-style interim;
option domain-name-servers 121.99.155.94;
authoritative;
ddns-updates on;
update-static-leases on;
default-lease-time 500;
max-lease-time 1000;
key mine {
  algorithm hmac-md5;
  secret 2old67/6Lf2bKgaJJ4Lvpg==;       
}
zone example.com. {
	primary 121.99.155.94;
	key mine;
}
zone test.com. {
	primary 121.99.155.94;
	key mine;
}

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";

}

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";
}

host test {
    hardware ethernet 00:03:47:1f:3d:e2;
		ddns-hostname "m3";
####		fixed-address 121.99.155.16;
}	

IPADDR=121.99.154.19
NETMASK=255.255.254.0
NETWORK=121.99.154.0
BROADCAST=121.99.155.255
 
DOMAIN='test.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=77
RENEWALTIME=38
REBINDTIME=67
INTERFACE='eth0'
CLASSID='Linux 2.6.5-7.179-default i686'
CLIENTID=00:03:47:1F:3D:E2

This is also fine. This host is out of any subnet.So
1. IP address configuration scope: got it from second subnet
2. IP allocation configaration scope: as it is not declared inside of any subnet it has to decide which subnet it should go for It take the option from where it got the IP address(so the second..)

This is also fine...

 
case 4:
ddns-update-style interim;
option domain-name-servers 121.99.155.94;
authoritative;
ddns-updates on;
update-static-leases on;
default-lease-time 500;
max-lease-time 1000;
key mine {
  algorithm hmac-md5;
  secret 2old67/6Lf2bKgaJJ4Lvpg==;       
}
zone example.com. {
	primary 121.99.155.94;
	key mine;
}
zone test.com. {
	primary 121.99.155.94;
	key mine;
}

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";

}

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";
}

host test {
    hardware ethernet 00:03:47:1f:3d:e2;
    ddns-hostname "m3";
    fixed-address 121.99.155.16;
}	


IPADDR=121.99.155.16
NETMASK=255.255.254.0
NETWORK=121.99.154.0
BROADCAST=121.99.155.255
 
DOMAIN='test.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=77
RENEWALTIME=38
REBINDTIME=67
INTERFACE='eth0'
CLASSID='Linux 2.6.5-7.179-default i686'
CLIENTID=00:03:47:1F:3D:E2  

So here i expeted it should get details from the first subnet. BUt it is not?..
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 always this IP allocation configuration is different?..

it is sending the IP 121.99.155.16 and so it could parse the subnet 121.99.155.0 and send the "example.com" and the lease time "100".. but it is not?.

what is missing here ?.. is it the correct behavior of dhcp or am i missing out of something?.
Sorry if i am wrong somewhere and for wasting your time...

thanks,
  -"kalyan"



More information about the dhcp-users mailing list