• Hey there Guest! This holiday season you have a chance to win some cool AnandTech swag! Check out “The Holiday Hotlist” giveaway, which you can find here.

DHCP and multiple scopes on a single server

racolvin

Golden Member
Jul 26, 2004
1,257
0
0
#1
Example: Central DHCP server running multiple scopes (subnets) for different LAN segments. When a request from a user PC on a particular segment, how does the DHCP server know from which scope to hand out an address? How is the DHCP server informed or whatever which LAN segment the request is coming from?

(of course the routers would be setup to forward DHCP requests, etc ... I'm just wondering by what mechanism the DHCP server is told which scope to use to assign the address)
 
Aug 4, 2000
65,481
0
76
#2
the router or DHCP relay agent will insert a field in the DHCP request packet indicating what ip subnet it's coming from.
 
Aug 4, 2000
65,481
0
76
#4
sure thing. That's the key function of a DHCP relay agent.

And any router will have DHCP relay runctionality.

Most places have one or two (for redundanc) DHCP servers and they can serve 100s or 1000s of IP subnets.
 

racolvin

Golden Member
Jul 26, 2004
1,257
0
0
#6
oh I've know how to enable it on the router for years ... I just never understood WHY it worked until I asked here and then ran with that info to Google for the rest of thes story :)

Thanx again :)
 

racolvin

Golden Member
Jul 26, 2004
1,257
0
0
#8
A number of DHCP questions are answered at this site but here's the one I specifically looked for: DHCP in subnetted environment

"DHCP client messages are sent to off-net servers by DHCP relay agents, which are often a part of an IP router. The DHCP relay agent records the subnet from which the message was received in the DHCP message header for use by the DHCP server."
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
#9
More technically when you do a discover packet (first packet from client) it sends TO broadcast with no return address.

If a DHCP server sees this broadcast it will send an offer for the subnet that the server is on.

If there is a relay agent, it will see this broadcast and wait for a moment. If it hears no offer it will send a unicast discover directly to the dhcp server with it's own IP as the source address.

When the reply is sent back it then broadcasts that reply on the original network.

So basically the subnet is determined by the source address of the discover and if there is no source address it will default to it's own subnet.

That covers the Discover & offer packets. Request and Ack packets that follow are the same in all scenarios.
 

Similar threads


ASK THE COMMUNITY