DCHP host entry with 2 IP's ?

Chris Buxton chris.p.buxton at gmail.com
Fri Aug 5 20:12:55 UTC 2011


On Aug 5, 2011, at 12:55 PM, Paul Reilly wrote:

> Thanks for the replies guys,
> 
>> No, no, and no. No range or pool declaration is necessary to serve hosts that have fixed-address statements.
> 
> 
> Yeah, I want fixed static addresses - so I have not specified pool or ranges.
>  
> 
>> It should work as posted and it should be automatic.
> 
> 
> That's what I thought.

Is it actually not working? If so, try separating the fixed addresses into multiple declarations:

host myhost1 {
    hardware ethernet 00:1C:23:EE:C1:8E;
    fixed-address x.y.10.10;
}
host myhost1 {
    hardware ethernet 00:1C:23:EE:C1:8E;
    fixed-address x.y.20.10;
}

> I'm not clear on how the DHCP server knows which subnet to use though?  Does it use the the router address of the subnet (where ip helper address is configured)  to determine which subnet the request is coming from?  

Yes, for remote subnets. For local subnets, it uses its own network address for the comparison.

> All requests come in on eth0  but some some "via x.y.10.1"  which is the router address in subnet 10.
> One issue might be that the DHCP server is in subnet x.y.20.0 and requests for this do not come from a router address as it's on the same local subnet.

No, that's not a problem. Local clients will get a lease (fixed or dynamic) from the local network; remote clients will get one from the network local to the relay (the 'via ...' address).

>> 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.
> 
> So putting the host within the subnet declarations won't make any difference then?

Not any good difference.

> Regarding the shared-network configuration, I think I might give that a go.
> Would this be the right config?
> 
> shared-network  MYNETWORK   {
> 
>       subnet x.y.10.0 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;
> 
>       host myhost1  { hardware ethernet 00:1C:23:EE:C1:8E;  fixed-address x.y.10.10; }
>                       } 
> 
> 
>       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.20.10; }
>                       } 
> }

Not unless both of those subnets are in the same broadcast domain (the same physical network or the same vlan). Shared networks are something to avoid if at all possible.

Chris Buxton
BlueCat Networks


More information about the dhcp-users mailing list