The Jon

Doing Some Bonding

I never really gave it much thought, but wouldn’t it be nice to unplug your laptop from the wired LAN and have it automatically switch over to wireless? And then when you need the speed to transfer some files, plug it back into the wired LAN and switch over automatically?

Until now, I have been doing the switching over with a script. It isn’t too much of a pain, just run a command as root when you [un]plug it. But most programmers (Linux users?) are lazy, so having it automatic is even better! Turns out that there is a bonding module for Linux that will do this. It has a few different modes, for example, round robin. But for this, mode=1 provides active-backup which will use the wired LAN unless it fails, then it will fall over to wireless.

Getting it working was as simple as compiling the kernel module, loading it, and setting up bond0 device and then bonding eth0 and eth1 to it. Quite fun!

Comments