实验条件
网络拓朴
需求
配置实现
创建PAgP协议的Channel
SW1和SW2之间的E0/0-1使用PAgP协议创建捆绑接口Port11,SW1为主动模式,SW2为被动模式,Port11划分至VLAN 11,使用SVI 11进行通信(SW1 SVI 11:11.1.1.1/24;SW2 SVI 11:11.1.1.2/24)SW1和SW2之间的E0/0-1使用PAgP协议创建捆绑接口Port11,SW1为主动模式,SW2为被动模式,Port11划分至VLAN 11,使用SVI 11进行通信(SW1 SVI 11:11.1.1.1/24;SW2 SVI 11:11.1.1.2/24)
SW1
//创建
SW1(config)#int range ethernet 0/0-1
SW1(config-if-range)#channel-protocol pagp
SW1(config-if-range)#channel-group 11 mode desirable
Creating a port-channel interface Port-channel 11
//配置svi
SW1(config-if-range)# no shutdown
SW1(config-if-range)# exit
SW1(config)#int port 11
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 11
SW1(config-if)#vlan 11
SW1(config-vlan)#exit
SW1(config)#int vlan 11
SW1(config-if)#ip address 11.1.1.1 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#
SW2
//创建
SW2(config)#int range ethernet 0/0-1
SW2(config-if-range)#channel-protocol pagp
SW2(config-if-range)#channel-group 11 mode desirable
Creating a port-channel interface Port-channel 11
//配置svi
SW2(config-if-range)# no shutdown
SW2(config-if-range)# exit
SW2(config)#int port 11
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 11
SW2(config-if)#vlan 11
SW2(config-vlan)#exit
SW2(config)#int vlan 11
SW2(config-if)#ip address 11.1.1.2 255.255.255.0
SW2(config-if)#no shutdown
SW2(config-if)#
状态输出
SW1(config-if-range)#do sh etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
11 Po11(SU) PAgP Et0/0(P) Et0/1(P)
SW1(config-if)#do sh ip int br
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 unassigned YES unset up up
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
Ethernet1/0 unassigned YES unset administratively down down
Ethernet1/1 unassigned YES unset administratively down down
Ethernet1/2 unassigned YES unset administratively down down
Ethernet1/3 unassigned YES unset administratively down down
Port-channel11 unassigned YES unset up up
Vlan11 11.1.1.1 YES manual up up
SW1(config-if)#
SW1(config-if)#do sh etherchannel
Channel-group listing:
----------------------
Group: 11
----------
Group state = L2
Ports: 2 Maxports = 4
Port-channels: 1 Max Port-channels = 1
Protocol: PAgP
Minimum Links: 0
SW1(config-if)#
创建Lacp协议的Channel
SW1和SW2之间的E0/2-3使用LACP协议创建捆绑接口Port12,SW1为主动模式,SW2为被动模式,Port12配置为Trunk,使用SVI 12进行通信(SW1 SVI 12:12.1.1.1/24;SW2 SVI 12:12.1.1.2/24)
SW1
SW1(config-if)#int range ethernet 0/2-3
SW1(config-if-range)#channel-protocol lacp
SW1(config-if-range)#channel-group 12 mode active
Creating a port-channel interface Port-channel 12
SW1(config-if-range)# vlan 12 //创建Vlan
SW1(config-vlan)#int port-channel 12 //port划分vlan
SW1(config-if)# switchport access vlan 12
SW1(config-if)# no shutdown
SW1(config-vlan)#int vlan 12 //创建SVI
SW1(config-if)#ip address 12.1.1.1 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#
SW2
SW2(config-if)#int range ethernet 0/2-3
SW2(config-if-range)#channel-protocol lacp
SW2(config-if-range)#channel-group 12 mode active
Creating a port-channel interface Port-channel 12
SW2(config-if-range)# vlan 12 //创建Vlan
SW2(config-vlan)#int port-channel 12 //port划分vlan
SW2(config-if)# switchport access vlan 12
SW2(config-if)# no shutdown
SW2(config-vlan)#int vlan 12 //创建SVI
SW2(config-if)#ip address 12.1.1.2 255.255.255.0
SW2(config-if)#no shutdown
SW2(config-if)#
状态输出
SW2(config-if)#do sh etherchan summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 2
Number of aggregators: 2
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
11 Po11(SU) PAgP Et0/0(P) Et0/1(P)
12 Po12(SU) LACP Et0/2(P) Et0/3(P)
SW2(config-if)#
创建ON模式的Channel
SW1和SW2之间的E1/0-3使用On模式创建捆绑接口Port13,Port13配置为三层接口,使用Port 13进行通信(SW1 Port 13:13.1.1.1/24;SW2 Port 13:13.1.1.2/24)
SW1
SW1(config-if)#int range ethernet 1/0-3
SW1(config-if-range)#bandwidth 10000
SW1(config-if-range)#no switchport
SW1(config-if-range)#channel-group 13 mode on
Creating a port-channel interface Port-channel 13
SW1(config-if-range)#no shutdown
SW1(config-if-range)#exit
SW1(config)#int port 13
SW1(config-if)#ip address 13.1.1.1 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#
SW2
SW2(config-if)#int range ethernet 1/0-3
SW2(config-if-range)#no switchport
SW2(config-if-range)#bandwidth 10000
SW2(config-if-range)#channel-group 13 mode on
Creating a port-channel interface Port-channel 13
SW2(config-if-range)#no shutdown
SW2(config-if-range)#int port 13
SW2(config-if)#ip address 13.1.1.2 255.255.255.0
SW2(config-if)#no shutdown
SW2(config-if-range)#
状态输出
SW2#show etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
A - formed by Auto LAG
Number of channel-groups in use: 3
Number of aggregators: 3
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
11 Po11(SU) PAgP Et0/0(P) Et0/1(P)
12 Po12(SU) LACP Et0/2(P) Et0/3(P)
13 Po13(RU) - Et1/0(P) Et1/1(P) Et1/2(P)
Et1/3(P)
SW2#
主要命令汇总
创建命令
SW1(config-if-range)# channel-group <0-255> mode {active|auto|passive|desirable|on}
//使用ON模式之前,最好先设置一下Bandwidth,带宽
拆除命令
SW1(config-if-range)# no int port-channel <1-255>
查询命令
SW1# show etherchannel
SW1# show etherchannel {summary|auto|detail|load-balance|port|port-channel|protocol}
SW1# show interface port-channel <1-255>
SW1# show ip interface port-channel <1-255>