Sunday, 7 December 2008

MH, QDM, QDR, RB

Chi mi da una mano? mi sa che faccio ancora confusione... se ho la MH e RB il QDM può essere facilmente MH+RB ? siamo sempre sicuri?

Monday, 1 December 2008

How to use bonded interface with Cisco switch

I had a problem: how to use a cisco switch between 3 server that have a bond interface over four physical NICs. I've found some howtos online but none of them was complete and there're many errors. So after some work I've found to make a correct configuration two bond two or more NIC on two or more server using a cisco switch.

First of all you have to know that cisco switch configuration does not work on two or more switches using a port-channel/trunk configuration. The only way to have a fault tolerant switch configuration is two use a stackable switch (maybe a Cisco 3750). You have to accept the risk of a single switch for your interconnect that is a single point of failure.

Using redhat, configuration is quite simple and it's described here. You have to create in /etc/sysconfig/network-scripts a file called ifcfg-bond0 as below:

DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.0.1.0
NETMASK=255.255.255.0
IPADDR=10.0.1.90
USERCTL=no[/code]

Also you need to change all ifcfg-<ethX> to join the bond device as following:

[code='c']DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no


Now, you have to load kernel bond module. Insert in your /etc/modprobe.conf the following lines:

alias bond0 bonding
options bond0 mode=4 miimon=100


Note that using a Cisco switch mode option can be only number 4. You can find detailed information on bond kernel module documentation.

Cisco configuration: first you have to configure a port-channel interface for every servers:


Port-channel1
 description BOND0 RACNODE01
 switchport trunk allowed vlan 1
 switchport mode trunk
 spanning-tree portfast trunk
!
interface Port-channel2
 description BOND0 RACNODE02
 switchport trunk allowed vlan 1
 switchport mode trunk
 spanning-tree portfast trunk
!


Then, you have to change/add right configuration for each port:

interface GigabitEthernet0/1
 description racnode01-eth2
 switchport trunk allowed vlan 1
 switchport mode trunk
 channel-protocol lacp
 channel-group 1 mode active
 spanning-tree portfast trunk
!
interface GigabitEthernet0/2
 description racnode02-eth2
 switchport trunk allowed vlan 1
 switchport mode trunk
 channel-group 2 mode active
 spanning-tree portfast trunk
!
interface GigabitEthernet0/3
 description racnode01-eth3
 switchport trunk allowed vlan 1
 switchport mode trunk
 channel-protocol lacp
 channel-group 1 mode active
 spanning-tree portfast trunk
!


Following these guidelines should be already enought to create a functional portchannel/bonding device. Using a sh lacp nei may help you:

                  LACP port                        Oper    Port     Port
Port      Flags   Priority  Dev ID         Age     Key     Number   State
Gi0/1     SA      255       0015.176a.f9b4   7s    0x11    0x1      0x3D
Gi0/3     SA      255       0015.176a.f9b4  10s    0x11    0x2      0x3D
Gi0/5     SA      255       0015.176a.f9b4  11s    0x11    0x3      0x3D
Gi0/7     SA      255       0015.176a.f9b4  11s    0x11    0x4      0x3D


If you have any state different from 0x3D something is going wrong.