一:实验拓扑:
二:实验过程:
SW1(config)#int range f1/1 - 2
SW1(config-if-range)#no sh
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#channel-group 1 mode on
SW1(config)#int range f1/1 - 2
SW1(config-if-range)#no sh
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#channel-group 1 mode on
SW2(config)#int range f1/1 - 2
SW2(config-if-range)#no sh
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#speed 100
SW2(config-if-range)#duplex full
SW2(config-if-range)#channel-group 1 mode on
SW2(config-if-range)#no sh
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#speed 100
SW2(config-if-range)#duplex full
SW2(config-if-range)#channel-group 1 mode on
验证SW1的EtherChannel summary配置
SW1#show etherchannel summary
//查看Etherchannel的汇总
Flags: D - down
P - in port-channel
I - stand-alone s - suspended
R - Layer3
S - Layer2
U - in use
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1
Po1(SU)
Fa1/1(P)
Fa1/2(P)
SW1#show etherchannel summary
//查看Etherchannel的汇总
Flags: D - down
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1
SW1#show interfaces trunk
//查看封装
Port
Po1
Port
Vlans allowed on trunk
Po1
1-1005
Po1
Port
Vlans allowed and active in management domain
Po1
1,5,10
Po1
Port
Vlans in spanning tree forwarding state and not pruned
Po1
1,5,10
Po1
SW1#show spanning-tree
//查看生成树信息
VLAN1 is executing the ieee compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address cc02.12ec.0000
Configured hello time 2, max age 20, forward delay 15
We are the root of the spanning tree
Topology change flag not set, detected flag not set
Number of topology changes 4 last change occurred 00:04:55 ago
from Port-channel1
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0, aging 300
//查看生成树信息
VLAN1 is executing the ieee compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address cc02.12ec.0000
Configured hello time 2, max age 20, forward delay 15
We are the root of the spanning tree
Topology change flag not set, detected flag not set
Number of topology changes 4 last change occurred 00:04:55 ago
Times: hold 1, topology change 35, notification 2
Timers: hello 0, topology change 0, notification 0, aging 300
Port 44 (FastEthernet1/3) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.44.
Designated root has priority 32768, address cc02.12ec.0000
Designated bridge has priority 32768, address cc02.12ec.0000
Designated port id is 128.44, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 538, received 0
Port 46 (FastEthernet1/5) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.46.
Designated root has priority 32768, address cc02.12ec.0000
Designated bridge has priority 32768, address cc02.12ec.0000
Designated port id is 128.46, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 538, received 0
Port 52 (FastEthernet1/11) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.52.
Designated root has priority 32768, address cc02.12ec.0000
Designated bridge has priority 32768, address cc02.12ec.0000
Designated port id is 128.52, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 539, received 0
Port 53 (FastEthernet1/12) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.53.
Designated root has priority 32768, address cc02.12ec.0000
Designated bridge has priority 32768, address cc02.12ec.0000
Designated port id is 128.53, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 539, received 0
Port 321 (Port-channel1) of VLAN1 is forwarding
Port path cost 12, Port priority 128, Port Identifier 129.65.
Designated root has priority 32768, address cc02.12ec.0000
Designated bridge has priority 32768, address cc02.12ec.0000
Designated port id is 129.65, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 369, received 127
VLAN5 is executing the ieee compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address cc02.12ec.0001
Configured hello time 2, max age 20, forward delay 15
We are the root of the spanning tree
Topology change flag not set, detected flag not set
Number of topology changes 1 last change occurred 00:05:37 ago
Times: hold 1, topology change 35, notification 2
Timers: hello 1, topology change 0, notification 0, aging 300
Port 321 (Port-channel1) of VLAN5 is forwarding
Port path cost 12, Port priority 128, Port Identifier 129.65.
Designated root has priority 32768, address cc02.12ec.0001
Designated bridge has priority 32768, address cc02.12ec.0001
Designated port id is 129.65, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 184, received 0
VLAN10 is executing the ieee compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address cc02.12ec.0002
Configured hello time 2, max age 20, forward delay 15
We are the root of the spanning tree
Topology change flag not set, detected flag not set
Number of topology changes 1 last change occurred 00:05:37 ago
Times: hold 1, topology change 35, notification 2
Timers: hello 1, topology change 0, notification 0, aging 300
Port 321 (Port-channel1) of VLAN10 is forwarding
Port path cost 12, Port priority 128, Port Identifier 129.65.
Designated root has priority 32768, address cc02.12ec.0002
Designated bridge has priority 32768, address cc02.12ec.0002
Designated port id is 129.65, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 184, received 0
SW1(config)#port-channel load-balance dst-mac
//在SW1上配置EtherChannel负载
Warning: Delete and re-create existing port channels to apply new load balance method to them
//在SW1上配置EtherChannel负载
Warning: Delete and re-create existing port channels to apply new load balance method to them