Seamlessly transition from wired to wireless in Linux

4

1

I have a Linux laptop running Ubuntu 12.04. I would like to be able to seamlessly transition from using eth0 to wlan0. When I say "seamlessly", I would like, for example, to be on wifi only with an ssh connection established to somewhere on the internet, plug in my ethernet cable, disconnect my wifi card, and still have my ssh connection established. Similarly, I would like be able to do all of the previous while grabbing a file with curl.

(Another use case: have multiple wifi cards connected to an AP, be able to remove all but one and maintain ssh sessions, etc. The application would be to provide redundancy in the case of unreliable wifi cards)

I am aware of ethernet bonding, is that what I am after in this case?

If this is not possible, would it be possible to explain why?

Note: I have already seen the following: Wired to wireless bridge in Linux Bridging my laptop's wireless and wired adaptors But they appear to be different use cases.

Thanks for the help!

cat pants

Posted 2013-11-20T22:40:25.910

Reputation: 635

2

Just applies for SSH, but perhaps you should look into mosh. It works pretty much exactly as you say.

– ssmy – 2013-11-21T01:01:15.090

I use mosh already :) but I need this to work for other protocols, so that's why I included the curl use case as well! Cheers! – cat pants – 2013-11-21T18:38:54.823

In your linux terminal, run this command: modinfo <your-wifi-driver> | grep ‘depend’. If the output includes mac80211, it means infrastructure mode is supported and hostapd should work. – Prahlad Yeri – 2013-12-07T17:37:24.970

To find <your-wifi-driver>, issue: lspci -k | grep -A 3 -i “network” – Prahlad Yeri – 2013-12-07T17:38:00.927

Answers

1

If I understand your question properly, this isn't possible in mainline Linux because the implementation of a specification called MultiPath TCP hasn't been widely adopted.

As I understand it, Linux will only allow a TCP connection to send data over one interface. While it is well documented that interfaces can be merged (see linuxlive), Linux will only manage which interface connections use, not individual network packets.

But there is hope! A fairly current set of kernel modifications, called MPTCP Linux, runs on Linux 3.11. Since you're running Ubuntu, you're doubly lucky - they have a custom Apt repository, with instructions at their Wiki page. You'd have to use a newer kernel, though.

new123456

Posted 2013-11-20T22:40:25.910

Reputation: 3 707

I started using Debian over Ubuntu, but hopefully – cat pants – 2014-03-07T22:57:56.563

@catpants Their Apt repository supports Debian too. As a historical sidenote, if we were using a modern protocol like SCTP instead of the 70's era protocols TCP and UDP, this wouldn't actually be a problem since it supports multihoming natively. A shame that nobody uses it.

– new123456 – 2014-03-07T23:19:46.743

0

Giving the same IP address to both interfaces works.

Timothy Baldwin

Posted 2013-11-20T22:40:25.910

Reputation: 141