Let's say you have a VMware ESXi single host with 4 x network cards, and you want to load balance the traffic of these 4 x nics, by creating a trunk and connecting them to a Cisco C2960 switch. Here is how to do it
- Create a port-channel group
- Configure the 4 x ports in the switch
- Enable load-balance method
- Enable "IP Hash" load balancing on the ESXi host virtual switch
- Enable "Inherit from vSwitch" on the Management Network
- Test the network traffic
On the Cisco switch create a port-channel to bound the traffic of all these 4 x physical nics of the ESXi host (for my example, I'm using port-channel number 6)
(config)#interface port-channel 6 (config-if)#description ESXi_Host5 (config-if)#switchport access vlan 11 (config-if)#switchport mode access
To the 4 x ports where the ESXi host is going to connect, configure all of them and leave all shutdown but one! The port number that I used for this example were 24, 26, 28 and 30
This is the configuration that you need to put on each one of the ports, notice that by using "mode on" we are telling the switch that we stick to the "Etherchannel" protocol only
(config)#interface GigabitEthernet0/24 (config-if)#description ESXi_Host5 (config-if)#switchport access vlan 11 (config-if)#switchport mode access (config-if)#channel-group 6 mode on
Now on the configuration mode, run this command to enable the load-balance between source and destination, which is supported by ESXi hosts
(config)#port-channel load-balance src-dst-ip
If the host is running version 6.5 or higher, it defaults to use IP Hash for load balancing, but if your host is running 6.0 it default to use the "Virtual Port ID" method, which will not work with Etherchannel.
One common mistake is to forget to check the NIC Teaming setting, ensure you either configure the load balancing there to "IP Hash" or better choose the setting "Inherit from vSwitch"
Once all is setup, you can issue this command to test the traffic
#test etherchannel load-balance port-channel n "Source IP" "Destination IP"
See on my example below how, when testing the port channel 4, some IPs will go through port Gi0/14 while others will go by Gi0/16
London, 10 May 2018