[En-Nut-Discussion] DHCP on multiple interfaces?

Harald Kipp harald.kipp at egnite.de
Fri Dec 11 15:15:59 CET 2009


Hi Ole,

Ole Reinhardt wrote:

> On linux a packet to 255.255.255.255 won't be routed by default. So a
> DHCP request is always assigned to one interface. 

Can you please explain. What means "won't be routed by default"? What
happens to the datagram if it is not routed? Is it discarded?

This was problem #1 and looks still unsolved to me.

In case the limited broadcast is routed to all interfaces, as RFC 919
demands, then problem #1 is solved. In that case we have problem #2:


> Will mean: DHCP client
> sends it broadcast only to the interface which shall be configured.

DHCP is UDP. The client has no other chance then sending the discovery
to 255.255.255.255, because the interfaces do not have any IP address at
that time.


> Everything else does not make much sense, right? The DHCP offer also
> only contains the answer for the one interface the request was send
> over. Last but not least the dhcp offer is based on the mac address of
> the used interface (where I have to admit that I don't know if the DHCP
> request contains an own copy of the mac address or if the server get's
> the info from the IP header of the packet.)

I assume you meant the Ethernet header, not the IP header. Note, that
DHCP isn't limited to Ethernet and typically an UDP client (like DHCP)
doesn't see the headers of underlying layers.

Let's build up a scenario:
Ethernut with 2 network interfaces A and B, each one connected to a
dedicated pysical network, each with a dedicated DHCP server. Interface
A with MAC address A is connected to network 192.168.0.0. Interface B
with MAC address B is connected to network 192.168.1.0.

1. Ethernut boots and activates both interfaces.
2. DHCP for interface A starts.
3. DHCP creates a discovery telegram for IP 255.255.255.255, containing
MAC address A in chaddr.
4. The datagram is passed to IP and sent out to interface A and interface B.
5. DHCP on network A offers 192.168.0.111.
6. DHCP on network B offers 192.168.0.222.
7. Both offers arrive at the Ethernut DHCP client, still containing MAC
address A in chaddr. We have two valid offers, but two different IPs.
8. The same happens again when sending out a discovery via interface B.


>> RFC 2131 specifies
>>
>> "3.6 Use of DHCP in clients with multiple interfaces
>>
>> A client with multiple network interfaces must use DHCP through each
>> interface independently to obtain configuration information parameters
>> for those separate interfaces."
> 
> That's exactly the behaviour I described above, isn't it?

Well, I'd say that this is exactly the behavior of almost everything,
because it doesn't deal with the details. ;-)


Harald



More information about the En-Nut-Discussion mailing list