LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
LinkBack Search this Thread
Old 12-10-2006, 02:26 PM   #1
darkarcon2015
Member
 
Registered: Jun 2004
Location: Potsdam, NY
Distribution: Fedora Core 6
Posts: 201

Rep: Reputation: 30
Bring up one interface at boot


The /etc/init.d/network script brings up every interface at boot. Sometimes this is nice because if I don't have a network cable plugged in, it will fail quicky and go on to the next interrace (wireless). But, if I do have a network cable plugged in, it brings that up along with the wireless connection and proceeds to use the wireless interface.

Is there a way to make this script stop when at the first successful network connection that it encounters? Thanks!
 
Old 12-11-2006, 07:15 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,345

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
you can't stop at the first successful one no, that doesn't really make sense. i mean you could write yoru own script to try them in a certain order, but it's a pretty obtuse thing to want to do... you can certainly edit their config files to not make them run at boot on a per interface basis in /etc/sysconfig/network-scripts/ifcfg-<name> but not what you want, no.
 
Old 12-15-2006, 11:11 PM   #3
darkarcon2015
Member
 
Registered: Jun 2004
Location: Potsdam, NY
Distribution: Fedora Core 6
Posts: 201

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie
that doesn't really make sense
Why doesn't it make sense? Why would you want to connect to a wireless router after you have already established a connection through a hard line? I wouldn't call this obtuse... it just doesn't make sense the way that they do it.
 
Old 12-16-2006, 06:36 AM   #4
live_dont_exist
Member
 
Registered: Aug 2004
Location: India
Distribution: Redhat 9.0,FC3,FC5,FC10
Posts: 257

Rep: Reputation: 30
If you really want to do this might be 1 way to do it. Move out ifcfg-eth2(whatever the wireless connection is) into your home directory. This effectively will mean that your wireless connection wont come up at startup.

Put in a line in your .bash_history which copies the wireless config file into /etc/sysconfig/network-scripts while logging in. Since your services are already started up nothing's gonna happen .. as in your wireless isnt going to come up.Incase your wired connection goes down you can just copy the wireless file back into /etc/sysconfig/network-scripts/ and restart network services.

Now in your bash logout scripts just move the wireless config file back again into your home directory or something.All this has to be scripted obviously and its just a dirty hack so really why would you want to do this?

Cheers
Arvind
p.s...Best solution:Just turn off the wireless router once you're connected..
 
Old 12-16-2006, 07:03 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,345

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
it's not that it literally doesn't make sense, it's that it's a very specific requirement for a specifc scenario, and you can only cater for so many scenario's. What i said above still stands though, it's really fiarly simple to script your own desired behaviour yourself as part of your own boot process. I should say at the same time that moving ifcfg-eth0 to your home directory is really not a good idea, and isn't worth looking at really. instead just edit the interfaces and set ONBOOT=no then start them in your preferred order. but past that, i don't think that you even necessarily have a problem. so what if both networks are connected to? what's the problem with that? should work just fine as far as i'm aware. if you wish to use the wired conenction instead of the wireless if they are both available, i *THINK* you can just set a different metric in each ifcfg file, e.g "METRIC-1" for the wired one and "METRIC=10" in the wireless. that way if they are both connected the wired connection will be used exclusively as it has a lower metric.
 
Old 12-16-2006, 09:40 AM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Maybe you should have a look at ifplugd . I see that it is available by using the yum or smart package tools.

http://0pointer.de/lennart/projects/ifplugd/#overview

Quote:
This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected.
 
Old 12-17-2006, 12:23 AM   #7
darkarcon2015
Member
 
Registered: Jun 2004
Location: Potsdam, NY
Distribution: Fedora Core 6
Posts: 201

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie
so what if both networks are connected to? what's the problem with that? should work just fine as far as i'm aware.
Yes, it does work in the sense that I do get an IP address and that I can use the Internet. The problem is that the laptop interfaces using a local IP address given by a router that isn't mine. So, yes this is specific, and I understand that, but I figured I would clarify that it can be a problem.

Also, thanks to everyone for the answers, I appreciate it!
 
  


Reply

Tags
interface, network, script


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What does ifup do to bring up an interface? crazyjimbo Linux - Networking 1 07-04-2006 01:00 AM
How to bring up the wireless network interface on first boot up? dejavu_01 Debian 1 05-20-2006 11:29 PM
Can't bring up eth0 Interface at boot robertmenezes Linux - Networking 8 02-21-2005 01:13 AM
pppd: how to bring up an interface? J_Szucs Linux - Networking 2 08-08-2004 08:02 AM
couldn't bring up interface eth0 mikez Linux - Networking 9 02-28-2002 12:02 PM


All times are GMT -5. The time now is 10:00 AM.

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