Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Switching LAN/WLAN on boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
r_schneid
n00b
n00b


Joined: 27 Feb 2007
Posts: 5

PostPosted: Tue Feb 27, 2007 8:57 am    Post subject: Switching LAN/WLAN on boot Reply with quote

I use my laptop at home as well as at work, with an ethernet connection at work and WLAN (WIFI) at home. It annoyed me to wait for the inactive network to find out it was actually inactive (dhcp timeout). So I wrote a little script that checks if a ethernet cable is connected. If that is the case, the ethernet device eth0 is started. If not the WLAN, eth1, is started.

More detailed description:

http://gentoo-wiki.com/HARDWARE_Sony_Vaio_VGN-TX3#LAN.2FWLAN

(of course you may have to change device names)


Hope someone finds this useful.
Comments and suggestions are welcome.

Rene
Back to top
View user's profile Send private message
deno
Guru
Guru


Joined: 13 Sep 2006
Posts: 405

PostPosted: Tue Feb 27, 2007 10:11 am    Post subject: Reply with quote

Nice, thnx, just what I need.
Back to top
View user's profile Send private message
ZmiyGorinich
Guru
Guru


Joined: 27 Feb 2004
Posts: 369
Location: Zaporizhzhe, Ukraine

PostPosted: Wed Feb 28, 2007 2:27 pm    Post subject: Reply with quote

Thanks.

But how I can make this.
If network cable plug then use ethernet card for network, if unplug than use WiFi?
_________________
Home: Athlon XP 2000+, ATI Radeon 9200 64Mb, 512Mb, hda:40Gb, hdb:120Gb, DVD-RW
Work : Duron 1.4, S3 ProSavage8 32Mb, 512Mb, hda:40Gb, CD-RW
Design, programming, hosting
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3181

PostPosted: Thu Mar 01, 2007 5:11 am    Post subject: Reply with quote

Very nice! I have been using a script on my own, which first tries the LAN and if it fails then modprobes and starts the wireless.

This script is _very_ useful in that context.

ZmiyGorinich wrote:
But how I can make this.
If network cable plug then use ethernet card for network, if unplug than use WiFi?
This is to be started as a service. So, when you boot your machine (or resume from suspend) then (re)start this service so that if a cable is plugged then it will start the LAN, and if there is no cable plugged in, it will start the wifi.
_________________
emerge --quiet redefined | E17 vids: I, II
Back to top
View user's profile Send private message
Evincar
Apprentice
Apprentice


Joined: 13 Feb 2007
Posts: 217
Location: Madrid

PostPosted: Thu Mar 01, 2007 5:42 pm    Post subject: Reply with quote

ZmiyGorinich wrote:
Thanks.

But how I can make this.
If network cable plug then use ethernet card for network, if unplug than use WiFi?


Have you tried arping using arping configuration? Have a look at this:

http://gentoo-wiki.com/HOWTO_Network_profiles_with_arping

It works flawlessly for me: Auto-search the two wired gateways I use (home and work), if no plug, the wireless comes up and connects :D
Back to top
View user's profile Send private message
joysofpi
n00b
n00b


Joined: 04 Mar 2007
Posts: 3

PostPosted: Sun Mar 04, 2007 6:24 pm    Post subject: Reply with quote

I believe sys-apps/netplug in portage also does this pretty well
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum