
动态链路聚合实验预览
动态链路协议为lacp
相比静态路由就多上面两种模式的配置,实验开始
第一步 配置主机 IP
第二步 用交叉线 分别连接两台交换机的 22 23 24端口
开始配置 进入左侧交换机 1
Switch>en
Switch#conf // 进入特权模式
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 2 //创建vlan2
Switch(config-vlan)#e //退出操作
Switch(config)#vlan 3 //创建vlan3
Switch(config-vlan)#e //退出操作
Switch(config)#interface f0/1 //进入端口1 配置vlan2
Switch(config-if)#sw mo ac //模式为active
Switch(config-if)#sw ac vlan 2 //配置vlan2
Switch(config-if)#e //退出操作
Switch(config)#interface f0/2 //进入端口2 配置vlan3
Switch(config-if)#sw mo ac //模式为active
Switch(config-if)#sw ac vlan 3 //配置vlan3
Switch(config-if)#e //退出操作
Switch(config)#interface range f0/22-24 //进入群端口 22-24
Switch(config-if-range)#channel-protocol lacp //设置动态路由协议为lacp
Switch(config-if-range)#channel-group 1 mode active //链路1模式设置成active
Switch(config-if-range)#
Creating a port-channel interface Port-channel 1
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/22, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/22, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up
Switch(config-if-range)#exit //退出操作
Switch(config)#interface port-channel 1 //进入链路 1
Switch(config-if)#sw mo trunk //设置模式为trunk
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/22, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/22, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up
Switch(config-if)#sw trunk all vlan 2,3 //以trunk模式绑定所有vlan
Switch(config-if)#end //退出操作
Switch#
%SYS-5-CONFIG_I: Configured from console by console
配置完毕 查询参数是否正确
Switch#show running-config
Building configuration...
interface FastEthernet0/1
switchport access vlan 2 //参数1
switchport mode access //参数2
!
interface FastEthernet0/2
switchport access vlan 3 //参数1
switchport mode access //参数2
!
interface FastEthernet0/22
channel-protocol lacp //参数3
channel-group 1 mode active //参数4
switchport mode trunk //参数5
!
interface FastEthernet0/23
channel-protocol lacp //参数3
channel-group 1 mode active //参数4
switchport mode trunk //参数5
!
interface FastEthernet0/24
channel-protocol lacp //参数3
channel-group 1 mode active //参数4
switchport mode trunk //参数5
!
interface Port-channel 1
switchport trunk allowed vlan 2-3 //参数6
switchport mode trunk //参数7
!
interface Vlan1
no ip address
shutdown
--More--