8

I have a Mac, which runs Mac OS X 10.6 or Ubuntu 9.10 or Windows XP (Multiboot). Solution can be for any of the systems, whatever works better.

I have two ISPs, one can be accessed via Wi-Fi, one can be accessed via LAN. In Mac OS X I can define the priority, which network to choose first. But what I wish to do is to load-balance with both networks.

I don't want to buy extra hardware. I have some unused Wi-Fi routers if this would help.

Compiling and configuring programs in Linux is no problem for me.

Similar question: Load balancing with multiple gateways

Synox
  • 230
  • 2
  • 7
  • 2
    You'll want to check that any solution suggested will have rules for persisting connections over its interface. If your connection bounces between ISPs, the server on the other end may get confused. I know, for example, that Yahoo IM will drop its connection if you connect from a different IP address. – Doug Harris Feb 12 '10 at 16:45
  • sounds like you need some kind of Wireless Multi-WAN repeater to soak signals from 2 different WIFI routers and feed it to your computer via a LAN connection. – djangofan Jun 25 '10 at 19:18
  • LISP (Locator/Identifier Separation Protocol) could be a solution, but this is way too complicated for me. ;-) – Synox Sep 13 '13 at 06:05
  • What do you want to load balance? – David Schwartz Oct 08 '13 at 08:45
  • big file downloads, Video-Streams, youtube, etc. – Synox Oct 11 '13 at 08:43

7 Answers7

1

A close-ish topic, for linux, would be the 'metric' setting for routes. Lower numbers are preferred over higher numbers. If you give both routes the same metric, then I would think they'd be chosen with equal probability.

I think the technique you're trying to achieve is called multihoming. I don't have any direct experience with it. However, a few things you'd probably need to keep in mind.

  • By default, I think you'll end up with only one default route. This means that all outgoing traffic will prefer one interface by default. You'd need to look into having multiple default routes, or into changing that route dynamically over time.
  • For the life of an individual incoming (TCP) connection, it should stay on the same interface which it came in on. I think.

Anywho, those are all the pointers I can think of at the moment.

pioto
  • 561
  • 2
  • 7
  • `metric` is a parameter for network interfaces in Windows and OS X as well; any OS which supports multiple network interfaces will require a means of setting precedence. – apraetor Nov 17 '16 at 21:41
1

You could use a routing metric system where you install both internet connections in your routing table with an equal metric. The operating system should then use both of these routes equally, effectively splitting your outbound traffic across both links.

Incoming traffic in reply to your requests should also be balanced as it will return to the interface (Public IP) that the request came out of.

The problem with this would be session persistence, for example you view a website via one of your links, but the next page view is load balanced out of your other interface, this would confuse some applications as your source IP address would be constantly changing.

Therefore I would probably only split some of your traffic onto the other interface using none equal cost routes, may be by application, destination or protocol. Just something that will keep your traffic paths consistent.

iTom
  • 573
  • 2
  • 5
1

Connectify Dispatch has a solution that will do just what you need. Currently for Windows only, but people have had success virtualizing and using their software on OS X.

Since you already run (were running) Windows XP I figured you'd be able to figure that part out on your own.


The biggest problem with this is that Windows easily offers support for multiple NICs, while on OS X it isn't nearly as easy to implement.

bemental
  • 21
  • 3
0

There is kind of a workaround: My application is able to load-balance, I can define 2 connections which are then used both.

I then route one of the Server IPs to one of the IPS.

on mac os 10.6:

route add -host XXX.XXX.XXX.XXX 192.168.1.1

I know, this is very specific, and only works if the server-ips are always the same. And if the application can load-balance in any way.

Synox
  • 230
  • 2
  • 7
0

I've heard this same question a dozen times a dozen different ways. First, internal sessions and external sessions are handled similarly, but are not the same. For every internal session, there could be multiple external, and vice versa. What you are talking about isn't logically impossible, but does require a bit of programming and prep. Some devices are being built with the ability to aggregate ethernet connections or wifi for faster network speeds internally on a network, but for external networking, I've only found devices with FAILOVER, which means they only switch when they have to. However, you could use a basic switching (if statements with 0 or 1) in the connection protocol that redirects traffic over a different gateway for each EXTERNAL session. You would then have to keep track of each EXTERNAL SESSION attatched to each INTERNAL SESSION, by wrapping a sub-session inside a main session with a sessionID. You would then have to have a way to check for the site domain or use the sessionID to complete the internal routing (in other words, you'd need to be able to differentiate messages from the client for each external session\connection based on which site they were requesting data from or sending data to so that the pipe for each site would be set, keeping the site from rejecting the pipe). This means you'd have to build a new network protocol into your router, and decide how to differentiate the connections (if only done by site domain, it might be doable from the router, but the client may try to use the ipaddress of the external gate for the website, which negates this; if done on both ends, the client needs to keep track of some identifier, typically a numerical value of binary masking, that allows the send recieve to be matched against the external session being routed on main gate). In other words, you'd have to program your own protocol to handle the networking, and you'd have to decide if you want to build it yourself (making use of both client and host programming), or if you want to build something that's compatible with older existing programming (which would need to be bound by the messaging between host and client, putting more wear on the host but nothing new for the client). If you know your unix, or you know your winserver programming, this can be done with just a bit of time, but it requires a larger amount of resources be allocated for each device being balanced.

For larger corporate style networks, you can mesh the networking, and give each floor or department a dedicated gateway, allowing for multiple ISP's, and never putting too much on any one of them. You can also have Failover handled by a hub that sends changes or redirects to a different gateway when one of them has trouble. This offers some fault tolerance.

fixer1234
  • 27,064
  • 61
  • 75
  • 116
  • 2
    Your answer is more likely to get read if it isn't a wall of text. Please take a minute to divide it into paragraphs. – fixer1234 Jun 22 '19 at 23:40
  • I did. But the interface posted it as a wall of text anyway. – Htd Tech Jul 26 '19 at 20:26
  • Just for reference, the answer for load balancing a single connection is that it's really not feasible if you're not working on it at both ends. But for the purposes of speeding up web access, there are some third party multi-NIC cards that will access internal networks simultaneously. If you have multiple isp services, you can allow your system to handle the bandwidth balance. This isn't really applicable for gaming or for uncompressed video, since both ends negotiate for packet sizes, but if you are online a lot for work, it's feasible, and will get some performance increase. – Htd Tech Jul 26 '19 at 20:31
  • I only found one paragraph break and fixed that. The "secret" is that you need a double return (a blank line) between paragraphs. Otherwise, the system runs it together for your convenience. – fixer1234 Jul 26 '19 at 21:54
0

I don't think this will be possible without doing something like all traffic going out is one ISP and traffic coming in is another ISP.

Reason being is splitting both traffic across 2 separate networks doesn't seem like they would make it back. If you had 2 pipes from 1 ISP it might make be possible.

Like the person said earlier, I think you'll need a default anyways and could curb certain traffic through one route and the rest through another. Just don't think load-balancing like you would on a LAN will work here.

Example: run updates using 192.168.2.* Wi-Fi ISP run halflife using 192.168.1.* LAN ISP.

Johnny
  • 19
  • 1
0

The url mentioned below is specifically meant for win 7 but you should get an idea from it. It changes the metric of default gateway depending on the load on the interface, thus leading to load sharing.

http://www.youtube.com/watch?v=Qh5Eb8sXvuk

Samir Sogay
  • 323
  • 2
  • 11