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! |
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.
|
Quote:
|
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.. :) |
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.
|
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:
|
Quote:
Also, thanks to everyone for the answers, I appreciate it! |
All times are GMT -5. The time now is 08:02 PM. |