10

I have a 3G wireless modem and I have a LAN - Right now they are both connected.

I need a way to choose which applications will use the 3G connection and which applications will use the LAN.

My Operating System is windows 7. How can I do this? Any ideas?

Here is a route print: - the 3G modem's IP is 10.81.132.96

Lets say, for example, map google.com to using the 3G internet connection.

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.2.1    192.168.2.102     20
          0.0.0.0          0.0.0.0     10.81.132.97    10.81.132.111    286
     10.81.132.96  255.255.255.224         On-link     10.81.132.111    286
    10.81.132.111  255.255.255.255         On-link     10.81.132.111    286
    10.81.132.127  255.255.255.255         On-link     10.81.132.111    286
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      192.168.2.0    255.255.255.0         On-link     192.168.2.102    276
    192.168.2.102  255.255.255.255         On-link     192.168.2.102    276
    192.168.2.255  255.255.255.255         On-link     192.168.2.102    276
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link     192.168.2.102    276
        224.0.0.0        240.0.0.0         On-link     10.81.132.111    286
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link     192.168.2.102    276
  255.255.255.255  255.255.255.255         On-link     10.81.132.111    286
===========================================================================
1

4 Answers 4

6
+25

Windows always controls which network connection is used. If you have multiple active network connections to the same network, then Windows will use the first one listed under Network and Sharing Center->Change adapter settings. Other network connections are unused.

If you have two network adapters and you wish to force the usage of one specific adapter, then there are two cases to consider.

1. Application uses a known website

If a given application uses only one or several known websites, and if the wired and wireless networks use different ranges/segments of IP addresses, you can use the IP address of the website(s), together with the route command to add entries in the local IP routing table that will direct such requests to these addresses through a given adapter.

For example,

route add 88.99.0.0 mask 255.255.0.0 10.0.0.1

will send all the traffic for 88.99.x.x to the next hop address of 10.0.0.1, which could be the address of the router. The router will have in this case two IP addresses over the wired and wireless segments. Traffic that doesn't match a route is sent to the default route 0.0.0.0 normally associated with the first adapter in binding order.

This technique makes Windows use both network adapters indirectly, by actually placing each on a different network (e.g., 192.168.1.x and 192.168.2.x). If certain resources are only available on one or the other network or have routes leading to one or the other, then obviously Windows chooses the appropriate network connection.

This way doesn't control directly which network adapter is used on a per application/service basis. But there is a second solution.

2. Using a virtual machine

If you install a virtual machine manager like VirtualBox, you can create a guest virtual machine (VM) and connect its virtual network adapter to any of the host's physical ones.

This way, any application started in the VM will use the designated adapter, no matter its position in the host's adapter table, so you can divide network activities by choosing between host or guest as the execution media, while both host and guest can share files through network shares.

Windows 7 has XP Mode, which is actually a closely-integrated virtual machine. Although quite lame as virtual machines go, it might be possible to use it this way (or not, as I never tried).

2
  • Ty for responding, the route idea seems great but I don't understand how to set a route correctly - I get an incorrect parameter error. Let me give you some details: 3G IP : 10.80.140.208 / 3G Subnet Mask: 255.255.255.248 / 3G Gateway: 10.81.50.185 - and the IP of the site, lets say is google.com Can you please show me how to properly add this route? Ty
    – webmasters
    Dec 11, 2012 at 15:34
  • 1
    It should be something like : route add 74.125.132.0 mask 255.255.255.0 10.81.50.185 (google is 74.125.132.104). If this doesn't work check your metrics with route print, as the route with the lowest metric wins.
    – harrymc
    Dec 11, 2012 at 17:55
3

Check this tutorial out. It uses ForceBindIP to force an application to use a specific network card. The only disadvantage is that you have to run your programs with ForceBindIP each time you start them.

3
  • Very interesting find, but last release is from 2009.
    – harrymc
    Dec 13, 2012 at 8:09
  • 1
    If it works, it works! :)
    – ChrisN
    Dec 13, 2012 at 20:41
  • It's not working anymore on Windows 8.1.
    – user326006
    Apr 3, 2015 at 13:13
1

It hasn't been released yet, but Connectify Dispath promises to do just that: http://www.connectify.me/dispatch/

Edit: It's been released now.

0

If each application is only going to go to specific destination IPs, you can add static routes to Windows' routing table for the target addresses.

1
  • How to do this exactly?
    – Saw
    May 22, 2012 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .