LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Using multiple network profiles? (https://www.linuxquestions.org/questions/linux-networking-3/using-multiple-network-profiles-52684/)

thas 03-31-2003 10:38 AM

Using multiple network profiles?
 
Hello all,

I've been using a "cut-and-paste off the web" + home brew script to switch my network settings every time I connect at home or at work. This is mainly because I use static IP's at both the locations. Lately, I also tend to use a WIFI card at home (which needs WEP encryption keys etc to be setup).
So my basic script allows me to choose between: home+wired or home+wifi or work+wired

Is there a more eligant way to do this? Can I use the PROFILE switch of kernel boot parameter to do this trick? If so, how can I go about it. I could not google much about this parameter. My recent install of Mandrake 9.1 appears to use 'prof=' boot parameter as well. How can I make use of this parameter?
I clearly don't want to start linuxconf every time and do the switch using it.

Any suggestions would be much appreciated.

-Thas

bahamat 03-31-2003 11:22 AM

What distro are you using?

Debian has several packages designed to switch network settings at boot time.

Something else you could do, is use one of your user defined runlevels to switch settings.

Say you've got 2 networks that you'll call A and B, and your default runlevel is 5. Set up runlevel 5 to copy the network settings from a network-settings-b file and reload the network. Then set runlevel 4 to do the same thing with A.

Another alternative, would be using DHCP for everything. If you have DHCP servers available on every network you connect to you only have to set it up once. Then all you have to do is take the interface down, plug into the new network and bring it back up.

Hmm, I could go on and on and on. Somebody turn me off, I'm coming up with too many solutions to your problem.

thas 03-31-2003 11:02 PM

Quote:

Originally posted by bahamat
What distro are you using?
I'm using Mandrake 9.1

Quote:

Debian has several packages designed to switch network settings at boot time.
Could you kindly list some? I'll see if there are mandrake equivalent ones (or I could rebuild them from source)

Something else you could do, is use one of your user defined runlevels to switch settings.

Quote:

Say you've got 2 networks that you'll call A and B, and your default runlevel is 5. Set up runlevel 5 to copy the network settings from a network-settings-b file and reload the network. Then set runlevel 4 to do the same thing with A.
I shall experiment with this approach.

Quote:

Another alternative, would be using DHCP for everything. If you have DHCP servers available on every network you connect to you only have to set it up once. Then all you have to do is take the interface down, plug into the new network and bring it back up.
This is not an immediate solution for me since I need static IP's at work and at home. I'm using an older version of OpenMosix at work and this requires static IP's. I use portforwarding through my firewall at home and this requires another static IP at home. Ofcourse, name server entries and gateways are completely are different at the two locations.


All times are GMT -5. The time now is 05:14 PM.