Comment 8 for bug 351378

Revision history for this message
Tom Metro (tmetro+ubuntu) wrote : Re: [Bug 351378] Re: dhclient fails for virtual interfaces (IP aliases)

Bryan McLellan wrote:
> Most likely that comment and surely that code is to
> support the inclusion of an alias definition in your dhclient.conf(5),
> as opposed to running dhclient on an alias interface.

Ah, right. You're probably right.

The dhclient.conf(5) man page also mentions pseudo interfaces, which
sounds a lot like virtual interfaces:

   Under some circumstances it can be useful to declare a
   pseudo-interface and have the DHCP client acquire a configuration for
   that interface. ... A pseudo-interface is just another state machine
   running on the interface named real-name, with its own lease and its
   own state.

It also notes:

   You must also provide a separate client script for the
   pseudo-interface to do what you want with the IP address.

If by that they mean your script will be ran in place of
/sbin/dhclient-script, then that would be some more evidence supporting
your point that /sbin/dhclient-script doesn't support virtual
interfaces, as is.

>> Patching the script seems more viable.
>
> The script does provide a lot of glue, but working around it as a
> debugging technique isolates what errors are coming from the script
> and what errors are coming from the program itself.

I guess I was already pretty convinced that the source of the errors was
ifconfig, given that the error can be reproduced external to dhclient
and it's scripts by invoking ifconfig directly using the same arguments.
The next questions is: is ifconfig broken, or is the manner in which
dhclient is calling it broken?

> I don't believe patching the script will do you any good until the
> 'Bind socket to interface: No such device' error from dhclient is
> resolved...

My assumption was that this was simply a side effect of the
"deconfigure" step failing, which results in the virtual interface never
being created, and thus dhclient has no device to work with.

This can be resolved by either 1. patching the code so that it
instantiates the virtual interface in a deconfigured state, or 2.
special casing virtual interfaces so that the physical interface gets
used for the DHCP handshake, while the specified virtual interface is
used for the resulting call to ifconfig. (Apparently the latter happens
with udhcpc.)

> Removing dhcp3-client (which removed ubuntu-minimal)...

Removing ubuntu-minimal sounds like something to be avoided, but there
was mention of people doing that (as a side effect of removing the
wireless package) in the bug this one was split off from, and it didn't
sound like it caused any problems. I'll have to take a look at
ubuntu-minimal to see what it is.

> ...and installing dhcpcd worked just fine with
> /etc/network/interfaces ... and thus appears like a clean enough work
> around.

Excellent. Thanks for the suggested workaround. Care to post the
/etc/network/interfaces syntax you used for the virtual interface? (In
my research I ran across about 3 or 4 variations.)