Solved

DHCP with multiple subnets

Posted on 2013-11-13
8
409 Views
Last Modified: 2013-11-15
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?
0
Comment
Question by:fallriverelectric
  • 3
  • 3
  • 2
8 Comments
 
LVL 12

Expert Comment

by:piattnd
Comment Utility
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
 
LVL 16

Expert Comment

by:vivigatt
Comment Utility
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
 

Author Comment

by:fallriverelectric
Comment Utility
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
 
LVL 12

Expert Comment

by:piattnd
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:fallriverelectric
Comment Utility
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
 
LVL 16

Accepted Solution

by:
vivigatt earned 500 total points
Comment Utility
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
 

Author Comment

by:fallriverelectric
Comment Utility
Thanks, I will give that a try.  It's a stack of Cisco 3750-E switches.
0
 
LVL 16

Expert Comment

by:vivigatt
Comment Utility
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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Ever wondered why you had to use DHCP options (dhcp opt 60, 66 or 67) in order to use PXE? Well, you don't!
Messaging apps are amazing tools with the power to do a lot of good, but the truth is the process of collaborating with coworkers requires relationships established through meaningful communication - the kind of communication that only happens face-…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now