tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: DHCP client with minimal functionality and size


Steven M. Bellovin wrote:
> On Thu, 17 Jan 2008 15:18:29 +0100
> Joerg Sonnenberger <> wrote:
>> On Wed, Jan 16, 2008 at 04:26:10PM +0000, Roy Marples wrote:
>>>>    Just to clarify - so in this model unplugging and
>>>> replugging in an ethernet cable would be expected to run a script
>>>> which would kill and potentially restart dhcpdc?
>>> Yes, as there is no guarantee the the cable you unplugged is the
>>> same one you plug in. For example, you could be configuring your
>>> network based on arpinging set gateways. Here's a sample config you
>>> could achieve with this in Gentoo.
>> This is exactly why I asked for the DHCP client to deal with this.
>> Keep the currently configured lease and try to validate it / get a
>> new one. This is what Windows is doing with the exception of dropping
>> the old lease when it can't get a new one. This is the most sensible
>> behaviour.
> Right, but it might be a better approach to build something more like
> network manager to handle this.  I agree that the current dhclient does
> that very badly.

I think I can comment on that: I am using ifwatchd to monitor the
carrier status of my ethernet port (-c). I have a list of known networks
that I detect using arping; some of which I configure static IP, others
that I should fire dhclient.

There is however a major inconvenience with the current dhclient: when
started, it ifdowns and ifups the interface. This triggers ifwatchd over
and over again, so I have to actually stop ifwatchd before I fire
dhclient. Obviously, that's not very useful.

Roy, is your implementation behaving likewise?
Would anyone have a better idea on how to do this? FWIW the original
patch in PR 23191 already mentioned this problem.

Anyway, I would therefore tend to agree with the UNIX philosophy here:
- I think the DHCP client should just be a client (which is avoiding
unsuspected side-effects when triggered manually)
- I really like that the process of actually setting up the network
doesn't imply using DHCP.


Home | Main Index | Thread Index | Old Index