PDA

View Full Version : DHCP Relay/Helper



Scott A. Campbell
04-Sep-2012, 03:59
Can anyone please confirm something about DHCP Relay?

Does the DHCP server have to be on a subnet that is attached to the
DHCP Reay?

So if I have a network like this:

Network A
O
| 192.168.0.x/24
|
|
O Router A - DHCP Relay
|
| 192.168.1.x/24
|
|
O Router B
|
|
| 192.168.2.x/24
O
Network B w/ DHCP Server

Client on Network A issues a DHCP request. Router A DHCP relay points
to the IP address of a server in network B - will this fail?

I've read a couple of articles implying it will.

Cheers,
Scott

Shaun Pond
04-Sep-2012, 07:19
Scott,

> will this fail?

yes - DHCP requests are broadcasts, and a DHCP helper takes the
broadcast, and converts it to a unicast packet destined for the helper
address. Since broadcasts don't cross routers (imagine the possibility
for feedback loops!) the help must be on the same segment

--

Shaun Pond

Massimo Rosen
04-Sep-2012, 08:49
On 04.09.2012 04:59, Scott A. Campbell wrote:
> Can anyone please confirm something about DHCP Relay?
>
> Does the DHCP server have to be on a subnet that is attached to the
> DHCP Reay?
>
> So if I have a network like this:
>
> Network A
> O
> | 192.168.0.x/24
> |
> |
> O Router A - DHCP Relay
> |
> | 192.168.1.x/24
> |
> |
> O Router B
> |
> |
> | 192.168.2.x/24
> O
> Network B w/ DHCP Server
>
> Client on Network A issues a DHCP request. Router A DHCP relay points
> to the IP address of a server in network B - will this fail?

No. The DHCP Relay must be connected to the same network as the client.
That's the only restriction.

> I've read a couple of articles implying it will.

Example?

CU,
--
Massimo Rosen
Novell Knowledge Partner
No emails please!
http://www.cfc-it.de

Massimo Rosen
04-Sep-2012, 08:52
On 04.09.2012 08:19, Shaun Pond wrote:
> Scott,
>
>> will this fail?
>
> yes - DHCP requests are broadcasts, and a DHCP helper takes the
> broadcast, and converts it to a unicast packet

So why would it fail when - as your perfectly correct explanation says -
the relay turns it into an unicast? ;)

> destined for the helper
> address. Since broadcasts don't cross routers (imagine the possibility
> for feedback loops!) the help must be on the same segment

Correct, but that wasn't the question. The helper must be on the same
subnet as the client, certainly. But the DHCP *server* can be on a
remote subnet from the dhcp helper (or relay).

CU,
--
Massimo Rosen
Novell Knowledge Partner
No emails please!
http://www.cfc-it.de

Shaun Pond
04-Sep-2012, 09:23
Massimo,

oops - early morning (2 hours sleep isn't enough, I've just found :))
thanks for catching that

--

Shaun Pond

Scott A. Campbell
04-Sep-2012, 23:52
Massimo Rosen wrote:

> No. The DHCP Relay must be connected to the same network as the
> client. That's the only restriction.

Fantastic!

> > I've read a couple of articles implying it will.
> Example?

http://www.networkworld.com/community/node/26204

"Relay agents receive Dynamic Host Configuration Protocol (DHCP)
messages and then generate a new DHCP message to send out on another
interface."

There was another article which had a similar comment, but I can't find
it now and I wasn't too sure about whether unicast could travel subnets.

That combined with abject failure when configuring something that looks
pretty simple made me wonder if I was expecting too much :-)

Thanks for the reply Massimo :)

Scott A. Campbell
04-Sep-2012, 23:53
Shaun Pond wrote:

> oops - early morning (2 hours sleep isn't enough, I've just found :))
> thanks for catching that

Thanks for the reply anyway, I think I can let you away with the lack
of sleep... :-)

Anders Gustafsson
05-Sep-2012, 05:59
Scott A. Campbell,
> "Relay agents receive Dynamic Host Configuration Protocol (DHCP)
> messages and then generate a new DHCP message to send out on another
> interface."

But that is exactly what Massimo says. Ie it must be able to listen on
the same segment as the client. It can then forward the packet on any
other interface.

--
Anders Gustafsson (NKP)
The Aaland Islands (N60 E20)

Have an idea for a product enhancement? Please visit:
http://www.novell.com/rms

Massimo Rosen
05-Sep-2012, 08:15
On 05.09.2012 06:59, Anders Gustafsson wrote:
> Scott A. Campbell,
>> "Relay agents receive Dynamic Host Configuration Protocol (DHCP)
>> messages and then generate a new DHCP message to send out on another
>> interface."
>
> But that is exactly what Massimo says. Ie it must be able to listen on
> the same segment as the client. It can then forward the packet on any
> other interface.
>

Well, not quite exactly what was said. Yes, it forwards the request, but
*not* as Broadcast, which the original request was, but instead it sends
a regular UDP packet with the proper target IP. That's because (and why)
a DHCP helper needs to know the IP address of the DHCP server. If it
would just forward/recreate another broadcast, *then* it would only work
when the server too is directly connected to it. And in that case, the
DHCP helper wouldn't need to know the IP of the server.

CU,
--
Massimo Rosen
Novell Knowledge Partner
No emails please!
http://www.cfc-it.de

Anders Gustafsson
05-Sep-2012, 09:58
Massimo Rosen,
> Yes, it forwards the request, but
> *not* as Broadcast, which the original request was, but instead it sends
> a regular UDP packet with the proper target IP. That's because (and why)
> a DHCP helper needs to know the IP address of the DHCP server.

Yes. In that context, the sentence:

"Relay agents receive Dynamic Host Configuration Protocol (DHCP)
messages and then generate a new DHCP message to send out on another
interface."

Is wrong or at least incomplete as it leads the reader to think that it is
"just" a new DHCP message.

--
Anders Gustafsson (NKP)
The Aaland Islands (N60 E20)

Have an idea for a product enhancement? Please visit:
http://www.novell.com/rms