DHCP and multiple scopes on a single server

Discussion in 'Networking' started by racolvin, Nov 10, 2005.

  1. racolvin

    racolvin Golden Member

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    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)
     
  2. Loading...


  3. spidey07

    spidey07 No Lifer

    Joined:
    Aug 4, 2000
    Messages:
    65,481
    Likes Received:
    2
    the router or DHCP relay agent will insert a field in the DHCP request packet indicating what ip subnet it's coming from.
     
  4. racolvin

    racolvin Golden Member

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    sweet :) thanx :)
     
  5. spidey07

    spidey07 No Lifer

    Joined:
    Aug 4, 2000
    Messages:
    65,481
    Likes Received:
    2
    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.
     
  6. nweaver

    nweaver Diamond Member

    Joined:
    Jan 21, 2001
    Messages:
    6,813
    Likes Received:
    0
  7. racolvin

    racolvin Golden Member

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    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 :)
     
  8. spidey07

    spidey07 No Lifer

    Joined:
    Aug 4, 2000
    Messages:
    65,481
    Likes Received:
    2
    Well why don't you share then?
     
  9. racolvin

    racolvin Golden Member

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    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."
     
  10. Smilin

    Smilin Diamond Member

    Joined:
    Mar 4, 2002
    Messages:
    7,357
    Likes Received:
    0
    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.