If I have two internet connections on osx, how can I use both to increase my bandwidth?
I understand that any one connection (such as a non-p2p download) will use just one of the connections, but since most normal activity involves multiple connections at once, I can still in theory increase my overall bandwidth by sending some traffic over each connection.
See also the following similar questions, most of which are for windows:
Is it possible to combine two internet connections to increase performance?
How can I force certain applications to use specific network connections?
I have both cable and DSL at home. How do I put that to good use?
How can I use two Internet connections at the same time?
https://superuser.com/questions/246173/how-can-i-set-my-computer-up-to-use-two-different-internet-connections-simultane
Here's my partial self-answer:
You can use ipfw to direct outgoing traffic. For instance, if you want udp (such as most bittorrent traffic) to use one connection while everything else uses the other, make sure the general-use connection is above in the network control panel, then type:
ipfw add fwd ip.for.bittorrent.router udp from any to any out
at the command line. (Or use WaterRoof, the ipfw gui; then you don't need the "ipfw add" part.) Note that that's the router ip (typically similar to your ip but ending in .1).
Solution 1:
Bonding.
- Open System Preferences > Network
- Click the gear icon, then Manage Virtual Interfaces...
- Click +, then New Link Aggregate...
- Give it a name, and select the ethernet interfaces you'd like to bond
Note: works for ethernet interfaces only supporting the Link Aggregation Control Protocol. Does not work for other interfaces e.g. 3G modem via USB or DSL via Wi-Fi.
See this old, archived KB article for more information.
Solution 2:
Short answer: no. With 2 ISP links, you have 2 IP addresses. It can be done with some specific higher end NICs (e.g. Intel quad cards), but they will appear to the rest of the network as a single IP address in that mode. If the assumption is that you have 2 distinct IP addresses, it cannot be done.
What is possible would be to get a router that supports something like OSPF, which will for each connection determine the shortest path between source and destination, however that equipment is usually very costly (thousands of dollars). Another option would be to use 1 link for ingress and the other for egress traffic. This can be done with IPTABLES or Packet Filter (pf), but will not really boost your speeds by much since you'll still be limited by the ingress and egress speeds allowed on those links.
Solution 3:
The more common, production way to accomplish this is to multiplex two WAN connections using a device outside your computer. I've used a load-balancing NAT router to accomplish this at my work site for over a year and a half, and it works great.
Using a device such as a load balancing NAT router will allow you to connect an entire subnet or LAN to the two multiplexed internet connections instead of just your single computer. Your computer's NIC will send traffic to a single gateway on the LAN, and that gateway's NAT router will load balance the traffic out over both WAN connections to the destination on the WAN. When the traffic comes back from the WAN, the router re-assembles the received packets and sends the packets to the source on the LAN in a single, coherent stream. So the computer doesn't even know the connection is being multiplexed.
This can cause a problem on some sites which expect all traffic to originate from a single WAN ip address. For example, a site which uses cookies to maintain sessions for a logged-in user will see traffic originating from two locations using the same cookie. This can appear like a hijacked session, and many websites will block this. So you must find out which sites are sensitive to using two ip addresses and make a routing rule to send that traffic using only one of your two WAN IP addresses.
I use a Sonicwall TZ-210 to do multiplex two internet connections (device costs about $550). One connection is a cable modem with 10 Mbps down and 2 Mbps up, the other is a bonded T1 with 3 down and 3 up. The multiplexed connection is effectively 13 down and 5 up.
Solution 4:
Here is the answer in another thread:
How to use both my dual internet connections in the same exact moment on Mac OS X
Using an app named Speedify.