Exercise 5-1: Linux/FreeBSD Ethernet Channel Bonding

Because I do not own enough equipment to build a useful lab, I leave this lab as an exercise to those who want to try. It is not difficult; just follow the instructions in the excellent Linux kernel documentation bonding.txt that comes with the kernel sources and look at the remarks in the ifenslave.c code. This is a truly versatile feature. As guidance, consider the following course of action:

  1. I suggest trying Linux-to-Linux bonding via crossover cables as a warm-up exercise. And here comes the good news: This also works with Gigabit Ethernet interfaces!

  2. If this works, try to bring up a Fast EtherChannel setup with a Cisco switch. I strongly suggest reading the Cisco.com white papers listed in the "Recommended Reading" section about the Cisco EtherChannel implementation, features, and caveats. Try a channel with two or four interfaces to avoid troubles. Do not expect this setup to work with either PAgP or LACP protocols!

  3. If you are blessed with a dual- or quad-port NIC that is recognized by your Linux system, try to configure bonding.

  4. If this works as well, observe the load balancing, play with parameters passed to the bonding kernel module, try different transmit policies, and pull one connection to see how the channel behaves.

  5. If this works to your satisfaction, try to configure VLAN trunks over your channel and repeat the testing procedure.

  6. If you are adventurous and familiar with Sun Solaris trunking configuration, you can try to form a Linux-to-Solaris channel. (Let me know how this behaves.)

  7. Try to configure a FreeBSD-to-FreeBSD and Linux-to-FreeBSD channel with the configuration and patch provided below.

If you are interested in the Beowulf cluster package, you can look at how this feature is used for scalable network I/O operation at http://www.beowulf.org/software/bonding.html.

As a little help, Example 5-28 offers a short description of how to configure Cisco-compliant Fast EtherChannel on FreeBSD with two interfaces (ed0, ed1) via the netgraph(3) library after applying the patch from http://people.freebsd.org/~wpaul/FEC/. Example 5-29 shows the resulting status.

Example 5-28. FreeBSD FastEtherChannel Setup

[root@castor:~#] kldload ng_fec.ko

[root@castor:~#] ngctl mkpeer fec dummy fec

[root@castor:~#] ngctl msg fec0: add_iface '"ed0"'

[root@castor:~#] ngctl msg fec0: add_iface '"ed1"'

[root@castor:~#] ngctl msg fec0: set_mode_inet

Example 5-29. FreeBSD FastEtherChannel Status Information

[root@castor:~#] ifconfig -a

fec0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500

        ether 52:54:05:e3:e4:88

        media: Ethernet none

        status: active