networking - One network adaptor, one network. Two gateways, two internet connections

07
2014-07
  • Pedro Moreira
    • My network has two modems/gateways, each connected to a different ISP on a different line.

    • My computer has one network adapter.

    • Just to make sure everything is clear, this is all set up on one network, where every device can communicate with all others.

    By setting up static routing i can easily chose which internet connection i want to use. Now, I want to use both internet connections simultaneously, such that each program uses a different connection. I have tried:

    • Creating a virtual adapter with windows loopback adapter, configure it to use a different gateway than the physical adapter and use ForceBindIP to launch each program. But I could not get this to work (probably because there is no connection between the virtual adapter and the network?). I tried to create a network bridge between the two adapters (physical and virtual) but windows forces them to use the same gateway and i want each to use a different gateway.

    • Desperately trying to use virtualbox network adapter to somehow do the trick. But i dont know how to do this. If i create a virtual machine with "bridged connection" i can configure the VM to use one gateway while the host OS uses the other gateway. But i dont want to use VMs, I want the host OS to use both gateways.

    How can I use one network adapter to connect to two different gateways and then chose which programs use which gateway?

    Thank you very much!

  • Answers
  • Journeyman Geek

    I've mucked around with this. I simply had one system connect to both gateways (with different ip address ranges), and used a load balancing proxy.

    Connectify dispatch does this for you VERY simply , has a free version, and a paid version with more features.

    An alternative a free open-source alternative called dispatch-proxy that works well enough for me. It lacks most of the bells and whistles, but its free, and will work with any software that allows for a proxy server. I've run this with two wireless connections on different subnets and it seems to work as it should. Its a little complex (needs node.js) and lacks some features dispatch has.

    In this case, I'd run one instance per connection profile you want for maximum flexibility. I suppose in theory, if you didn't want very finegrained control and went the proxy route, you could run a small proxy bound to the ip address you want to use, and do the same.

    A third alternative might be to simply buy a dual WAN router, and have it as a single gateway.

  • William Hilsum

    As far as I am aware, you won't be able to do this on a per program basis from Windows unless it is a special program that does something which allows you to select the interface (e.g. wireshark).

    The reason for this, most applications that use networking on Windows simply use abstractions/shared libraries and are not aware of the physical network - the application simply makes an outbound request to a hostname or ip address.

    Now, if you had only a few applications and you know exactly what they are doing and what sites they are accessing, what you can do is set up a default gateway of the most used gateway and manually inject routes over the other one.

    For example, router a's ip is 192.168.0.1, router b is 192.168.0.2.

    If I want all my internet to go over router a, I would set that up as my default gateway. Next, if I wanted 8.8.8.8 to go over router b, I will then add a /32 static route for it. For example, on Windows:

    route add 8.8.8.8 192.168.0.2
    

    (Just learnt today, for /32, no need to define subnet).

    This will force 8.8.8.8 to go via the second gateway whilst everything else goes over router A.

    You are however giving yourself a management nightmare and I highly recommend you buy a load balancing router.


  • Related Question

    networking - How to split two networks for one Internet connection
  • Brett Veenstra

    I have a single Internet connection and I'd like to create two networks to access it.

    Network #1: WiFi accessible Network #2: Wired, not accessible from Network #1, but can still get to the Internet

    Are there any appliances for managing this configuration?


  • Related Answers
  • jtimberman

    You'll want to look into creating separate VLANs for the Wireless and Wired traffic. Separating the networks into VLANs will prevent the networks from being able to see each other at the data link layer. Your access point may already do this, but the procedures are different for each one, especially when using 3rd party firmware.

    For example, DD-WRT, a 3rd party firmware originally for Linksys WRT54G series WAP/Routers can do this. See how to use VLANs to detach networks, or how to create multiple detached wireless VLANs.

  • Jimmy

    Not sure if this would work (as I don't have time to scrounge devices to check), but can you make the networks parallel, e.g.:

                                |--- Network 1 (Wireless)
    Internet -- Switch/Router --|
                                |--- Network 2 (Wired)
    

    You'd then have to put some firewall rules to enforce communication restrictions between the two networks. If you were clever, you could probably pull it off without the extra device.