Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.


  Search this Thread
Old 02-08-2006, 10:27 AM   #1
Registered: Jan 2006
Location: Fort Worth, TX
Distribution: Ubuntu, DSL
Posts: 47

Rep: Reputation: 15
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?
Old 02-08-2006, 12:23 PM   #2
Senior Member
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284

Rep: Reputation: 47
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.
Old 02-08-2006, 09:40 PM   #3
Senior Member
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,353

Rep: Reputation: 91
You can take a look at ifplugd:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why I am considering switching back... guardianfox General 16 12-09-2005 12:49 PM
Auto switching from wired to wireless networking and back? ronaldv Linux - Wireless Networking 2 06-26-2005 03:27 PM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 05:57 PM
Switching Back... ImAnFnNub Linux - Hardware 2 08-17-2004 05:59 AM
switching back to xwin Jerry78 Linux - Newbie 7 07-16-2003 09:14 AM > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 05:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration