Can dhcpclient handle broadcasting ?

Alan DeKok aland at
Sat Jul 19 22:07:40 CEST 2014

Chaigneau, Nicolas wrote:
> Additionally, I've noticed that :
> - if the client host has multiple interfaces,
> - and at least one of them already has an IP address,
> Then the source IP address cannot be (even with "Packet-Src-IP-Address=").
> An actual IP address is automatically used as source.
> From what I understand, this is modified by the device driver.


> I've first tried to force the interface with setsockopt and option "SO_BINDTODEVICE", but this apparently doesn't do anything useful...

  It works only if you're root.  And it should mean that packets sent
from the device use the devices IP address.

> So I've done the following:
> Add an option to dhcpclient allowing to specify which network interface to use.

  That's good.

> Open a raw socket on the low level packet interface. This allows packet data to be left unchanged by the device driver.


> Encode Ethernet (send to ff:ff:ff:ff:ff:ff), IP and UDP layers manually. And let FreeRADIUS do the DHCP stuff, as before.

  That's how most DHCP clients work. :)

> (This required new specific socket / send / recv functions.)


> Maybe there's a better way to do this... I couldn't find one, though.

  Not really.  It would have been nice to have a socket API to create
packets.  Oh well.

  Alan DeKok.

More information about the Freeradius-Users mailing list