classing gateway

marco perugini m.perugini at 4it.it
Thu Dec 16 13:36:05 UTC 2010


hi simon, thanks for your reply!
here's a more detailed description:
my dhcp server [which is 192.168.0.110] can receive DHCPDISCOVER from 
two different gateways [192.168.98.101 and 192.168.2.101]. i've some 
entire subnets to assign to 98.101's requests and other entire subnets 
to assign to 2.101's requests. so the only feature i'm trying to achieve 
is to differentiate who's asking me for an addr.
i thought something like that:

shared-network "98.101" {
         allow unknown-clients;
         deny duplicates;

# gw1 subnet
         subnet 192.168.98.0 netmask 255.255.255.0 {
         }
# my subnet
         subnet 192.168.0.0 netmask 255.255.255.0 {
         }
# to assign subnet
         subnet 178.45.23.0 netmask 255.255.255.0 {
                 option subnet-mask 255.255.255.255;
                 option broadcast-address 178.45.23.255;
                 option routers 178.45.23.1;
                 range 178.45.23.2 178.45.23.254;
         }
}
shared-network "2.101" {
         allow unknown-clients;
         deny duplicates;

# gw1 subnet
         subnet 192.168.2.0 netmask 255.255.255.0 {
         }
# my subnet
         subnet 192.168.0.0 netmask 255.255.255.0 {
         }
# to assign subnet
         subnet 178.48.11.0 netmask 255.255.255.0 {
                 option subnet-mask 255.255.255.255;
                 option broadcast-address 178.48.11.255;
                 option routers 178.48.11.1;
                 range 178.48.11.2 178.48.11.254;
         }
}



Il 16/12/2010 13:39, Simon Hobson ha scritto:
> marco perugini wrote:
>
>> i've my pool [10.0.0.0/24] and there are two different gw that forward
>> dhcpdiscover to my server:
>> DHCPDISCOVER from XX:XX:XX:XX:XX:XX: via 192.168.2.101
>> DHCPDISCOVER from XX:XX:XX:XX:XX:XY: via 192.168.98.201
>> so i want to split my pool to assign range 10.0.0.1 - 10.0.0.127 to
>> 192.168.2.101's requests and the other half to 192.168.98.201's; how can
>> i class the gateways in dhcpd.conf? does anyone know what i have to 
>> match?
>
> What are you trying to achieve ? What is your network topology ?
>
> Neither of those IPs is a valid address in the 10.0.0.0/24 subnet, so 
> nethier is actually valid as a gateway in 10.0.0.0/14, 10.0.0.0/25, or 
> 10.0.0.128/25.
>
> But if you mean you have two gateways, each of which serves a separate 
> network, and :
>
> 192.168.2.w/x is to be a shared network with 10.0.0.0/25
> and
> 192.168.98.y/z is to be a shared network with 10.0.0.128/25
>
> then all you need to do is declare the shared networks properly and 
> the rest is automagic.
>
> So why the shared networks ?
>
>
> Just to be sure we understand each other. A shared network is where 
> one collision domain (a physical network where devices can talk 
> directly to each other without a router) has more than one IP subnet 
> assigned on it.
>
> The config option for this is shared-network and is used like this :
>
> shared-network "x" {
>   ... <shared-network specific options>
>   subnet 192.168.2.0 ... {
>     ... <subnet specific options>
>   }
>   subnet 10.0.0.0 subnet mask 255.255.255.128 {
>     ...
>   }
> }
>
> Also note that you cannot use 10.0.0.1 to 10.0.0.127 in a range in a 
> /25 subnet. .127 is the broadcast address and so is not usable, and 
> you MUST have a router in the subnet so that will require an IP address.
> So you might put the router on 10.0.0.1 and use 10.0.0.2 to 10.0.0.126 
> for your pool.
>




More information about the dhcp-users mailing list