Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Looking for a better way to move from network to network
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Vyeperman
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2003
Posts: 89

PostPosted: Sat Jun 19, 2004 7:39 pm    Post subject: Looking for a better way to move from network to network Reply with quote

Hey,
My laptop is moving from 2-4 networks a day and I have all the static/gateway information in my /etc/conf.d/net but it's really getting annoying to haft to open that file up comment out one line and uncomment another then kill eth0 and then start it. What do you guys do is their a better way to do this?
_________________
-Vyeperman
Back to top
View user's profile Send private message
JPMRaptor
Guru
Guru


Joined: 04 Oct 2002
Posts: 410
Location: Maryland

PostPosted: Sat Jun 19, 2004 7:43 pm    Post subject: Reply with quote

My way is not much better (I don't move it very often). I have several net files (net.home, net.dhcp, ...) and I create a symlink for net to the appropriate one. I still have to do the net restart, but at least I'm not editing the files over and over again.
_________________
Underwater photo gallery
New pictures, Oct 2005
Back to top
View user's profile Send private message
Vyeperman
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2003
Posts: 89

PostPosted: Sat Jun 19, 2004 7:46 pm    Post subject: Reply with quote

Hmmm is their a way to make it guess when it boots? like have a few options then it tries them on the network and finds the correct one?

I don't know if that is even a valid Idea. Anymore ideas?
_________________
-Vyeperman
Back to top
View user's profile Send private message
JPMRaptor
Guru
Guru


Joined: 04 Oct 2002
Posts: 410
Location: Maryland

PostPosted: Sat Jun 19, 2004 10:14 pm    Post subject: Reply with quote

It sounds like a valid idea, don't give up hope. Looking at the /etc/init.d/net* script I don't see how it's loading the /etc/conf.d/net file. The only place that shows up is in comments in the script. Hopefully someone else out there knows how it's getting loaded.

Once we figure out where it's getting loaded it shouldn't be too bad to do a little test for something that would load an alternate file.
_________________
Underwater photo gallery
New pictures, Oct 2005
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Sat Jun 19, 2004 10:41 pm    Post subject: Reply with quote

The /etc/conf.d/net "script" contains only variables; it is sourced at the beginning of /etc/init.d/net.

Just make a few one-liner bash scripts, one for each network.
Since this is Linux, all you need to do is change ifconfig and resolv.conf and you ARE on a different network.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5947

PostPosted: Sat Jun 19, 2004 10:52 pm    Post subject: Reply with quote

There is a way to specify what net settings to use on boot, it involves duplicating the "default" runlevel, modifying it, and telling your boot loader to load the other level. I can't remember which section it was in, take a poke around. HTH
Back to top
View user's profile Send private message
groover
n00b
n00b


Joined: 04 Jan 2004
Posts: 38

PostPosted: Sun Jun 20, 2004 8:02 am    Post subject: This problem is solved Reply with quote

Hey guys.

I had the same problem, had... A fried developed "autonet", you can find it here:
http://freshmeat.net/projects/autonet/

This one checks your networking configurations at bootup after /etc/init.d/net.eth0 has been started and tries to setup up to a working internet connection.

sebas developed autonet for Debian and Gentoo, and in my case it runs great!

But than there's the next problem... (and sebas is on holidays, so he can't enhance autonet about the following function).

I think, I need something, let's call it "netexec".
When I'm at work it takes about 15 Minutes, that netmount fails all nfs shares I use in my localnet at home. It really sucks!, and I can't imagine, that there is no possibility to solve the problem, that you need to disable bootup functions, in example netmount.
When sebas is back again, I know, he will develop netexec as a sub to autonet, but for now there seems to be no other way to get this running?

Thanks a lot,

groover.
Back to top
View user's profile Send private message
groover
n00b
n00b


Joined: 04 Jan 2004
Posts: 38

PostPosted: Mon Jun 21, 2004 4:17 pm    Post subject: netexec Reply with quote

Hello,

the problem about dynamically starting services depending on the current network configuration found out by autonet is solved in pre_alpha :)
I wrote a small script in perl and an init script and a config file for /etc/conf.d -> "netexec"
You can download this on my server at:
http://streik.no-ip.org/~groover/netexec/netexec.tar.bz2
Perhaps you like it :)
If yes, please let me know. I think there are good instructions in the give README file.

Greetings,

groover
_________________
If I was you, I'd like to be me.
Back to top
View user's profile Send private message
cpr
n00b
n00b


Joined: 14 Apr 2004
Posts: 22

PostPosted: Fri Jun 25, 2004 6:31 pm    Post subject: Reply with quote

You can try hprofile, that script already offers all one needs. hprofile is in portage.

When I roam, I type as root e.g.
Code:
hprofile net.dhcp

and replug / insert my wlan card.

The docs explain everything in (overwhelming) details.
Back to top
View user's profile Send private message
flybynite
l33t
l33t


Joined: 06 Dec 2002
Posts: 620

PostPosted: Sat Jun 26, 2004 6:26 am    Post subject: Reply with quote

quickswitch is in portage also, designed to do just what you need.

http://www.newsforge.com/article.pl?sid=01/12/22/2118213&mode=thread

http://muthanna.com/quickswitch

Just adding more options....
Back to top
View user's profile Send private message
groover
n00b
n00b


Joined: 04 Jan 2004
Posts: 38

PostPosted: Mon Jun 28, 2004 3:35 am    Post subject: Sorry Reply with quote

... but hprofile and quickswitch are not, what I need.

I don't want to do anything! Everything should be done completely automatically! That is, what autonet and netexec do.

sebas and I figured out a bug in autonet what makes netexec broken, so I decided to develop netexec standalone with no more dependencies to autonet.

But, thanks for your replies.

Greetings, groover
_________________
If I was you, I'd like to be me.
Back to top
View user's profile Send private message
Vyeperman
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2003
Posts: 89

PostPosted: Tue Jun 29, 2004 12:56 am    Post subject: Reply with quote

quickswitch looks like what I need, I'm compiling it right now. Thanks!
_________________
-Vyeperman
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum