one DHCPD server multi subnets

tangaish.en tangaishien at gmail.com
Thu Nov 1 08:38:20 UTC 2007


hi, dhcp-users

so I modified my conf file as below:

subnet 172.16.1.0 netmask 255.255.255.0 {
}
subnet 172.16.5.0 netmask 255.255.255.0 {
pool {
        range 172.16.5.210 172.16.5.220;
        option routers                  172.16.5.254;
        option subnet-mask              255.255.255.0;
        }
        }

subnet 172.16.4.0 netmask 255.255.255.0 {
pool {
        range 172.16.4.210 172.16.4.220;
        option routers                  172.16.4.254;
        option subnet-mask              255.255.255.0;
        }
        }

dhcpd service restart without problem, in fact I don't need pool 
function too, I deleted pool {} and conf look like this:

subnet 172.16.4.0 netmask 255.255.255.0 {
        range 172.16.4.210 172.16.4.220;
        option routers                  172.16.4.254;
        option subnet-mask              255.255.255.0;
        }

dhcpd restart ok, I believe the server should work for my network, I'll 
test it later. thanks.

and I think the reply should add in dhcpd document as a relay or remote 
dhcp section, it's helpful.



Simon Hobson wrote:
> tangaish.en wrote:
>
>> now my conf file look like this:
>>
>> ddns-update-style interim;
>> ignore client-updates;
>>
>> subnet 172.16.0.0 netmask 255.255.0.0 {
>>
>> # --- default gateway
>>
>>        option domain-name              "guest.XXX.com";
>>        option domain-name-servers      172.16.1.2,172.16.1.4;
>>
>>        option netbios-name-servers     172.16.1.4;
>>        default-lease-time 21600;
>>        max-lease-time 43200;
>>
>> pool {
>>        range 172.16.5.210 172.16.5.220;
>>        option routers                  172.16.5.1;         option 
>> subnet-mask              255.255.255.0;
>>        }
>>
>> pool {
>>        range 172.16.4.210 172.16.4.220;
>>        option routers                  172.16.4.1;         option 
>> subnet-mask              255.255.255.0;
>>        }
>> }
>>
>> I can't test it because of  the 3-layer switch  offer dhpc function 
>> and PCs need it every work day, I must wait weekend to try isc dhcp 
>> and switch relay.
>>
>> I think this  conf file don't work.
>
>
> Correct, it won't work. You need a subnet declaration for each subnet, 
> and inside that a pool declaration for the addresses in that subnet 
> which are to be dynamically assigned. Every subnet declaration must 
> match exactly (address & mask) the real subnets. Something like this, 
> note global options at the start which are outside the subnet 
> declaration.
>
> option domain-name              "guest.XXX.com";
> option domain-name-servers      172.16.1.2,172.16.1.4;
>
> option netbios-name-servers     172.16.1.4;
> default-lease-time 21600;
> max-lease-time 43200;
>
>
> subnet 172.16.1.0 netmask 255.255.255.0 {
>   option routers          172.16.1.1;
>   option subnet-mask      255.255.255.0;
>   pool {
>     range 172.16.1.210 172.16.1.220;
>   }
> }
>
> subnet 172.16.2.0 netmask 255.255.255.0 {
>   option routers          172.16.2.1;
>   option subnet-mask      255.255.255.0;
>   pool {
>     range 172.16.2.210 172.16.2.220;
>   }
> }
>
> ...
>
> subnet 172.16.5.0 netmask 255.255.255.0 {
>   option routers          172.16.5.1;
>   option subnet-mask      255.255.255.0;
>   pool {
>     range 172.16.5.210 172.16.5.220;
>   }
> }
>
>
>> I want to know dhcpd run with this conf file can do it or not? if yes 
>> I'm intersting in figure out how isc dhcpd know which dhcprequest is 
>> coming from that net, is there a relay address in dhcprequest package 
>> and dhcpd assign address base on that address?
>
>
> Once you configure DHCP to match teh subnets available, the server 
> automatically works out which subnet a client belongs to. For clients 
> on a local network, it is done simply by which physical interface the 
> request arrives on.
>
> For clients on remote subnets, the bootp-helper is the key - it 
> receives the broadcast from the client, fills in it's own address on 
> that network (in the GIAddr (Gateway Interface Address) field), and 
> then forwards it to the server. The server then uses the GIAddr to 
> figure out the correct subnet.
>
>
> So you as the admin need do nothing (apart from correctly defining the 
> subnets) to make this work - it's just happens automagically.
>
>



More information about the dhcp-users mailing list