I have access to the Internet through either wireless or a 3G CDMA card. Is it possible to bond both connections and join the bandiwdth and have a failover?
Bonding wireless and 3g on Fedora 15
wifi;internet;bonding;mobile;3g
Ethernet bonding requires that both ends on the link support bonded interfaces and must be part of the same network space. Usually bonding is only done as far as a computer to the nearest switch. You cannot bond two different routes to the Internet. Your 3G card is going to have an address from your cellular provider, and your Wi-Fi from some other ISP. You have no control over the far side of these and how traffic gets routed to you, so bonding is out of the question.You can of course configure your machine to use the interfaces as a fail-over. Usually NetworkManager takes care of this pretty well by default. If one dies, it sets up the routes to use the next active connection.You could configure your routes such that some traffic used one interface and some another. For instance everything to Google went over one and everything to StackExchange went over the other. This is IP level routing which Linux is really good at. You could also configure some sort of proxy-cacheing service like squid to do round-robin style outgoing connections. This is a little trickier, and for a single user environment would probably result in a net-loss of overall usable speed.Lastly it might help you to make good use of your two lines if you understand something about the theory behind bonding and why it wouldn't work for two lines of very different speeds. If you have two different batches of traffic and you just want to spread them across multiple resources that's one thing. But when you start talking about bonding, you are talking about two parallel lines that everything gets split across. If one of these lines was slow (or in the case of CDMA, latent) and one was fast, the unbalance could potentially slow things down as much as it would speed them up. For any operations that needed sequential data, one connection would end up waiting for data coming in on the slower network. Even if a download got put on the faster wire, if the DNS request got sent over the latent network, it would take that much longer to get started. The effect really isn't the sum of the two networks, only the sum of the slowest segment plus about that much equivalent from the faster one. If two channels of a bond ran at 5 units and 1 unit, the bond might effectively give you 2 units. Or 3 if it was really smart. But those smarts have to come from somewhere, and the Internet doesn't do this for you, some single point upstream (usually the switch upstream from your computer) has to have the smarts to split traffic to you and merge traffic from you.* Note that this math doesn't work the same when you have a real bonded network. A 1000 and 100 interface can be bonded to get 1100, but thats only when done at the packet level and latencies are comparable. When using poor-man hacked solutions to expand Internet bandwidth, other factors eat away the gain pretty fast.