Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To my amazement, I just discovered that my Ubuntu 13.04 system seems to support something like automatic network interface bonding.

If I establish a TCP connection over WiFi (eg using netcat on client and server), and then also switch on the wired interface, all further traffic on this connection seems to transparently go through the wired interface. I have verified that with Wireshark, and I can also tell from the change in throughput when copying files.

This works, however, only as long as I keep the WiFi connection established. If disconnect the WiFi, the TCP connection also breaks down.

The machine that I'm testing with has different MAC and different IP addresses for the WiFi and wired interface. They are connected to the same network though.

I do not have the ifenslave package installed, and I did not set up a bridge or anything like that either. I am using NetworkManager.

My question is: how does this work? Which layer is responsible for redirecting the packets, and how does it know where to send them? And why does this stop working if the WiFi connection is shut down?

share|improve this question

Ok, disappointing explanation. This is just the good old default route at work. NetworkManager adds a new route to the same network for each interface. The interface that comes up last then gets all the outgoing traffic.

The interesting thing is that this also works for incoming traffic. Once the remote host starts getting its ACKs from a different MAC that it has originally sent the data to, it updates its ARP table to point to the new MAC, so that from then on the entire communication goes through that interface.

I suspect this will break if there are firewall rules that prevent interfaces from accepting packets that are not for the configured ip address, but interestingly enough this is not done by default...

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .