DHCP Relay & Option 82

Simon Hobson dhcp1 at thehobsons.co.uk
Wed Aug 25 15:29:17 UTC 2010

Bruce Hudson wrote:

>     Assuming I understand what you are trying to do, you need to enclose
>the two IP sunets in one "shared-network" stanza. That tells the server
>that it is okay to use the addresses to satisfy requests
>from a relay.
>	shared-network "Tower1" {
>	   subnet netmask {
>	        ...
>	    }
>	    subnet {
>	    }
>	}
>This will work for the example cited. If your network is still flat, you
>really want a single "shared-subnet" for the entire campus that surrounds
>all of your subnet stanzas.

But I think what he is actually trying to do is convert FROM a flat 
network TO a routed network.

So to answer the original question :

Each separate network MUST have a distinct and non-overlapping IP subnet.
dhcpd MUST be configured to know about all these subnets, and if it 
is to be able to issue a lease to clients located there, then the 
config must also allocate a range of addresses and/or some host 
statements with fixed-address declarations.

Note that shared-network is generally NOT required, and if misused 
will cause dhcp to "not work properly".

Note also that you do NOT have to use option 82 for this to work, you 
only have to configure a relay agent in each network that doesn't 
connect directly to the server AND correctly configure the server.

Eg, consider this minimal routed network :

dhcp -- -- router/agent -- -- client

A DHCP broadcast by the client will be detected by the agent. The 
agent will insert it's local address in the subnet into 
the Gateway-address field of the packet and forward the packet to the 
server. The server will spot the presence of the gateway-address and 
determine from it that the client is in the network - and 
allocate an address that is appropriate.
The server will then reply to the relay agent, which in turn will 
broadcast the reply to the client.

This all happens automagically.

The (somewhat abbreviated) dhcp config would be along the lines of :

<global options>
subnet ... {
   <subnet options>
   range ;
subnet ... {
   <subnet options>
   range ;

Note that teh two subnets are **NOT** a shared network.

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the dhcp-users mailing list