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

Re: network unrachable problem [SOLVED]

Tony van der Hoff wrote:
> Well, From reading the man pages (always a good idea) I discovered that
> ifplugd calls ifup/ifdown to do its actual work.
> Manually invoking "ifdown eth0" returned an error "eth0 not configured",

Ah!  So that is the problem.

> so I guessed that is why ifplugd was not doing its job properly.
> Further reading revealed that the stanza "auto eth0" is required in
> /etc/network/interfaces for the kernel to be able to autoconfigure the
> interface.

No.  That isn't correct.  You need either auto or allow-hotplug to be
there.  Or both.  If neither are there then ifupdown won't configure

If auto is there then it is configured at system boot time by the
/etc/init.d/networking script.  If allow-hotplug is there then it is
configured by the /etc/network/if-*{up,down}.d/  scripts when detected
by the kernel in an event driven manor.

Basically in the old days everything was static.  You configured
everything for boot time operation.  So it was "auto" and
/etc/init.d/networking configured it.  But as time went by we acquired
PCMCIA and USB and laptops with wifi on/off switches and other hot
plugged devices.  Boot time only isn't good enough when devices can
come and go.  So there has been a big push in recent years to convert
everything from the static boot time interface to the dynamic
hotpluggable event driven interface.

Note that while almost everything works with hotplugged devices a few
components such as NIS/yp haven't been completely converted and need
the interface guarenteed up before they start.  It still works if it
isn't but there is a long delay until it times out.  Then the
interface comes up.  Then the retry succeeds.  Meaning that it all
works eventually but quite slowly at boot time if the order isn't
optimal.  Unless you are running nis/yp I wouldn't worry about it.

Here is documentation on the /etc/network/interfaces contents.


Note that it is okay to have both allow and allow-hotplug together.
Then whichever runs first will configure the device.  Whatever runs
second will detect that the interface is up and handle this
correctly.  Many of us have both so that we can cycle all of the
configured interfaces with 'service networking restart' which would
otherwise do nothing if they were only configured with allow-hotplug.

> That stanza was missing. I instated it, and re-booted.
> It is now working correctly.

Of course there is no arguing with the result!  But the question now
is if there was an allow-hotplug statement before why it didn't come
up before.  Was the allow-hotplug also missing?

For a device that uses usb networking such as a wifi device on the Pi
I think using the hotplug interface makes the most sense.  Because we
generally will be plugging and unplugging the device hot.

> I dont know whether my hackery caused the problem, or whether the
> interfaces file was missing it from the start; if it was, I'd consider
> it a bug. But then would it be a raspian, or a wheezy bug?

It would be Raspian.  It didn't get there by the debian-installer from
an official Debian installation media.  It got there because someone
diddled it in the distributed Raspian image.  If you were to install
through an official Debian installation media then you wouldn't have
this problem.  And additionally you also would not have ifplugd
running either.  That isn't installed by default on Debian.  But it is
available for installation.


Attachment: signature.asc
Description: Digital signature

Reply to: