Novell Home

Setting Up Bonding on SLES 9

Knowledgebase

Concern

You want to combine several physical network cards into a virtual one. This article does not describe the possible options and features of bonding but simply explains how to set it up on SUSE LINUX Enterprise Server 9. For additional information on bonding itself, please refer to the file /usr/src/linux/Documentation/networking/bonding.txt, provided the kernel sources are installed on your system, or visit the home page of the bonding project.

Prerequisites

To avoid problems it is advisable that all network cards use the same driver. If they use different drivers, please take the following into consideration:

There are three driver-dependent methods for check whether a network card has a link or a network connection.

  • MII link status detection

  • Register in the driver netif_carrier

  • ARP monitoring

It is very important that the used drivers support the same method. If this is not the case because e.g. the first network card driver only supports MII link status detection whereas the second driver just supports netif_carrier, the only solution is to replace the network card in order to use a different driver.

To find out what method is supported by your driver, proceed as follows:

  • MII link status can be determined with the tools mii-tool or ethtool.

  • In the case of netif_carrier and ARP monitoring, refer to the driver's source code to find out whether these methods are supported or not. The corresponding kernel sources must be installed for this purpose. Regarding netif_carrier, search exactly for this string in the driver's source code, e.g.

    grep netif_carrier via-rhine.c
    

    As for the ARP monitoring method, the driver must support either the register last_rx or trans_start. Thus, you can search in the driver's source code for:

    grep "last_rx\|trans_start" via-rhine.c
    

Start with the setup only after having verified this.

Procedure

In this sample scenario, two network cards will be combined by way of bonding mode=1 (active backup).

  1. Configure your network cards with YaST. Allocate the IP address that must be used for the bonding device to one network card and a dummy IP address to the rest of network cards.

  2. Copy the configuration of the network card with the right IP address to a file ifcfg-bond0.

    cd /etc/sysconfig/network
    cp ifcfg-eth-id--xx:xx:xx:xx:xx:01 ifcfg-bond0
    
  3. Find out and write down the PCI IDs of all the involved network cards.

    For example:

    linux:~ # grep bus-pci ifcfg-eth-id--xx:xx:xx:xx:xx:01
    _nm_name='bus-pci-0000:00:09.0'
    linux:~ # grep bus-pci ifcfg-eth-id--xx:xx:xx:xx:xx:02
    _nm_name='bus-pci-0000:00:0a.0'
    linux:~ #
    
  4. Edit the file ifcfg-bond0 previously created and insert the following lines.

    BONDING_MASTER=yes
    BONDING_SLAVE_0='bus-pci-0000:00:09.0'
    BONDING_SLAVE_1='bus-pci-0000:00:0a.0'
    

    Now insert the options for the bonding module. Depending on what link detection method you are using, the line may look like this:

    • MII link detection method

      BONDING_MODULE_OPTS='miimon=100 mode=1 use_carrier=0'
      
    • netif_carrier method

      BONDING_MODULE_OPTS='miimon=100 mode=1 use_carrier=1'
      
    • ARP monitoring method

      BONDING_MODULE_OPTS='arp_interval=2500 arp_ip_target=192.168.1.1 mode=1'
      
  5. Remove the old configuration files

    linux:~ # rm ifcfg-eth-id--xx:xx:xx:xx:xx:01
    linux:~ # rm ifcfg-eth-id--xx:xx:xx:xx:xx:02
    
  6. Restart the network with

    rcnetwork restart
    

Additional Information

Occasionally it has been experienced that not all network interfaces come up after a system reboot. To prevent this, the loading of the modules should start earlier during the reboot process. The following procedure is helpful in this case:

  1. Edit the file /etc/sysconfig/kernel and add this line:

    MODULES_LOADED_ON_BOOT="bcm5700"
  2. Reboot the server and check the status of all network interfaces, using commands lspci and ifconfig.

  3. If this method is not successful, edit the file /etc/sysconfig/kernel again and remove the line inserted at step 1. Modify the line containing the INITRD_MODULES statement; add the bcm5700 to this line. It should read like INITRD_MODULES="cdrom scsi_mod ide-cd ehci-hcd reiserfs bcm5700"

  4. Call command mkinitrd

  5. Reboot the server as in step 2

Another method is to delay the starting of the network interfaces after loading the modules. To do this, edit the file /etc/sysconfig/network/config and change the variable WAIT_FOR_INTERFACES to the wanted delay in seconds. To delay the interfaces 3 seconds, enter

WAIT_FOR_INTERFACES=3

Reboot the server to verify the success of this measure.

Thanks to: Eggert Ehmke for finding the workaround with WAIT_FOR_INTERFACES and the translation of "additional informations" to english


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

Novell® Making IT Work As One

© 2009 Novell, Inc. All Rights Reserved.