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

Bernd Walter enut at cicely.de
Sat Dec 12 03:15:35 CET 2009


On Sat, Dec 12, 2009 at 12:48:22AM +0100, Ulrich Prinz wrote:
> Hi!
> 
> Harald Kipp schrieb:
> > 
> > You are not able to broadcast to xxx.yyy.zzz.255, because you don't know
> > xxx.yyy.zzz. You do not even know the netmask.
> > 
> That's why often DHCP is not switched on by having no IP address 
> configured but by a separate switch. So you can add the configured 
> braodcast address or calculate it from Network/Netmask combination to 
> the request to get a DHCP for a special network. This makes sense for 
> networks where several nets are available over one cable.

If you need to configure for your network DHCP gets pretty much
useless.
you can still setup the remaining parameters, but there is not much
left.

> Simple background: You have a VOIP network and a PC network available 
> over one cable. Now you need to configure DHCP on the Phone to broadcast 
> its DHCP/BOOTP on the right one, while your PC attaches to the other.
> As nowadays it is more easy to configure MAC address ranges in your DHCP 
> server to sort out phones from PCs, this option has lost it's meaning.

Beside from fixed setting by MAC you can also group by MAC range and
system type.
Ethernut client for example identifies themself as being ethernut.
You can't do this with a cheap DSL router's DHCPd, but with such a beast
you will not run complex network setup anyway.

> And yes, like said above, DHCP has to be handled separately for each MAC 
> interface. Sending a broadcast to 255.255.255.255 is not the same on IP 
> or MAC layer. DHCP has no IP on top, but can deliver a wished IP 
> (fetched out of config or last-IP buffer in flash / EEPROM), through MAC 
> directly and only on the interface with that MAC. In this state the 
> interface is not up, so not reachable by IP layer.
> 
> On DHCP success ( requested IP was accepted or request returned with a 
> new leased IP) it configures the IP layer. Then the interface is up for IP.
> 
> ... And then we may have a 255.255.255.255 problem. I would not write a 
> software that sends broadcasts to all available networks, but if, then a 
> 255.255.255.255 target could be handled in two ways:
> Hard way: Broadcast that address on all interfaces available.
> Safer way: Translate that broadcast to each interfaces subnet.
> Both ways may have leaks, but anyway broadcasts are handled more or less 
> rigid by routers.

Sure, but this can't work for DHCP, because it's a chicken-egg problem.
DHCP runs without IP being configured for the required interface.

> If you have a service that needs to find its partner, lets say a 
> SQL-Server for data-logging, then put together a subnet related 
> broadcast packet per each interface and send it out. As IP is up and 
> running a correct response will come back and no guessing is needed to 
> connect to the partner.

-- 
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.



More information about the En-Nut-Discussion mailing list