LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Bring up one interface at boot (https://www.linuxquestions.org/questions/fedora-35/bring-up-one-interface-at-boot-509155/)

darkarcon2015 12-10-2006 02:26 PM

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!

acid_kewpie 12-11-2006 07:15 AM

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.

darkarcon2015 12-15-2006 11:11 PM

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.

live_dont_exist 12-16-2006 06:36 AM

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.. :)

acid_kewpie 12-16-2006 07:03 AM

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.

homey 12-16-2006 09:40 AM

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.

darkarcon2015 12-17-2006 12:23 AM

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!


All times are GMT -5. The time now is 08:02 PM.