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

Re: [SOLVED] Static IP /etc/network/interfaces, but got leased by dhcp



Ivan Kovnatsky wrote:
> Karl E. Jorgensen wrote:
> > Hm. This should not be happening.
> > Was it DHCP recently? (i.e. at any time since the last reboot) Because
> > this sequence of events would produce what you saw:
> 
> I have uptime:
> 
>   And I fount that dhcp was running:
> 
> > Alternatively: when switching from dhcp to static: kill off any
> > remaining dhcp clients manually :-)
> 
> That must be it.  I might have used dhcp in /etc/network/interfaces
> some time ago, and dhcp client must have been hanging there.

If you had booted with the dhcp entry then ifupdown would have started
the dhclient.  The dhclient will run until the interface is "downed".
If you had edited the file and remove the dhcp entry without downing
the interface first then it would leave dhclient running.

This is a good sequence.

  ...boot starts everything...
  # ifdown eth0
  # editor /etc/network/interfaces
  # ifup eth0

But if you forget then it is bad.  This is a bad sequence.

  ...boot starts everything...
  # editor /etc/network/interfaces
  # ifdown eth0
  # ifup eth0

The ifdown in that case came after the edit.  It doesn't down the
_previous_ configuration.  It downs the *new* configuration.

I don't recommend rebooting unless it is necessary but I will note
that if you had rebooted then it would have started only with the
configuration file /etc/network/interfaces configuration and that
would have worked.  No dhclient would have ever been started in that
case.

HTH,
Bob

Attachment: signature.asc
Description: Digital signature


Reply to: