-   Linux - Wireless Networking (
-   -   Switching back and forth between Wireless and Ethernet (

FWSquatch 02-08-2006 10:27 AM

Switching back and forth between Wireless and Ethernet
I have an HP Omnibook XE3 running Debian Sarge. For the longest time, I would plug into my home and work network with a 25 ft ethernet cable. Well, I finally got my wireless card working and now I can run it on my wireless network at home, but when I go to work, I have to plug into theirs. How do I switch back and forth between my wireless and my network card?

fouldsy 02-08-2006 12:23 PM

There are hotplug scripts that can detect whether a physical network cable is attached, allowing you to then activate the wired interface, otherwise activate your wireless connection, and wrap all this into your own startup script. Personally, I just bring up my wireless connection automatically on boot, then have a quick shell script that I can run to let me pick an additional network to connect into at work. An example would be:

depmod -a
modprobe ndiswrapper

ifconfig eth0 down
ifconfig wlan0 down

iwconfig wlan0 essid "youressid"
iwconfig wlan0 key restricted [1] yourkey
ifconfig wlan0 youripaddress netmask yournetmask

route add default gw yourdefaultgw

ifconfig wlan0 up

and something similar for your wired connection. The whole script including the menu system can be found here - . Just adjust it to your needs.

Linux.tar.gz 02-08-2006 09:40 PM

You can take a look at ifplugd:

All times are GMT -5. The time now is 04:48 PM.