DHCP with multiple subnets

Is it possible to set up a DHCP server in a network and have it be able to differentiate between different subnets?  These subnets will not be separated by router or anything, they are all on the same switch.  When I plug in a new device how will the DHCP server know which subnet I want it on?
fallriverelectricAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
vivigattConnect With a Mentor Commented:
OK, then you have:
- 2 subnets
- a routing device (your layer 3 switch)
- a working route between your two subnets.

So what you need is, on the routing device, to add a DHCP relay (ip-helper in Cisco wording, that HP ProCurve uses too). This has to be added for the subnet that does NOT have a DHCP server so that DHCP packets sent to broadcast address on that subnet are detected and forwarded to the DHCP server on the other subnet.
When you have set your DHCP relay agent, create a scope on the DHCP server within the "remote" subnet, and voilà !
This works because when forwarding the broadcast packets from remote subnet, the DHCP relay agent fills the "relay ip address" (GIADDRR, aka Gateway IP Address) with its own IP address (on the remote subnet side).  The DHCP server then know it has to assign an IP address in the scope corresponding to GIADDR.

Configuring the dhcp relay on the routing device depends on the routing device. Tell us what switch you have, we should be able to find the commands for enabling the dhcp relay on it.

You will find some details in these links:
http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#DHCP_relaying
http://technet.microsoft.com/en-us/library/cc758865%28v=ws.10%29.aspx
http://technet.microsoft.com/en-us/library/cc771390.aspx
0
 
piattndCommented:
You would need something like an IP-Helper as described here:

http://cisconet.com/tcpip/dhcp/107-how-to-use-ip-helper-address-to-connect-remote-dhcp-server.html

This allows computers on a different subnet than the DHCP server to receive an address.

You have to have a layer 3 device somewhere to route data in between the subnets though.
0
 
vivigattCommented:
There is no possibility to differentiate between subnets if the subnets are not routed... an IP-Helper will not help, since this is used to forward DHCPDISCOVER packets (sent to local broadcast) to a DHCP server on another subnet, and it involves routing: a DHCP relay can only be set on a router (or layer-3 switch)
You have to understand that, before a DHCP client gets a full IP config via DHCP, it has no IP address. So it sends a request to "broadcast" address to get one IP address. The DHCP server assigns an IP address in the range that it is configured to use and, without DHCP-Relay; this range must be in the subnet of the IP address used by the DHCP server network card.
A DHCP server would NOT know which subnet to use when it receive a "DHCP Request" packet from a client.

One thing you may explore would be to use DHCP reservations (assign a unique IP address based on the client's MAC address), but this would require one entry per client node (and I am not sure it will work with different subnets/scopes, but I can very easily validate that on a Windows DHCP server if you want me to explore this lead)
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
fallriverelectricAuthor Commented:
The subnets are separated physically, and are connected via a direct fibre channel.  The switch port that connects the remote office (192.168.113.x) to the headquarters office (192.168.0.x) is specifically allowing the 113 vlan.  Would that make a difference?  Give the DHCP server some indication of where it's being requested from?
0
 
piattndCommented:
As vivigatt said (that I did not elaborate), you likely have a layer 3 device (layer 3 switch or router) in place somewhere, or the subnets couldn't talk to anyone outside of themselves, including a single DHCP server.

If you don't have a layer 3 device, you cannot accomplish what you're talking about.
0
 
fallriverelectricAuthor Commented:
The switch I mentioned is layer 3, and the subnets are currently talking to each other.  I just don't know how to introduce DHCP to my current scenario.
0
 
fallriverelectricAuthor Commented:
Thanks, I will give that a try.  It's a stack of Cisco 3750-E switches.
0
 
vivigattCommented:
The commands should be something such as (when in config mode):
switchname#interface vlan 113
switchname#ip helper-address 192.168.0.10

(assuming your DHCP server IP addres is 192.168.0.10)
0
All Courses

From novice to tech pro — start learning today.