LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   More than one network with a laptop (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/more-than-one-network-with-a-laptop-111853/)

MrSmee 11-03-2003 10:46 AM

More than one network with a laptop
 
This question has probably been addressed before, but I can't seem to find the answer I am looking for.

Here is my problem,
I recently got Slack installed on my trusty old dell laptop, and everything is up and running, but I'd like to configure a script or some such animal so that I can choose between different network profiles.

Here are the networks I connect to:

Network 1 -- Home, Use PPPOE to connect to my DSL Modem
Network 2 -- Workplace 1, use DHCP to connect to the router and the rest of the network

Network 3 -- Workplace network 2, have an assigned IP address and DNS servers.

What I am looking for is a way to tell slack on startup what network I am currently on, or in some cases that no network will be present (like sitting in the car, playing a game while my wife drives

Thanks
Smee

Eqwatz 11-03-2003 02:15 PM

First google.com/linux every key word you can think of concerning what you want to do--someone may have already written a network "switcher" of somekind. Most laptops have a utility for windows that does that--I suspect a linux-user probably liked the idea and duplicated it.

/***I just came up with forth way. Duh. Compile a kernal for each one, making it as clean and precise as possible, and making a complete config file for each one. You should also be able to pass init parameters--options in the grub or lilo configuration file for each kernal which would point to the network settings file you would create for each one. This would automate your set-up scripts and booting to a different kernal would over-write the settings with alternate ones or alias different configuration files. Badda-bing! Updating would be a bitch though.***/

The easiest way with two different networks is to use the runlevels and create custom set-up for each runlevel chosen.

But with three, you are probably better off with a bash script for each custom set-up.

You would start the machine with no network or related services set to run.

Then you would have to write your scripts to do an automated network set-up. Each script with a name not being used anywhere else. Be careful to do that. A script is nothing more than one console (command-line) command per line--triple check your syntax.

I will tell you this, it will probably be a bitch.

The services have to be configured and started in order.

Don't have anything running when booting as you have to configure inter-dependant services.

You will be creating links and configuration settings to be inserted into config files all over the place--or setting up copies of the files with the different settings in them, renaming them, and using the "alias" command. Essentially what you will be doing is the networking portion of the "init-scripts"--which would normally run at boot time.

You are going to have to plan it out on paper and read all of those scripts to give you the commands and syntax. Don't forget: you have to clean it all up when shutting everything down--and it is best to automate that as well so you can just "poweroff" or what-ever you use to shut down. And do some "test" statements also to insure that services aren't already running or configured somewhere else.

Once the scripts are written and tested, you can put an icon/button/shortcut for each on your desktop. After that, it is just point-and-click.

While writing this I can see at least three different ways to do it--none of them very easy.

MrSmee 11-03-2003 03:07 PM

Well, I've not found anything I really need to do can be done the "easy" way... thanks for the advice, and if I never reply again, you'll know I failed....

Smee

Ginux 11-03-2003 05:24 PM

Hey guys I found these googling around... really hope this helps

http://archives.neohapsis.com/archiv...1-01/0009.html
http://portal.suse.com/sdb/en/2002/0...ES_SUSE_8.html
http://www.linuxquestions.org/questi...003/09/1/88002
http://www.redhat.com/docs/manuals/l...-profiles.html

I put my bets on the last one... The first 3 are to give ideas, maybe someone will come up with a better idea or something...

hope this really this helps

Ginux

Found a better one http://www.kplug.org/lmbp/ :D :D :D :D

God I love GOOGLE!!!!! :study: :p :D :cool:

HEEEELPPPPP I'm on fire..... {sorry guys}
http://www.rajeevnet.com/linux/bootprofile/

Man 3 updates... I have to layoff of coffee :D


All times are GMT -5. The time now is 09:46 PM.