One subnet, two pools, one with a default gateway, the other without

Ugo Bellavance ugob at lubik.ca
Mon Aug 12 18:02:47 UTC 2013


Le 2013-08-12 13:12, Steven Carr a écrit :
> On 12 August 2013 16:29, Ugo Bellavance <ugob at lubik.ca> wrote:
>> Using that configuration, all clients get the subnet's config (so even the
>> ones I want to have no default gateway get one).  If I remove the subnet's
>> config, the "Reservations" hosts don't get a default gateway while they
>> should.
>
> The DHCP config uses inheritance for the various levels e.g. pool from
> subnet, subnet from global. Host objects inherit from global and the
> subnet that they are in (and as was recently discussed in another
> thread it is bad practice to include host declarations inside the
> subnet declaration as they are globally defined).
>
> So in order to achieve what you want you need to remove the routers
> option from the subnet declaration, add the routers option to the pool
> declaration that needs a router and then also add the routers option
> to each host declaration.

Great, thanks to your very quick answer.

I thought it would be to make a group out of it to make it easier to manage:

group {
         option routers 192.168.x.1;
         host HOST1 { hardware ethernet 00:50:56:94:3C:6F; fixed-address 
192.168.x.152; }
         host HOST2 { hardware ethernet 00:0f:fe:8a:5a:cf; fixed-address 
192.168.x.151; }
         }

My tests tell me that it works, does it make sense?

Thanks,

Ugo



More information about the dhcp-users mailing list