You are not logged in.

#1 2007-08-30 08:07:41

LiFo2
Member
From: France
Registered: 2007-03-29
Posts: 25
Website

Network profiles with multiple interfaces

Hi,
I'd like to use network profiles on my laptop as I'm using multiple access points, but there are some places where I need to access to networks at the same time (Internet by WiFi and a platform by Ethernet for example). I'd like to choose the profile at boot with the dialog menu.

Is it possible to configure multiple interfaces in a profile ?

Regards,
Colin

Offline

#2 2007-08-30 08:38:21

LiFo2
Member
From: France
Registered: 2007-03-29
Posts: 25
Website

Re: Network profiles with multiple interfaces

Forgot to say, I'd also like an empty profile, with no network at all (just activating lo) but I've got an error :
up: error fetching interface information: Device not found

Is there a way to do it ?

Offline

#3 2007-08-30 09:51:38

cheer
Member
From: Russia, St. Petersburg
Registered: 2006-08-02
Posts: 131

Re: Network profiles with multiple interfaces

put your profiles in /etc/network-profiles, see template file and the put in your rc.conf NET_PROFILES=(menu)

Offline

#4 2007-08-30 10:32:31

LiFo2
Member
From: France
Registered: 2007-03-29
Posts: 25
Website

Re: Network profiles with multiple interfaces

OK, maybe my question wasn't clear enough smile
I already configured some profiles and have it asked on boot thanks to the menu. The problem is for two profiles :
- the first one without network. I tried many possibilities, but none is working
- the second one with two interfaces : eth0 and wlan0. The problem is that the template only show how to handle one interface. How make it work with two (or more) ?

Offline

#5 2007-08-30 13:04:23

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: Network profiles with multiple interfaces

Can't you select one profile through the menu, then when you need the second bring it up (as root) with:

netcfg MYSECONDPROFILE

That should bring up another profile.


Matt

"It is very difficult to educate the educated."

Offline

#6 2007-08-30 13:36:03

shen
Member
Registered: 2003-09-05
Posts: 272
Website

Re: Network profiles with multiple interfaces

I use profiles on my laptop for the same reasons. I have multiple wifi networks I connect to and occasionally ethernet. What I do is setup a profile for each connection for example I have 2 one for home and one for school. Each file is named school and home and setup specifically for that connection. When the menu comes up I select the one I need. If I need to switch without a reboot I use netcfg profilename. If your profiles are setup correctly then you shouldn't have any issues at all. If it won't connect it's that specific profile. You might post your profiles for folks to look at. Just change the specific ip's, essids and security keys to bogus ones before posting..:)

Offline

#7 2007-08-30 15:27:53

LiFo2
Member
From: France
Registered: 2007-03-29
Posts: 25
Website

Re: Network profiles with multiple interfaces

OK, for information, here is my /etc/network-profiles dir :

[colin in ~]$ ls /etc/network-profiles/
home no-network  work-eth  work-wifi

The problem is that now, I activate work-wifi when I'm at work, but I'd like to also activate work-eth automatically, because I use both wifi (for Internet access) and ethernet (for access to private network). Now, I have to activate this second profile manually. It would be nice to merge the two files in one to obtain this :

[colin in ~]$ ls /etc/network-profiles/
home no-network  work

with work containing configuration for both wifi and eth.

Also, the no-network profile does'nt work :

#
# Network Profile
#

DESCRIPTION="No Network"

# Network Settings
INTERFACE=
HOSTNAME=zorglub

But it's not a big problem as selecting another profile is just fine.

Offline

#8 2007-08-30 16:06:56

shen
Member
Registered: 2003-09-05
Posts: 272
Website

Re: Network profiles with multiple interfaces

I don't know of a way to activate multiple interfaces in a single profile with the current netcfg setup. Something you could do is write a script for each interfact and load it via the rc.local file. Have say a work-wifi and awork-eth in you home direct with +x set.

Example:

ifconfic ethX up
ifconfig ethX up
iwconfig wifi settings
dhcpcd ethX
dhcpcd ethX

Now I don't know if that will work just the basic commands to perform the tasks in cli. Now I would say use netcfg in rc.local but it will switch profiles not load two at once as far as I know. Another may be to write the script and just execute it after boot at cli manually. Granted these aren't as clean as using profiles but the best I can come up with atm.

Offline

#9 2007-09-28 00:52:27

jason.foz
Member
From: Alabama
Registered: 2007-09-19
Posts: 9

Re: Network profiles with multiple interfaces

Ok, seems the multiple networks issue has been addressed, put how about the no network part?  Say I want to work somewhere and not have the network fail but just not start an interface?

Offline

#10 2007-09-28 13:30:25

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

Re: Network profiles with multiple interfaces

netcfg can have multiple profiles running at once, so long as they're not using the same interface.

eg: a profile on eth0 can be up at the same time as a profile on wlan0.

James

Last edited by iphitus (2007-09-28 13:31:06)

Offline

#11 2007-09-29 00:07:31

jason.foz
Member
From: Alabama
Registered: 2007-09-19
Posts: 9

Re: Network profiles with multiple interfaces

But what if I want to not bring up a network interface at boot and I have the (menu) option set?  What do I put in the config file for that?

Offline

#12 2007-09-29 00:18:39

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

Re: Network profiles with multiple interfaces

jason.foz wrote:

But what if I want to not bring up a network interface at boot and I have the (menu) option set?  What do I put in the config file for that?

At boot? there's no option.

But when the system is running, you can just do "netcfg profilename"

As I said in a similar thread, in netcfg2, just write up a new connection type, and you can combine multiple profiles under one name.

James

Offline

#13 2007-09-29 01:00:40

jason.foz
Member
From: Alabama
Registered: 2007-09-19
Posts: 9

Re: Network profiles with multiple interfaces

Ok, great you answered my question, thanks.

Offline

Board footer

Powered by FluxBB