Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

Switching LAN/WLAN on boot

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
r_schneid
n00b
n00b
Posts: 5
Joined: Tue Feb 27, 2007 8:43 am

Switching LAN/WLAN on boot

  • Quote

Post by r_schneid » Tue Feb 27, 2007 8:57 am

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_Va ... LAN.2FWLAN

(of course you may have to change device names)


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

Rene
Top
deno
Guru
Guru
User avatar
Posts: 411
Joined: Wed Sep 13, 2006 4:23 pm

  • Quote

Post by deno » Tue Feb 27, 2007 10:11 am

Nice, thnx, just what I need.
Top
ZmiyGorinich
Guru
Guru
User avatar
Posts: 369
Joined: Fri Feb 27, 2004 10:50 am
Location: Zaporizhzhe, Ukraine
Contact:
Contact ZmiyGorinich
Website

  • Quote

Post by ZmiyGorinich » Wed Feb 28, 2007 2:27 pm

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
Top
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

  • Quote

Post by ppurka » Thu Mar 01, 2007 5:11 am

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 | Now using kde5 | e is unstable :-/
Top
Evincar
Apprentice
Apprentice
Posts: 217
Joined: Tue Feb 13, 2007 1:24 pm
Location: Madrid

  • Quote

Post by Evincar » Thu Mar 01, 2007 5:42 pm

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_pr ... ith_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
Top
joysofpi
n00b
n00b
Posts: 3
Joined: Sun Mar 04, 2007 6:19 pm

  • Quote

Post by joysofpi » Sun Mar 04, 2007 6:24 pm

I believe sys-apps/netplug in portage also does this pretty well
Top
Post Reply

6 posts • Page 1 of 1

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy