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

Re: laptop questions



On Tue, Nov 26, 2002 at 04:15:58PM -0600, Jamin W. Collins wrote:
| On Tue, Nov 26, 2002 at 04:39:59PM -0500, Matthew Weier O'Phinney wrote:
| 
| > 1) PCMCIA cards. We have a linksys ethernet card that is recognized as
| > an NE2000 compatible ethernet card. When I did the install, the only
| > way I could get it to be recognized for the network installation was
| > as eth0 -- not as a PC card. 
| > 
| > When I boot, the init scripts try to setup the network /before/ the
| > card is loaded. If I'm not on the network at the time, it's not a
| > problem; if I am, it means that eth0 goes unbound, and I have to do an
| > 'ifdown eth0 && ifup eth0' to get my connection.
| > 
| > Ideally, I'd like the network to start if and when the card is
| > inserted/recognized. How do I accomplish this?
| 
| Remove the eth0 from the auto line in /etc/network/interfaces.  The
| pcmcia service will take care of starting the interface when the card is
| inserted.

Maybe the pcmcia services need to be configured for that to work.  On
my laptop I must manually run 'ifup eth0' to bring up the interface
after (re)inserting the NIC.

However, the interfaces file isn't a problem.  I use a solution
provided by someone else on this list a long time ago :

    auto eth0
    iface eth0 inet dhcp
        pre-up /usr/local/sbin/check-link.sh

The pre-up line runs the command first, and only attempts to bring up
the interface if it exits successfully.  That script is attached.  It
depends on the 'net-tools' package.  The only problem here is that
ifup still records the link in /etc/network/ifstate even when it isn't
brought up.  Using 'ifup --force' or 'ifdown ; ifup' when the card is
inserted later works around that (as does editing the ifstate file).

HTH,
-D

-- 
Only two things are infinite, the universe and human stupidity, and I'm
not sure about the former.
        Albert Einstein
 
http://dman.ddts.net/~dman/

Attachment: check-link.sh
Description: Bourne shell script

Attachment: pgpaPwhckOeU4.pgp
Description: PGP signature


Reply to: