兩台交換機上有vlan101和vlan102的網絡,兩台交換機之間采用Eth-Trunk模式,實現鏈路聚合負載分擔。
1、拓撲圖
2、創建vlan,並將接口加入到vlan中
SWA
[swa]vlan batch 101 102 Info: This operation may take a few seconds. Please wait for a moment...done. [swa]int e0/0/1 [swa-Ethernet0/0/1]port link-type access [swa-Ethernet0/0/1]port default vlan 101 [swa-Ethernet0/0/1]int e0/0/2 [swa-Ethernet0/0/2]port link-type access [swa-Ethernet0/0/2]port default vlan 102 [swa-Ethernet0/0/2]quit
SWB
[swb]vlan batch 101 102 Info: This operation may take a few seconds. Please wait for a moment...done. [swb]int e0/0/1 [swb-Ethernet0/0/1]port link-type access [swb-Ethernet0/0/1]port default vlan 101 [swb-Ethernet0/0/1]int e0/0/2 [swb-Ethernet0/0/2]port link-type access [swb-Ethernet0/0/2]port default vlan 102 [swb-Ethernet0/0/2]quit
3、創建Eth-Trunk接口,並將成員加入進來,同時將接口設置為trunk模式,允許vlan101和vlan102通過
SWA
[swa]int Eth-Trunk 1 [swa-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2 Info: This operation may take a few seconds. Please wait for a moment...done. [swa-Eth-Trunk1]port link-type trunk [swa-Eth-Trunk1]port trunk allow-pass vlan 101 102
SWB
[swb]int Eth-Trunk 1 [swb-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2 Info: This operation may take a few seconds. Please wait for a moment...done. [swb-Eth-Trunk1]port link-type trunk [swb-Eth-Trunk1]port trunk allow-pass vlan 101 102
4、配置Eth-Trunk1的負載均衡分擔方式
SWA
[swa]int Eth-Trunk 1 [swa-Eth-Trunk1]load-balance src-dst-mac [swa-Eth-Trunk1]quit [swa]
SWB
[swb]int Eth-Trunk 1 [swb-Eth-Trunk1]load-balance src-dst-mac [swb-Eth-Trunk1]quit [swb]
5、測試
使用PC3 ping 1.1.1.2 -t,然后SWA進入g0/0/1或者g0/0/2接口,shutdown。連通性中斷,一段時間后恢復正常。
6、負載分擔方式
dst-ip 根據目的IP哈希算法 dst-mac 根據目的地MAC哈希算法 src-dst-ip 根據源/目的IP哈希算法 src-dst-mac 根據源/目標MAC哈希算法 src-ip 根據源IP哈希算法 src-mac 根據源MAC哈希算法
讀書和健身總有一個在路上