6

I often find myself accessing the Internet while travelling via either (gasp) dial-up or via a very limited data plan on a cell phone. I'd like to make sure that my laptop does not use the network connection for routine but unessential tasks [backup over VPN, uTorrent if I accidentally leave it running, etc].

Under Linux, I could easily do this using iptables. I'm looking for an easy [one click activation, or one script] way to do this under Windows XP.

Note that my machine does not run the Windows firewall [corporate policy], but a different one, and I can't modify the rules it imposes [including adding my own]. I do, however, have administrator access.

Thanks

Mikeage
  • 604

1 Answers1

1

This answer suggested using Netprofiles for a similar problem:

Features

    * Save your network settings as profiles.
    * Automatically activate wireless profiles when specified wireless connections are detected. (XP only)
    * Change IP Address, Subnet Mask, Default Gateway, Primary and Secondary DNS Servers, WINS Server, and DHCP settings with the click of a button.
    * Specifiy different mapped drives for each profile.
    * Change your default printer based on which profile you're currently using.
    * Automatically change your profile via program shortcuts created with Net Profiles.
    * Change the default homepage for Internet Explorer, Firefox, and Opera.
    * Proxy settings for Internet Explorer, Firefox, and Opera.
    * Run a user-defined list of programs when a profile is activated.
    * Maintain seperate desktop wallper for each profile.
    * Change screen resolutions and color quality when profiles are activated.
    * Can be easily translated into other languages using the enclosed XML language file. 

In this case, you could run a script that swaps in a HOSTS file (C:\Windows\system32\drivers\etc\hosts) that includes the sites you want to ignore as localhost aliases, eg:

# restrict access to certain sites without a firewall
127.0.0.1   my-ignored-site-1.com
127.0.0.1   my-ignored-site-2.com
127.0.0.1   my-ignored-site-3.com

Probably the easiest way to do this is to create two (or more) backup HOSTS files, say, HOSTS.normal and HOSTS.restricted, and put these entries in HOSTS.restricted. Then your script can copy HOSTS over with the HOSTS.restricted file when Netprofiles detects a restricted network, and another script copies HOSTS over with HOSTS.normal when Netprofiles detects a normal network.

quack quixote
  • 43,504