using wireless (3G) and lan at the same time in windows 7

Posted on

QUESTION :

I am working on customer’s site and here i have a very restricted lan (no gmail, no corporate mail) but i need the lan for som services (intranet, svn, jira…).

My laptop has a built in SIM with 3g. Is there any way to use both connections at the same time and configure the route to take by ip/url? My first try was to manipulate the provided pac file and add some proxy exceptions:

...
function FindProxyForURL(url, host){
 ...
 if((shExpMatch(url, "*mail.google.com*"))||
    (shExpMatch(url, "*myCompany.com*"))||
    ...
    return "DIRECT";
...

But this is not working. For gmail i get an dns error (gmail could not be resolved) and outlook can’t connect to my company’s exchange server. So is there any way to get both to work at the same time (without unplugging the lan and reconfiguring the proxy settings each time?)

(My machine has windows 7 64bit pro)

ANSWER :

In situations like this I usually use static routing towards the company sites, and use the alternative connection as default gateway. Was a while since I did this on Windows so my apologies if the syntax is not 100% correct.

List your current routes, just for reference.

print route

Syntax for add a new static route, gateway is the key here. Use the gateway for the interface you would like to connect through.

route add <destination> mask <net-mask> <gateway>

Here’s an example for a single host, and a range.

route add 192.168.10.67 mask 255.255.255.255 10.6.10.1
route add 192.168.8.0 mask 255.255.255.0 10.6.10.1

And now you’re good to go. This is not saved after reboot, so making it to a script could be handy. And for some further reading on the subject, have a look here.

UPDATE

To change your default gateway you could use the route command as well. In your case you would like to use the gatway of your 3G connection.

route add 0.0.0.0 mask 0.0.0.0 <gateway>

Leave a Reply

Your email address will not be published.