Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I read about Ubuntu Bonding and how it allows to bond multiple connections to get several advantages.

My requirements is this :

  1. I want two different interfaces at a time (A wifi and other Ethernet)
  2. Either I should be able to route all the traffic from Chrome to Wifi and from Firefox to Ethernet

or

Route all the traffic from one particular site through wifi and everything else through Ethernet.

Will it be possible through Ubuntu Bonding ?

Anything else I can do to achieve this ?

share|improve this question

2 Answers 2

Channel bonding

What you're talking about is channel bonding. That won't do what you're describing however. Bonding like this combines 2 NICs together so that they're combined into a unified NIC device which is then assigned a single IP address.

Routing

To do what you want you'd need to either do it using traditional routing rules, setting things up so that all the traffic designated for the WiFi would be routed through the device based on the IP addresses you want to favor this device. Everything else would be routed via your system's default gateway (GW) in your routing table to the Ethernet NIC.

NOTE: The above can be accomplished with the route and/or ip route commands.

An example of what you'd want to do is discussed here in this SF Q&A titled: How to route different traffic thru different network interfaces (Windows). Recognize that these commands are showing how to do the setup using Window's route command which has different command line switching than the Linux version. The approach is however what you want, so they could be adapted to the Linux equivalent route command.

Use ip instead of route

The route command is however considered deprecated and so going forward the ip command (part of the iproute or iproute2 packages) should be used instead.

excerpt Linux route command

In Linux distributions based on 2.2.x Linux kernels, the ifconfig and route commands are operated together to connect a computer to a network, and to define routes between computer networks. Distributions based on later kernels have deprecated ifconfig and route, replacing them with iproute2.

You can read about advanced routing techniques here in this tutorial titled: Two default routes.

References

share|improve this answer
    
Your link points to a windows solution. –  BatchyX Apr 5 at 19:41
    
@BatchyX - yup I know, the commands are the same regardless from the command line. –  slm Apr 5 at 21:00
    
Not at all. On windows, it's route add 192.0.2.0 mask 255.255.255.0 192.0.2.1, On linux, if you want to use the prehistoric route command, then it's route add -net 192.0.2.0 netmask 255.255.255.0 gw 192.0.2.1 and if you do The Right Thing and use ip route, then it's ip route add 192.0.2.0/24 via 192.0.2.1. –  BatchyX Apr 6 at 8:39
    
@BatchyX - sorry I should've qualified that comment. The commands being they both use route. The switching is different as you mentioned. I'll find a more suitable example as well. –  slm Apr 6 at 14:13

No it's not. Bonding mashes the two in to a single pseudo interface and load balances across them. What you want is sort of the opposite of bonding.

It looks like what you want is more like what is discussed in this thread.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.