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

Re: laptop restart eth0 automatically on plugin or on awake like a desktop



On Fri 10 Jun 2011 at 23:40:35 +1000, Scott Ferguson wrote:

> On 10/06/11 22:20, Brian wrote:
> > 
> > Remove cable.
> > 
> >    root@dektop3:~# dmesg | tail -n 1
> >    [  158.220270] via-rhine 0000:00:12.0: eth0: link down
> > 
> <snipped>
> > 
> > eth0 is not brought down 
> 
> Yes it is --------------------------------------^

'link down' is a kernel message recognising the disappearence of the
cable connection, not a declaration that eth0 is down. If it were not
active the interface would not appear in the ifconfig output and would
not be available. The routing table still exists. The machine knows
where to send packets but nothing leaves through eth0.

> > and also retains its IP address.
> 
> Not "also". It's a static address.

An address obtained via dhcp would also be retained because eth0 is
still up.

> With those settings hotplug never gets to function, as the device
> (builtin) is there from boot, and nothing can be changed whether the
> cable is connected or not (static settings).

I assure you allow-hotplug does function during booting. Try it with
dpcp. Now auto and dhcp. See the difference?

> If you change the static settings to dhcp it should change - provided
> network manager is not installed of course.
> eg. change static to dhcp and comment out the last five lines
> restart the network and ifconfig should aquire an network settings - the
> nic will be brought down when the cable is later removed - but settings
> will be retained (lease determined).

You are right about the settings but not about the NIC. Cable out - NIC
stays up.

> Your current method of configuring the network is a fast, reliable, and
> simple way if LAN is the only connection you ever use. You can even add
> dns entries to interfaces.
> 
> Where you might have problems is moving to different LANs or using a modem.

The /e/n/i I use (the one above was an example for the purpose of my
post) gives me no problem on any wired or wireless LAN or with mobile
broadband.


Reply to: