DCHP host entry with 2 IP's ?

Chris Buxton chris.p.buxton at gmail.com
Fri Aug 5 19:25:41 UTC 2011


On Aug 5, 2011, at 12:15 PM, Barry Stear wrote:

> subnet  x.y.10.10   netmask 255.255.255.0 {
> option subnet-mask 255.255.255.0;
> option routers x.y.10.1;
> max-lease-time 600;
> default-lease-time 600;
> }
> 
> subnet x.y.20.0 netmask 255.255.255.0 {
> option subnet-mask 255.255.255.0;
> option routers x.y.20.1;
> max-lease-time 600;
> default-lease-time 600;
> }
> 
> host  myhost1     { hardware ethernet 00:1C:23:EE:C1:8E;  fixed-address x.y.10.10,  x.y.20.10;}
> 
> 
> How can I ensure that requests from subnet 10 get the x.y.10.10  address, and requests from subnet 20 get the x.y.20.10  address?
> 
> Thanks
> Paul 
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
> 
> If you want to assign it a fixed address in each subnet then you need to specify the host within the subnet not outside it. If you don't care what IP address it gets take out the fixed-address and just have
>  
> host  myhost1     { hardware ethernet 00:1C:23:EE:C1:8E;}
>  
> The server should then assign it an ip address based on which subnet it is in.
>  
> It would also help to see the rest of your configuration since I do not see you specifying a range for the ip addresses you want to Lease out or a pool statement.

No, no, and no. No range or pool declaration is necessary to serve hosts that have fixed-address statements.

It should work as posted and it should be automatic.

In the absence of shared network statements, the fixed-address value used will be the one in the same network as the DHCP relay, or if local, the same network as the DHCP server itself.

From the man-page:

> When dhcpd tries to find a host declaration for a client, it first looks for a host declaration which has a fixed-address declaration that lists an IP address that is valid for the subnet or shared network on which the client is booting. If it doesn't find any such entry, it tries to find an entry which has no fixed-address declaration.  

host declarations are always global, even if written inside some other scope such as a subnet or pool. But option inheritance works as written. This can make it very confusing if you write your host declarations anywhere other than the global scope.

Chris Buxton
BlueCat Networks


More information about the dhcp-users mailing list