Notes 基于 IP 哈希的路由

基于 IP 哈希的路由的运行方式是获取源和目标 IP 地址,然后在每个数据包上执行数学计算以确定要使用成组中的哪个上行链路。由于负载平衡基于源/目标 IP 地址,因此单个虚拟机与多个 IP 地址通信可以跨成组中的所有网络适配器平衡其负载,并更好的利用可用带宽。

基于 IP 哈希的路由负载平衡需要多个已组合到 EtherChannel(有时也称为聚合绑定、端口通道或中继)中的物理交换机端口。这确保了同一哈希算法用于返回相反方向的流量。

优点:

缺点:

* 物理交换机配置较不灵活,并且需要为静态 EtherChannel 绑定配置物理交换机端口。有关详细信息,请参见 Sample configuration of EtherChannel / Link Aggregation Control Protocol (LACP) with ESXi/ESX and Cisco/HP switches (1004048)。 * 网卡组仅可使用一个物理交换机,因为大多数交换机都不支持跨多个物理交换机的 EtherChannel 绑定。这将防止物理硬件冗余。

注意:存在一些例外情况,因为某些“堆栈”交换机或模块交换机可跨多个物理交换机或模块执行此操作。Cisco 的 VPC(虚拟端口通道)技术也可在受支持的交换机上解决此问题。有关详细信息,请联系您的硬件供应商。

* IP 哈希不支持信号探测。仅可将链路状态用作故障检测方法。如果链路在其没有断开的情况下出现故障,则无法避免 vSwitch 上的网络通信问题。 * 标准 vSwitch 仅支持静态模式 EtherChannel。LACP 仅在 vSphere 5.1 的 vSphere Distributed Switch 中或 Cisco Nexus 1000V 中受支持。

Cisco switch setting

建议在 ESXi/ESX 网络环境中实施虚拟局域网 (VLAN),这是因为:

它将 ESXi/ESX 集成到预先存在的网络中 它可保障网络流量 它可降低网络流量拥塞

Port Channel/Aggr

configure terminal
interface GigabitEthernet1/11
description VMware_MGT
switchport mode access
switchport access vlan x 
spanning-tree portfast

Port Channel/Aggr

First Enable LACP

configure terminal
switch (config)# feature lacp 
show system internal clis feature
show port-channel summary
show port-channel database
show port-channel load-balance

!
configure terminal
interface port-channel 1
description VMware_VM_Net
switchport trunk encapsulation dot1q
switchport mode trunk
!

interface GigabitEthernet1/13
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk allowed vlan x,y,z
spanning-tree portfast trunk 
channel-group 1 mode on