single dhcp server with multiple subnets

Glenn Satchell glenn.satchell at uniq.com.au
Sat Jul 26 04:05:30 UTC 2014


Hi Mike

You don't need to do anything special to detect the subnets. The way you
have it in your config file is correct. The dhcp-relay inserts the IP
address of the interface where the request came in (GADDR), and the server
then knows which subnet the request came from.

My guess is that one of your relay devices (likely the switches) is
putting the wrong info in the packet it forwards to the server.

To check this have a look at the syslog files (/var/log/messages is a
likely default place) and see what the relay device. It will be something
via something. Perhaps post the log lines here,

You could also run tcp dump, listening on udp ports 67 and 68 and see what
options are set in the dhcp packets.

Another possibility is that you have the different subnets all on the same
physical network. If  so, then this is a shared-network, and any IP from
the ranges would be ok. If so you need to wrap the subnet definitions in a
shared-network statement. See the dhcpd.conf man page for the details.

One other thing is that you also need to specify the correct IP on the
local subnet for the router. This will never work because the client on
10.1.7.x does not know how to get to 10.1.6.2:

subnet 10.1.7.0 netmask 255.255.255.0 {
  option routers 10.1.6.2;

Should be like this (or whatever the interface is on that subnet):
  option routers 10.1.7.2;

regards,
-glenn

On Sat, July 26, 2014 1:24 pm, Daniel Hoffmann wrote:
> Greetings, Mike
>
> You could use classes in order to mach the correct subnet to the
> requesting
> Client.
> The Client does not know it's subnet, until it got an IP address.
> For my own, i separate the classes depending on the relay address.
>
> Best regards,
> Daniel
>
> Gesendet mit AquaMail für Android
> http://www.aqua-mail.com
>
>
> Am 26. Juli 2014 00:17:49 schrieb "Senko, Mike" <Mike.Senko at seattle.gov>:
>
>> I've gone through the archives, but haven't found a solution to using a
>> single dhcp server
>> to service multiple subnets.
>>
>> The subnets are set up on a router (non-cisco) that uses dhcp-relay to
>> pass
>> dhcp requests
>> through the configured switch interfaces. The switches are layer 2 and
>> also
>> are configured
>> for dhcp relay.
>>
>> The dhcp request packets show up at the server.
>>
>> The dhcp server then assigns and address and sends it to the router's
>> address.
>>
>> The problem I've run into is the server is always sending the first dhcp
>> address in the first configured
>> subnet regardless of the subnet the request comes from.
>>
>> In other words, dhcp ip address assigned is always 10.1.6.200 even if
>> the
>> request comes from 10.1.8.0 subnet.
>>
>> If the dhcp request comes from the 10.1.6.0 subnet, all is fine.
>>
>> I think the problem is in the dhcp server configuration:
>>
>> option domain-name "TestLab.NSC";
>> default-lease-time 600;
>> max-lease-time 7200;
>> authoritative;
>> log-facility local7;
>>
>> subnet 10.1.6.0 netmask 255.255.255.0 {
>> option routers 10.1.6.2;
>> range 10.1.6.200 10.1.6.254;
>> option subnet-mask 255.255.255.0;
>> }
>>
>> subnet 10.1.7.0 netmask 255.255.255.0 {
>> option routers 10.1.6.2;
>> range 10.1.7.200 10.1.7.254;
>> option subnet-mask 255.255.255.0;
>> }
>>
>> subnet 10.1.8.0 netmask 255.255.255.0 {
>> option routers 10.1.6.2;
>> range 10.1.8.200 10.1.8.254;
>> option subnet-mask 255.255.255.0;
>> }
>>
>> subnet 10.1.9.0 netmask 255.255.255.0 {
>> option routers 10.1.6.2;
>> range 10.1.9.200 10.1.9.254;
>> option subnet-mask 255.255.255.0;
>> }
>>
>> subnet 10.1.5.0 netmask 255.255.255.0 {
>> option routers 10.1.6.2;
>> range 10.1.5.200 10.1.5.254;
>> option subnet-mask 255.255.255.0;
>> }
>>
>> This is the entire configuration, there must be something missing. I'm
>> not
>> using dns, just trying to get addresses assigned
>> to the right vlan/subnet. The server is attached to 10.1.6.0/24.
>>
>> Thanks, ms




More information about the dhcp-users mailing list