Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Networking > Automaticially change network settings?

Automaticially change network settings?
Thread Tools
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
Apr 3, 2004, 10:10 PM
 
Is there a program that can change my network location automaticially, based on what it "sees" on the network?

Three ways I can think of to do this to make my life easier:

1. Use DHCP, and see what the IP is. For example, set it to home when it is 192.168.42.x, and set it to work when it is 10.x.x.x.

2. Set the network location based on what wireless hubs can be seen.

3. Detect what other machines it sees on the network. I know specific servers that will always be there at work, and at home certain devices on the network as well.

Reason this would make things easier for me is due to mandatory proxy settings at work, and one at home that isn't mandatory, but blocks ads. It would be nice to have a switcher program with some logic, so that when at home, it is set to Home, when at work, set to Work, and when elsewhere, fallback to automatic.
<This space under renovation>
     
Mac Elite
Join Date: Apr 2000
Location: Los Angeles, CA
Status: Offline
Reply With Quote
Apr 4, 2004, 09:50 AM
 
This is possible in Linux though I think it could be done in Mac OS X, though nothing comes to mind at the moment.

What a friend and I did for a Linux setup was to have a script running that would monitor the IP Address given out by the DHCP server as you described. If it detected a pattern, it would switch to the appropriate location, making changes in different services as necessary (e.g. proxy servers, DNS servers, SSH bounces, etc.). To avoid switching to a previous location in a new environment, we had the script record the DHCP server's address (and its MAC address eventually) to know if we are in the correct location, otherwise, it would inform the user of a new location and what steps to take.

I'm sure this can be done for Mac OS X as well, but I'm not sure how to tell the OS to "switch locations" from the shell.
     
Drakino  (op)
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
Apr 4, 2004, 11:22 AM
 
Based on this hint, the command scselect will do it.

Cron would be a way to do this, but isn't as automated as I would like. So any hints on the Linux program combined with scselect might get something working.
<This space under renovation>
     
Drakino  (op)
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
Apr 18, 2004, 02:30 AM
 
Well, I think I got this working. Going to test it out a bit more in different network enviornments and then think about releasing it.
<This space under renovation>
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:38 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2