You are not logged in.

#1 2007-09-09 17:49:39

piie
Member
Registered: 2007-02-20
Posts: 33

chained network-profiles

Hi,

i made a patch for the /etc/rc.d/network startscript some time ago and havent published it yet. So here it is:

The idea is to start different network profiles (/etc/network-profiles/) after each other, until one profile was successfully applied. E.g. I have a laptop with eth0 (wired) and eth1 (wireless), so when booting with plugged in cable I want my eth0 to be active. When the cable is not plugged in, I want eth1 to be enabled.

The patch can be downloaded from: http://piie.net/files/chained_network.patch
to apply it:  login as root, 
cd /etc/rc.d/
patch -p0 < /where/you/saved/chained_network.patch

now you can edit the NET_PROFILES=(XXXXXX) line /etc/rc.conf
-> Profiles in the line prefixed by a colon are such chained profiles:
e.g.  NET_PROFILES=(:eth0 :wpa)

hf!

Last edited by piie (2007-09-09 18:25:31)

Offline

#2 2007-09-10 05:37:48

dr_te_z
Member
From: Zoetermeer, the Netherlands
Registered: 2006-12-06
Posts: 154

Re: chained network-profiles

Great work. I started with network profiles because I wanted a faster boot (laptop as well) when I had no cable attached. I guess that your script still needs time for linux to sence that there is no cable attached?


Somewhere between "too small" and "too large" lies the size that is just right.
- Scott Hayes

Offline

#3 2007-09-10 09:05:25

piie
Member
Registered: 2007-02-20
Posts: 33

Re: chained network-profiles

that may depend on your network card. For me, using an intel 82801db network card, detecting whether the cable is plugged in or not works instantly. No noticable delay.

EDIT: aah, ensure that the package "net-tools" is installed, it contains mii-tool which is used for detecting if the cable is plugged in.

Last edited by piie (2007-09-10 09:06:50)

Offline

#4 2007-09-10 13:53:11

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: chained network-profiles

when i first read this i didnt think id like it, but nevertheless i patched it and tried it out. it works damn well and i think ill be keeping it. great job piie, thanks.

Last edited by rson451 (2007-09-10 15:28:08)


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#5 2007-09-10 15:03:55

piie
Member
Registered: 2007-02-20
Posts: 33

Re: chained network-profiles

rson451, thanks, but:

p i i e     <-- two "i" in the middle wink

Offline

#6 2007-09-10 15:26:45

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: chained network-profiles

aw hell, it was early ... big_smile i even went to your site this morning and STILL got it wrong in the post lol

Last edited by rson451 (2007-09-10 15:27:45)


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#7 2007-09-10 23:23:39

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: chained network-profiles

There's already development on a new network profile system, and the current one will soon be deprecated.

Please look at netcfg2. http://bbs.archlinux.org/viewtopic.php?id=36384

James

Offline

#8 2007-09-11 07:35:35

piie
Member
Registered: 2007-02-20
Posts: 33

Re: chained network-profiles

thanks for this information. Anyway, this simple hack can be used until netcfg2 is finally released. smile

Last edited by piie (2007-09-11 07:36:30)

Offline

#9 2007-09-11 08:49:39

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: chained network-profiles

piie wrote:

thanks for this information. Anyway, this simple hack can be used until netcfg2 is finally released. smile

This isnt in netcfg2, so I guess you might want to try and add it in -- best way would be to add it as a different connection type, rather than editing the existing connections.

Offline

#10 2007-09-11 11:39:46

piie
Member
Registered: 2007-02-20
Posts: 33

Re: chained network-profiles

oh, there isn't included something like that in the new netcfg. I'm going to create a patch for it as soon as I have some time.
- you don't have to edit the network profiles, just prefix them with a colon in the network_profiles array in /etc/rc.conf

Offline

Board footer

Powered by FluxBB