Linux - determing which interface is activated at start up

inc

Weaksauce
Joined
Apr 2, 2002
Messages
104
I have a wireless and a wired network interface on my laptop, and I want ot know if there is a nice way to specify which interface will start up at boot.

What I was thinking is a script that checks if the laptop is running off battery, and if it is then it will activate the wireless interface at start up. If not then it will load the wired interface.

Or, a script at start up that asked me which interface to initialize before it sends out the DHCP request.

If it matters, Im using the ipw22000 and e1000 modules for the interfaces. I'm on a t42p and running ubuntu 4.10.

(yay fglrx is finally working too, ubuntu makes it too easy)
 
XOR != OR said:
What distro?

inc said:
If it matters, Im using the ipw22000 and e1000 modules for the interfaces. I'm on a t42p and running ubuntu 4.10.

(yay fglrx is finally working too, ubuntu makes it too easy)

Yes, Its ubuntu :D . I tried making both of them auto in /etc/network/interfaces, but Im too impatient to wait for the DHCP discover on eth0 to timeout to wait for eth1 to try, and ctrl-c ends the entire process for both interfaces.
 
Rmove them both from wherever you're specifying that they
try dhcp - hostname.[interface], or wherever it is on your
distro. Then write a script, /etc/init-lan-connection that
either tries both with a short timeout, or checks the battery
status, or prompts you for a response, and stick a call to
that script in the relevent rc* file.
The details all depend on your distro and other linux stuff,
that I don't know anything about.
 
I was reading through the gentoo power managment guide (should be in their doc section). It gives a lot of info on how to set up acpid, which you could probably use to moniter for a battery. There are a couple of init scripts that check whether it is plugged in or not, and sets power management settings accordingly. You may need to adapt some of the steps as it is primarily for gentoo, but the info is there; I am sure you will find useful info there.
 
Back
Top