5 ms·
Yep, I used to do that when I had a thinkpad and a docking station and didn't want all my ssh sessions to drop. Before that I was even doing awful things like
by cmsj 4y ago
Yep, I used to do that when I had a thinkpad and a docking station and didn't want all my ssh sessions to drop.
Before that I was even doing awful things like forcing the same IP onto both eth and wifi :D
- zootboy 4y agoI've had a concept in mind for this exact scenario that I'm reasonably certain will work, I've just never taken the time to fully implement it. No need to bond interfaces or apply the same IP to both interfaces. Let them both acquire different IP addresses in the same subnet. Linux will start announcing its ARP replies on the ethernet path since it has a better path metric. Thus the return path for both the wifi IP and the ethernet IP will become the ethernet link. Any existing connections that were traveling over the wifi link will just move onto the ethernet link automatically. The only difficulty is new connections. Since the ethernet path has the better metric, new connections will establish with the ethernet link's IP address. But the routing table can be adjusted to instead make the wifi link's IP address the default for both the wifi and the ethernet links. Then new connections will always use the wifi IP, and will migrate over to the wifi link when the ethernet link disappears. This should work as long as your wifi link always remains up whether or not you're in the dock.
- linsomniac 4y agoI guess you could do this by just sending gratuitous ARPs for the wifi IP with the eth MAC addr, over the eth interface. Probably have to turn off rp_filter as well?
- zootboy 4y agoYou don't even need to do that. The ARP packets seem to be routed to the network through the normal route table, so replies for the wifi IP get sent via the ethernet link and the network switches seem to learn that as the return path. As for rp_filter, it's set to "2" on my machines, which seems to allow return packets on the "wrong" port as long as it's an address that any other port owns.