【3】去使能自环接口GE0/0/4和GE0/0/5的STP/RSTP/VBST/MSTP功能,并以Access类型分别加入VLAN100和VLAN200。
【4】配置三层接口VLANIF200的VRRP虚拟IP地址,该VRRP虚拟IP地址作为NLB服务器群集的网关。
【5】配置静态ARP表项。静态ARP表项的IP地址为群集IP地址,MAC地址为群集组播MAC,出接口为自环口上NLB服务器群集网关VLAN所在的接口。
【6】连接自环接口GE0/0/4和GE0/0/5。
当NLB服务器群集工作在单播模式时,不需要在交换机上配置静态ARP表项;当NLB服务器群集工作在组播模式时,需要在交换机上配置静态ARP表项。
<HUAWEI> system-view
[HUAWEI] sysname Switch_1
[Switch_1] vlan batch 100 200
[Switch_1] interface gigabitethernet 0/0/1
[Switch_1-GigabitEthernet0/0/1] port link-type access
[Switch_1-GigabitEthernet0/0/1] port default vlan 100
[Switch_1-GigabitEthernet0/0/1] quit
<HUAWEI> system-view
[HUAWEI] sysname Switch_2
[Switch_2] vlan batch 100 200
[Switch_2] interface gigabitethernet 0/0/1
[Switch_2-GigabitEthernet0/0/1] port link-type access
[Switch_2-GigabitEthernet0/0/1] port default vlan 100
[Switch_2-GigabitEthernet0/0/1] quit
[Switch_1] interface gigabitethernet 0/0/2
[Switch_1-GigabitEthernet0/0/2] port link-type trunk
[Switch_1-GigabitEthernet0/0/2] port trunk allow-pass vlan 100
[Switch_1-GigabitEthernet0/0/2] quit
[Switch_2] interface gigabitethernet 0/0/2
[Switch_2-GigabitEthernet0/0/2] port link-type trunk
[Switch_2-GigabitEthernet0/0/2] port trunk allow-pass vlan 100
[Switch_2-GigabitEthernet0/0/2] quit
[Switch_1] interface gigabitethernet 0/0/4
[Switch_1-GigabitEthernet0/0/4] undo stp enable //去使能STP/RSTP/VBST/MSTP功能
[Switch_1-GigabitEthernet0/0/4] quit
[Switch_1] interface gigabitethernet 0/0/5
[Switch_1-GigabitEthernet0/0/5] undo stp enable //去使能STP/RSTP/VBST/MSTP功能
[Switch_1-GigabitEthernet0/0/5] quit
# 在Switch_1上配置接口GE0/0/4和GE0/0/5以Access类型分别加入VLAN100和VLAN200。
[Switch_1] interface gigabitethernet 0/0/4
[Switch_1-GigabitEthernet0/0/4] port link-type access
[Switch_1-GigabitEthernet0/0/4] port default vlan 100
[Switch_1-GigabitEthernet0/0/4] quit
[Switch_1] interface gigabitethernet 0/0/5
[Switch_1-GigabitEthernet0/0/5] port link-type access
[Switch_1-GigabitEthernet0/0/5] port default vlan 200
[Switch_1-GigabitEthernet0/0/5] quit
[Switch_2] interface gigabitethernet 0/0/4
[Switch_2-GigabitEthernet0/0/4] undo stp enable //去使能STP/RSTP/VBST/MSTP功能
[Switch_2-GigabitEthernet0/0/4] quit
[Switch_2] interface gigabitethernet 0/0/5
[Switch_2-GigabitEthernet0/0/5] undo stp enable //去使能STP/RSTP/VBST/MSTP功能
[Switch_2-GigabitEthernet0/0/5] quit
[Switch_2] interface gigabitethernet 0/0/4
[Switch_2-GigabitEthernet0/0/4] port link-type access
[Switch_2-GigabitEthernet0/0/4] port default vlan 100
[Switch_2-GigabitEthernet0/0/4] quit
[Switch_2] interface gigabitethernet 0/0/5
[Switch_2-GigabitEthernet0/0/5] port link-type access
[Switch_2-GigabitEthernet0/0/5] port default vlan 200
[Switch_2-GigabitEthernet0/0/5] quit
[Switch_1] interface vlanif 200
[Switch_1-Vlanif200] ip address 10.128.246.10 24
[Switch_1-Vlanif200] vrrp vrid 1 virtual-ip 10.128.246.250 //创建VRRP备份组1
[Switch_1-Vlanif200] vrrp vrid 1 priority 120 //配置Switch_1在该备份组中的优先级为120
[Switch_1-Vlanif200] quit
[Switch_2] interface vlanif 200
[Switch_2-Vlanif200] ip address 10.128.246.11 24
[Switch_2-Vlanif200] vrrp vrid 1 virtual-ip 10.128.246.250 //创建VRRP备份组1
[Switch_2-Vlanif200] quit
这是因为在以上组网中,本端设备发往NLB服务器群集的流量会通过心跳线发往对端设备,并经过对端设备的自环线。此时,如果其他服务器与NLB服务器具有相同网关,会导致其他服务器也收到发往NLB服务器群集的流量,给网络增加负担。例如:由Switch_1发往群集IP的流量会通过心跳线发往Switch_2。在Switch_2上,由自环口GE0/0/4通过自环线到达GE0/0/5。如果此时Switch_2上的非NLB服务器的网关也是VLANIF200。该流量就会由自环口GE0/0/5发往非NLB服务器
【5】配置静态ARP表项
# 在Switch_1上配置静态ARP表项的IP地址为群集IP地址10.128.246.252,MAC地址为群集组播MAC地址03bf-0a80-f6fc,出接口为VLAN200所在的接口GE0/0/5。
[Switch_1] arp static 10.128.246.252 03bf-0a80-f6fc vid 200 interface gigabitethernet 0/0/5
[Switch_2] arp static 10.128.246.252 03bf-0a80-f6fc vid 200 interface gigabitethernet 0/0/5
【7】验证配置结果
上述配置完成后,发往NLB服务器群集IP地址的报文Server_1和Server_2都能收到。
原创文章,作者:guozi,如若转载,请注明出处:https://www.sudun.com/ask/89112.html