關於我的鏈路聚合有兩張,首先對於鏈路聚合,在不同網段且不同vlan的時候需要在三層交換機上配置虛擬IP,且該IP地址爲該網段的網關地址,
下面我僅僅使用了一個鏈路聚合,我曾做過這樣的實驗,如果主機在相同網段相同網段。則不需要在交換機上配置IP地址,如果主機在不同網段且不同vlan下的時候,則需要在交換機上配置IP地址
實驗如下:
確保pc1、pc2、pc3能夠相互通信,且不在相同網段和不同vlan
實驗如下:
sw5配置:
[s1]vlan batch 10 20 30 //需要在三層交換機上面操作,創建三個vlan
[s1]int Vlanif 10 //虛接口
[s1-Vlanif10]ip add 192.168.1.1 24 //配置IP,IP地址爲網關地址
[s1]int Vlanif 20
[s1-Vlanif20]ip add 192.168.2.1 24
[s1]int Vlanif 30
[s1-Vlanif30]ip add 192.168.3.1 24
[s1]int Eth-Trunk 1 //配置Eth-Trunk
[s1-Eth-Trunk1]int g0/0/1 //捆綁物理接口
[s1-Eth-Trunk1]int g0/0/2
[s1-Eth-Trunk1]int g0/0/3
[s1-Eth-Trunk1] port link-type trunk //使用trunk接口
[s1-Eth-Trunk1] port trunk allow-pass vlan 10 20 30 //放行vlan10、20、30的流量
sw4配置:
[s2]vlan batch 10 20 30 //需要在三層交換機上面操作,創建三個vlan
[s2]int Vlanif 10 //虛接口
[s2]int Vlanif 20
[s2]int Vlanif 30
[s2]int Eth-Trunk 1 //配置Eth-Trunk
[s2-Eth-Trunk1]int g0/0/1 //捆綁物理接口
[s2-Eth-Trunk1]int g0/0/2
[s2-Eth-Trunk1]int g0/0/3
[s2-Eth-Trunk1] port link-type trunk //使用trunk接口
[s2-Eth-Trunk1] port trunk allow-pass vlan 10 20 30 //放行vlan10、20、30的流量
配置access端口
[s2]int g0/0/4
[s2-GigabitEthernet0/0/4] port link-type access //使用access接口
[s2-GigabitEthernet0/0/4] port default vlan 10 //放行vlan10流量
[s2]int g0/0/5
[s2-GigabitEthernet0/0/5] port link-type access
[s2-GigabitEthernet0/0/5] port default vlan 20
[s2]int g0/0/6
[s2-GigabitEthernet0/0/6] port link-type access
[s2-GigabitEthernet0/0/6] port default vlan 30