Nazaudy, a spark in your curious mind

ESXi trunk to Cisco C2960 switch - How to load balance traffic

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

  1. Create a port-channel group
  2. Configure the 4 x ports in the switch
  3. Enable load-balance method
  4. Enable "IP Hash" load balancing on the ESXi host virtual switch
  5. Enable "Inherit from vSwitch" on the Management Network
  6. Test the network traffic

This is a diagram of what this article covers, so you can have a visual insight of what's happening:

ESXi trunk to Cisco C2960 switch How to load balance traffic

If you want to use MULTI-VLANS with your host, please refer to this my other article where I cover that: https://www.nazaudy.com/configure-esxi-host-for-multi-vlans-on-a-cisco-switch

 

1. Create a port-channel group

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

 

2. Configure the 4 x ports in the switch

To the 4 x ports where the ESXi host is going to be connected, 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

Configure the 4 x ports in the switch

To continue with this article of Enable "Inherit from vSwitch" in ESXi trunk to Cisco C2960 switch How to load balance traffic, please see below 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

 

3. Enable load-balance method

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

 

4. Enable "IP Hash" load balancing on the ESXi host virtual switch

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. 

 Enable "IP Hash" load balancing on the ESXi host virtual switch

 

5. Enable "Inherit from vSwitch" on the Management Network

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"

Enable "Inherit from vSwitch" in ESXi trunk to Cisco C2960 switch How to load balance traffic

6. Test the network traffic

Issue the "no shut" command on each of the ports that we previously disable, and the trunk will come online in the switch. 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

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

All done!

London, 10 May 2018

 

References:

 

Comments powered by CComment