dhclient: Unicast requests sent on "wrong" interface

Guillaume Nault g.nault at alphalink.fr
Wed Feb 6 15:35:36 UTC 2013


Hi,

I'm trying to fix a problem we have when using dhclient on a host with
two network interfaces. Both of them are configured with DHCP and their
assigned IP address belongs to the same subnet.

The discovery stage works fine, but while in renewing state, one of the
interfaces will send its DHCPREQUEST through the other interface. Indeed
two routes exist for joining the dhcp server, one per interface, so only
the first one is used.
The problem is that our network provider doesn't accept DHCPREQUESTs
that are not sent over the link associated with the interface to
configure. So we need to ensure that dhclient will always send its DHCP
packets through this interface.

I've made a small patch for dhclient to get this behaviour. It simply
calls setsockopt(SO_BINDTODEVICE) to temporarily bind the
"fallback_interface" before sending DHCPREQUEST or DHCPRELEASE packets.
It works fine, but I'd prefer to use code that is fully supported
upstream.

So does such a feature make sense upstream? It there any better way to
get the same result?

Best regards,
-- 
Guillaume Nault


More information about the dhcp-users mailing list