Thursday, December 27, 2007

NIC Teaming in SuSE Linux

NIC Teaming in SuSE Linux

This change has to be done through console. Running ssh to the box wont' get the job done.

  • Create a bonding file, ifcfg-bond0 in /etc/sysconfig/network.
    linux880:/etc/sysconfig/network # vi ifcfg-bond0
DEVICE=bond0
IPADDR=172.18.9.97
NETMASK=255.255.255.0
NETWORK=172.18.9.0
BROADCAST=172.18.9.255
STARTMODE=onboot
BOOTPROTO=static
BONDING_MASTER=yes
BONDING_MODULE_OPTS='mode=1 miimon=100
/ use_carrier=0'
BONDING_SLAVE0=eth0
BONDING_SLAVE1=eth1
  • Create an ifcfg-ethx file for each interface in the bod. All interfaces should have MASTER and SLAVE definitions.
    linux880:/etc/sysconfig/network # vi ifcfg-eth0
DEVICE=eth0
STARTMODE=none
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
USERCTL=no

atl880:/etc/sysconfig/network # vi ifcfg-eth1
DEVICE=eth1
STARTMODE=none
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
USERCTL=no
  • Delete the original NIC configuration file ifcfg-eth-id-MACADDRESS, or edit the configuration file to disable it.
  • Add the bonding alias to /etc/modprobe.conf.local and /etc/modules.conf so that system knows which one is the bonding file to loaded.
    linux880:/# more /etc/modprobe.conf.local
#
# please add local extensions to this file
#
alias bond0 bonding

linux880: # more /etc/modules.conf
alias bond0 bonding
options bond0 miimon=100 mode=1
  • Now restart the network devices: /etc/init.d/network restart
    linux880:~ # /etc/init.d/network restart
Shutting down network interfaces:
bond0 done
eth0 device: Broadcom BCM5708 (rev 12)
eth1 device: Broadcom BCM5708 (rev 12)
Shutting down service network . . . . done
Setting up network interfaces:
lo
lo IP address: 127.0.0.1/8 done
eth0 device: Broadcom BCM5708 (rev 12)
eth0 Startmode is 'none' skipped
eth1 device: Broadcom BCM5708 (rev 12)
eth1 Startmode is 'none' skipped
bond0
bond0 enslaving interfaces: eth0 eth1
bond0 IP address: 172.18.9.97/24 done
Setting up service network . . . . . done
  • Run ifconfig to view the configuration change in network setting. Add it should shows bond0, eth0, eth1 and lo in the configuration.

3 comments:

Raj said...

Can I have an additional bonding ? I mean like having bon0 for eth0 and eth1 and bon1 for eth2 and eth3 ?

Byron Zhao said...

Yes, I believe you can. Just need to set up a second bond file for the second teaming. I have never tried it though.

Mundy said...

Thanks so much for this. I use openSUSE 11 as a home file server and this is icing on the cake for me! I now have everything I wanted in a server.