Problem with shared-network

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Jun 5 16:28:03 UTC 2015


robert at spotswood-computer.net wrote:
> I specifically told the
> server which interface (eth0:1, and not eth0), and it DOES have an IPv4
> address.

That doesn't work - dhcpd cannot use a virtual interface like that, nor can it ignore traffic on any of the interfaces defined on a physical port.

Reason ? These operate at the IP layer, while dhcpd operates at the packet layer for some of it's operations - though there are ways round that if you can work with certain limitations.
Simple example - client broadcasts a DHCP Discover packet. The client doesn't have an IP address, the packet has neither source nor destination address (I think they are all zeros, or is it all ones ?). When that packet arrives on the physical interface, there is absolutely nothing to differentiate whether it was intended for eth0, or eth0:1, or eth0:2, or ...
The server also needs to be able to transmit packets without a source address - these cannot go via the IP stack so also ned to be handled directly.

So dhcpd cannot bind to a virtual interface, it can only bind to the main interface and it cannot not service a virtual interface.

The exception is if you compile without the option to use raw sockets. Then you can operate at the IP level, but you cannot handle locally attached clients - only clients utilising a relay agent. I suspect even if you do this, there's probably still the code in there that (should) throw a warning if you try and listen on a virtual interface.



More information about the dhcp-users mailing list