tags 853077 + buster
thanks

(For now.)

On Sun, Jan 29, 2017 at 04:46:38PM +0100, Celelibi wrote:

> When an interface is configured with DHCP, ifup runs a dhclient.
> However, if there's no network available after a minute, dhclient forks
> to the background and continue to run.
> 
> The interface is therefore marked as configured although it's not.

It is extremely difficult to say when an interface is configured and
when it is not. Is it when the kernel interface is up? Is it when a
carrier is detected? Is it when the DHCP client is started? When it has
at least one IPv4 address? When you can reach your LAN? Gateway? Another
host on the Internet?

What if your interface really is up, but then suddenly the DHCP server
stops extending your lease? Or the network connection fails completely?
Or some router on the Internet that is completely out of your control
causes your Internet connection to become useless? Should ifupdown then
consider the interface down again?

Heuristics that work for you might not work for someone else. Ifupdown
is also not a daemon that is constantly watching what is happening with
the network, it can only do things once when you run ifup. The current
behaviour is a best effort. The reason it goes to the background and to
mark the interface as up is to ensure the computer can continue booting,
as you already mentioned. The DHCP client is still running in the
background, so as soon as you do have a good network connection, you
will get an IP address.

> The main inconvenience for me is that it floods the logs with useless
> messages.

Can you give me an example of those messages in your logs? This is maybe
something that can be improved.

> It is however desirable on laptops to have dhclient exit when the
> network is not connected. So that the interface would not be marked as
> configured by ifupdown and even down at the system level.

This has been asked by others as well, but this is also not as easy as
it seems. With most network cards nowadays, whether wireless or wired,
the only way to find out if you can connect to the network is by
actually bringing the network interface up and to wait for a while, and
for wireless networks you need to try to associate with an access point
before you know if you can connect to it. You cannot trust the link
status of an interface that is down.

> Maybe it would be nice to add an ifupdown config file, like
> /etc/ifupdown.conf in which we could add some options? In this file we
> would either add a "tryonce" option, or command line options for
> specific DHCP clients.
> Just a suggestion.

I'll have a look if that is easy to do, but in any case that would be
something for after the release of Debian stretch.

-- 
Met vriendelijke groet / with kind regards,
      Guus Sliepen <[email protected]>

Attachment: signature.asc
Description: Digital signature

Reply via email to