Enable NIC Teaming/Bonding in Linux with Cisco Catalyst 6000/6500 Series Switches

Just about all new servers today have multiple NICs installed.  A great way to take advantage of those NICs is to team/bond them together.  NIC teaming/bonding is a great feature to add more availability/redundancy, and higher bandwidth to your server.

There are many different types of teaming that you can do.  This site lists all the available modes under Linux: http://www.linuxhorizon.ro/bonding.html **NOTE: NIC Bonding/Teaming on Windows is determined by the network driver.  Please consult your vendor’s documentation to enable the feature.**

Some of the NIC teaming modes will work without any additional switch configuration, however, other’s will not.  I will demonstrate how to perform NIC bonding on Ubuntu Linux 10.04 using mode 4: 802.3ad Dynamic Link Aggregation.  This mode will require switch configuration, as it will require the use of the LACP protocol.  I will demonstrate how to configure a Cisco Catalyst switch to support this feature, and setting it up is a lot easier than you think.  Despite these instructions being performed on Ubuntu, they should also work on other Linux distributions.  The switch configuration instructions are also applicable for Windows servers utilizing 802.3ad (LACP) NIC teaming.

Host Configuration (Linux):

The instructions that I used to set up NIC bonding in Ubuntu Linux 10.04.1 were very nicely outlined in this YouTube Video: (The video utilizes bonding mode 1: Round Robin. I would recommend mode 4: Link Aggregation)

For those who don’t have access to YouTube, follow the instructions below:

  1. Install ifenslave. On Ubuntu this can be performed by: sudo apt-get install ifenslave
  2. Create aliases for the bond.  To do that, a new file will need to be created at /etc/modprobe.d/aliases.  On Ubuntu, simply running the command: sudo nano /etc/modprobe.d/aliases will open a text editor and create the file.
  3. In the file, type the following and then save the file:
    alias bond0 bonding
    options bonding mode=4 miimon=100
  4. Modify the interfaces file to add the bond0 interface. To do that, first open /etc/network/interfaces. On Ubuntu, simply run the command: sudo nano /etc/network/interfaces.
  5. Comment out all existing network interfaces that are active.
  6. Add the following to the file:
    auto bond0
    iface bond0 inet static
        address <<insert ip here>>
        netmask <<insert netmask here>>
        gateway <<insert gateway here>>
        slaves eth0 eth1 # Place in the nic interfaces you are bonding
        # Place whatever other network info you need here.
  7. Save the file.
  8. Shutdown your server, and configure your switch. Once your switch is configured, turn your server on.

For troubleshooting issues, remember that your bond0 interface is seen by the OS as any type of ethernet interface. ifup and ifdown commands will work on that interface.

Host Configuration (Windows):

As mentioned above, this is dependent upon your drivers.  Please consult your driver documentation and software to enable this option.

Switch Configuration (Cisco Catalyst 6000/6500 Series [Running IOS]):

Log into your switch.  Once logged in, you must enter enable mode.  Next, follow the steps below:

  1. Configure your terminal: conf t
  2. Select the interface range you are using for the bonded/teamed interfaces: int range [starting interface] - [last interface number]
  3. Once you have the interface range you wish to modify, add in the following commands:
  4. shut
    switchport access vlan <<insert your vlan number here>> # All bonded interfaces must be on the same vlan
    channel-group <<insert the channel group number here (explained below)>> mode active # See below for more information
    # Place more interface configuration here (if needed)
    no shut  # Don't forget to turn on your interface
  5. Test the configuration, and then save it if you are happy with it.

In step three above, you need to make a channel group. A channel group tells the switch to treat the specified interfaces as one logical entity. You can have more than one, so pick the number corresponding to the host you are providing the nic teaming to. There are two modes that provide LACP functionality: active and passive. Cisco recommends that you enable active mode by default. I have found that this depends on the server. On the Windows servers that I have worked with, active mode worked just fine. However, on the Linux servers that I have tried this with, passive mode worked better.

That should be it. If I made any mistakes, or if you feel that more should be added, please feel free to leave a comment.

Copyright © /sarc All Rights Reserved · Using modified version of Green Hope Theme by Sivan & schiy · Proudly powered by WordPress