0x00 設置交換機標識和遠程登錄
設置KJL_CE-121
configure terminal # 進入全局配置模式
hostname KJL_CE-121 # 設置交換機標識符
interface vlan 1 # 進入VLAN 1配置模式
ip address 10.0.1.21 255.255.255.0 # 設置管理IP
no shutdown # 激活VLAN 1
exit # 退出VLAN 1 配置模式
line vty 0 4 # 設置遠程登錄終端數量爲5個(0-4)
password ins1ght # 設置遠程登錄密碼
login # 啓用遠程登錄的密碼驗證機制
exit # 退出遠程登錄設置模式
enable password ins1ght@ABC # 設置特權模式密碼
exit # 退出全局配置模式
configure terminal # 進去全局配置模式
vlan 80 # 劃分VLAN 80
interface range fastEthernet 0/1-20 # 進入端口配置模式
switchport access vlan 80 # 將端口劃分到VLAN 80
no shutdown # 激活VLAN 80
end # 結束配置
設置KJL_CE-122
configure terminal # 進入全局配置模式
hostname KJL_CE-122 # 設置交換機標識符
interface vlan 1 # 進入VLAN 1配置模式
ip address 10.0.1.22 255.255.255.0 # 設置管理IP
no shutdown # 激活VLAN 1
exit # 退出VLAN 1 配置模式
line vty 0 4 # 設置遠程登錄終端數量爲5個(0-4)
password ins1ght # 設置遠程登錄密碼
login # 啓用遠程登錄的密碼驗證機制
exit # 退出遠程登錄設置模式
enable password ins1ght@ABC # 設置特權模式密碼
exit # 退出全局配置模式
configure terminal # 進去全局配置模式
vlan 80 # 劃分VLAN 80
interface range fastEthernet 0/1-20 # 進入端口配置模式
switchport access vlan 80 # 將端口劃分到VLAN 80
no shutdown # 激活VLAN 80
end # 結束配置
0x01 配置鏈路聚合
KJL_CE-121
enable # 進入特權模式
configure terminal # 進入全局配置模式
interface port-channel 1 # 創建一個邏輯端口
switchport mode trunk # 設置邏輯端口的模式爲Trunk
exit # 退出邏輯端口配置模式
interface range fastEthernet 0/22-23 # 進入端口配置模式
channel-group 1 mode on # 強制將端口加入邏輯端口
exit # 退出端口配置模式
exit # 退出全局配置模式
show running-config # 查看當前配置
KJL_CE-122
enable # 進入特權模式
configure terminal # 進入全局配置模式
interface port-channel 1 # 創建一個邏輯端口
switchport mode trunk # 設置邏輯端口的模式爲Trunk
exit # 退出邏輯端口配置模式
interface range fastEthernet 0/22-23 # 進入端口配置模式
channel-group 1 mode on # 強制將端口加入邏輯端口
exit # 退出端口配置模式
exit # 退出全局配置模式
show running-config # 查看當前配置
0x02 連通性測試
PC5 IP: 192.168.80.2
PC6 IP: 192.168.80.3
按照書本上的配置,現在是Ping不通的。
重新配置一下
KJL_CE-121
configure terminal
interface range fastEthernet 0/22-23
channel-group 1 mode desirable
end
show running-config
KJL_CE-122
configure terminal
interface range fastEthernet 0/22-23
channel-group 1 mode auto
end
show running-config
配完之後需要重新連接交叉雙絞線。然而還是Ping不通。
猜測有可能是邏輯端口沒有放通VLAN 80
KJL_CE-121
KJL_CE-122
根據網上的教程重新配置
實現鏈路聚合必須要滿足的條件:
端口必須處於一個VLAN,必須使用相同的傳輸介質,端口必須都處於全雙工工作模式,端口必須是相同的傳輸速率,端口的類型必須一致,端口同爲access端口並且屬於同一個VLAN或同爲Trunk端口,如果端口爲Trunk模式,則其allowed vlan和nativevlan屬性應該相同。
KJL_CE-121,下圖中標紅的是比書上多出的命令。
KJL_CE-122,下圖中標紅的是比書上多出的命令。
連通性測試成功
兩根交叉線
斷掉其中一根交叉線
也就是說書上的教程裏,缺少以下兩條配置:
1.邏輯端口沒有放通VLAN 80
switchport trunk allowed vlan 80
2.Fa0/22-23不是Trunk模式
switchport mode trunk