SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-04-26 01:01:40

jelloir
#! CrunchBanger
From: Outside the garden wall
Registered: 2009-08-21
Posts: 210

How To: Ethernet And Wireless NIC Bonding

I originally posted this on the techpattern's forum, but felt it would useful on #! Forums as well especially since Statler is using Squeeze, so I have recycled it here.

If you use a laptop and tend to swap between ethernet and wireless then this solution should work well for you.  The benefit of bonding your wireless and ethernet is that they appear as a single adapter which has a single MAC and IP address.  So when you disconnect the ethernet it will failover to the wireless and visa versa.  The benefits of this should be obvious, as networking will be completely seamless when switching interfaces and you will not lose connectivity or have to change IP addresses.

Since !# uses "network manager" this may cause some problems so I would follow this guide with caution, I have no idea if any network managers support bonding configurations.  I run Debian Sid without any network management software which is how this guide is designed to be used.

At the time of writing there is a bug in the version of ifenslave available in Squeeze and Sid.  You need to install ifenslave from Lenny and upgrade to the latest ifenslave version as a workaround.  This is fairly trivial.

In my case the commands looked like this. You will need to update the wget and dpkg commands with the package you end up downloading, choosing a closer Debian mirror is also recommended.

cd /var/cache/apt/archives/
wget http://ftp.au.debian.org/debian/pool/main/i/ifenslave-2.6/ifenslave-2.6_1.1.0-10_amd64.deb
dpkg -i ifenslave-2.6_1.1.0-10_amd64.deb

And then run an upgrade to get the latest ifenslave package

apt-get update && apt-get dist-upgrade

then update the interfaces config as follows.

Take a look at the examples in /usr/share/doc/ifenslave-2.6/examples/

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

#auto bond0
allow-hotplug bond0
iface bond0 inet dhcp
   bond-slaves eth0
   bond-mode active-backup
   bond-miimon 100
   bond-primary eth0

allow-hotplug wlan0
iface wlan0 inet manual
   bond-master bond0
   bond-mode active-backup
   bond-miimon 100
   bond-give-a-chance 10
   wpa-bridge bond0
   wpa-scan-ssid 1
   wpa-ap-scan 1
   #wpa-iface wlan0
   wpa-ssid wifi
   wpa-psk "wpapassword"

You may need to uncomment

#auto bond0

and comment out

allow-hotplug bond0

if it does not start automatically upon boot but I found hotplugging bond0 worked fine for me and avoids delays in boot.

Now for the fun part...  Reboot with your ethernet connected and then try pinging anything you like (Google's Primary DNS - 8.8.8.8 is always easy to remember), then pull the ethernet out and marvel at how it continues to ping without dropping a packet!!!

Cheers

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo