department27
June 23rd, 2005, 06:24 AM
This is the first HOWTO i've written so be patient with me. ;-)
I have a laptop (dell d600) with both inbuild ethernet and wireless (intel 2200). The thing that I found frustrating is the I could not get Ubuntu to switch between the ethernet and wireless when I plugged out the ethernet. I always had to manually select the wireless. So I downloaded ifplugd which in theory should do this but it never worked for me.
After playing with it for a while I have managed to get it working perfectly, although it does not seem to be the recomended way.
So here goes.
Assumption:
eth0 = inbuilt ethernet card
eth1 = wireless card
The two packages you need to download are ifplugd and ifmetric.
Once you have these installed you need to change the following files:
/etc/network/interfaces
add up ifmetric eth0 0 & up ifmetric eth1 1
ifmetric assigns a route metric to the interfaces. In my case eth0 is give a lower metric hence is is the primary interface.
Here is mine as an example:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0
# The primary network interface
iface eth0 inet dhcp
up ifmetric eth0 0
iface eth1 inet dhcp
wireless-essid dept27
up ifmetric eth1 1
auto eth0
auto eth1
Now according to the ifplugd blurb you should coment out any auto interfaces that you will put in ifplugd. That does not work. Well it did not work for me at any rate.
Then you edit /etc/default/ifplugd
# This file may be changed either manually or by running dpkg-reconfigure.
#
# N.B.: dpkg-reconfigure deletes everything from this file except for
# the assignments to variables INTERFACES, HOTPLUG_INTERFACES, ARGS and
# SUSPEND_ACTION. When run it uses the current values of those variables
# as their default values, thus preserving the administrator's changes.
INTERFACES="eth0 eth1"
HOTPLUG_INTERFACES=""
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"
Add eth0 and eth1 to the INTERFACES line as above.
And that is basically it. I also have netapplet running, the one from backports.
What you will find is that when you boot you machine with the ethernet plugged in it will use that as the primary interface. If you unplug the ethernet it will start to use the wireless, and plug it back in it reverts to the ethernet.
Hope this helps someone.
I have a laptop (dell d600) with both inbuild ethernet and wireless (intel 2200). The thing that I found frustrating is the I could not get Ubuntu to switch between the ethernet and wireless when I plugged out the ethernet. I always had to manually select the wireless. So I downloaded ifplugd which in theory should do this but it never worked for me.
After playing with it for a while I have managed to get it working perfectly, although it does not seem to be the recomended way.
So here goes.
Assumption:
eth0 = inbuilt ethernet card
eth1 = wireless card
The two packages you need to download are ifplugd and ifmetric.
Once you have these installed you need to change the following files:
/etc/network/interfaces
add up ifmetric eth0 0 & up ifmetric eth1 1
ifmetric assigns a route metric to the interfaces. In my case eth0 is give a lower metric hence is is the primary interface.
Here is mine as an example:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0
# The primary network interface
iface eth0 inet dhcp
up ifmetric eth0 0
iface eth1 inet dhcp
wireless-essid dept27
up ifmetric eth1 1
auto eth0
auto eth1
Now according to the ifplugd blurb you should coment out any auto interfaces that you will put in ifplugd. That does not work. Well it did not work for me at any rate.
Then you edit /etc/default/ifplugd
# This file may be changed either manually or by running dpkg-reconfigure.
#
# N.B.: dpkg-reconfigure deletes everything from this file except for
# the assignments to variables INTERFACES, HOTPLUG_INTERFACES, ARGS and
# SUSPEND_ACTION. When run it uses the current values of those variables
# as their default values, thus preserving the administrator's changes.
INTERFACES="eth0 eth1"
HOTPLUG_INTERFACES=""
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"
Add eth0 and eth1 to the INTERFACES line as above.
And that is basically it. I also have netapplet running, the one from backports.
What you will find is that when you boot you machine with the ethernet plugged in it will use that as the primary interface. If you unplug the ethernet it will start to use the wireless, and plug it back in it reverts to the ethernet.
Hope this helps someone.