Purpose
Because the trunk between the switches are usually not large enough bandwidth to meet the measurement needs wisdom inside to cause network congestion so that people use EtherChannel to merge several into one trunk line to increase capacity volume, the second is for the server is high due to demand access also requires a large amount of bandwidth to avoid congestion, so we use it also use EtherChannel.
Principles of load distribution through the EtherChannel:
The distribution of load across the path of a bundle (EtherChannel) is done by hashing algorithm: This algorithm can be used: the source IP address, destination, or source MAC address, destination, or you can use TCP / UDP port. If you only use one address or a port, then the transmission through this port or other port is based on the last bit, and depending on the number of EtherChannel port. If the enemy uses, and sources, this algorithm is done by XOR operations last bits of the address.
The basic commands to configure Ethechannel
Ethechannel PAgP configuration:
Switch (config-if) # channel-protocol PAgP
Switch (config-if) # channel-group number mode {on | auto |} Desirable
The mode
ON mode: in this mode the EtherChannel Switch enale automatically but it does not send or receive any packages that PAgP, so that must be configured in two modes on oil
Auto mode: It will automatically enable ethechannel if it receives PAgP packets.
Desirable: It will automatically try the other enable ethechannel requirements.
LACP configuration:
Switch (config) # LACP system-priority priority
Switch (config-if) # channel-protocol LACP
Switch (config-if) # channel-group number mode {on | passive | active}
Switch (config-if) # LACP port-priority priority
Explanation:
The first command to determine the priority system to determine what to do Switch Switch Ethechannel control, or if equal, Switch Priority which is mac only smaller DIAC will be selected. We also define the port priority to determine which port is active and any port in standby status. Port will have less priority and active, large in standby status. The mode of the channel-group command ON, Passive, active sequence similar to On, Auto, Desirable in PAgP
Configuration diagram for real.

In this scheme we take back scheme to implement all the QoS front EtherChannel between the Core and Access Switch. Here, we use 4 port FastEthernet 0 / 1-0 / 4 as EtherChannel, I will use the configuration ehterchannel PAgP, and LACP. First we configure the PAgP.
Configuration
Run Show
Access # show run
!
Access hostname
!
enable password cisco
!
ip subnet-zero
no ip domain-lookup
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0 / 1
switchport trunk encapsulation isl
switchport mode trunk
no ip address
full duplex
speed 100
channel-group 1 mode Desirable
!
interface FastEthernet0 / 2
switchport trunk encapsulation isl
switchport mode trunk
no ip address
full duplex
speed 100
channel-group 1 mode Desirable
!
interface FastEthernet0 / 3
switchport trunk encapsulation isl
switchport mode trunk
no ip address
full duplex
speed 100
channel-group 1 mode Desirable
!
interface FastEthernet0 / 4
switchport trunk encapsulation isl
switchport mode trunk
no ip address
full duplex
speed 100
channel-group 1 mode Desirable
!
interface FastEthernet0 / 5
switchport access vlan 2
switchport mode access
no ip address
!
interface FastEthernet0 / 6
no ip address
!
interface FastEthernet0 / 7
no ip address
interface FastEthernet0 / 8
no ip address
!
interface FastEthernet0 / 9
no ip address
!
interface FastEthernet0/10
no ip address
!
interface FastEthernet0/11
no ip address
!
interface FastEthernet0/12
no ip address
!
interface FastEthernet0/13
no ip address
!
interface FastEthernet0/14
no ip address
!
interface FastEthernet0/15
no ip address
!
interface FastEthernet0/16
no ip address
!
interface FastEthernet0/17
no ip address
!
interface FastEthernet0/18
no ip address
!
interface FastEthernet0/19
no ip address
!
interface FastEthernet0/20
no ip address
!
interface FastEthernet0/21
no ip address
!
interface FastEthernet0/22
no ip address
!
interface FastEthernet0/23
no ip address
!
interface FastEthernet0/24
no ip address
!
interface GigabitEthernet0 / 1
no ip address
!
interface GigabitEthernet0 / 2
no ip address
!
interface VLAN1
ip address 192.168.5.2 255.255.255.0
define interface-range intensity FastEthernet0 / 1-4
!
end

Core
!
Core hostname

enable password cisco
!
ip subnet-zero
ip routing
!
no ip domain-lookup
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface Port-channel1
switchport trunk encapsulation isl
switchport mode dynamic Desirable
!
interface FastEthernet0 / 1
switchport trunk encapsulation isl
switchport mode dynamic Desirable
full duplex
speed 100
channel-group 1 mode Desirable
!
interface FastEthernet0 / 2
switchport trunk encapsulation isl
switchport mode dynamic Desirable
full duplex
speed 100
channel-group 1 mode Desirable
!
interface FastEthernet0 / 3
switchport trunk encapsulation isl
switchport mode dynamic Desirable
full duplex
speed 100
channel-group 1 mode Desirable
!
interface FastEthernet0 / 4
switchport trunk encapsulation isl
switchport mode dynamic Desirable
full duplex
speed 100
channel-group 1 mode Desirable
!
interface FastEthernet0 / 5
no switchport
ip address 192.168.3.2 255.255.255.0
duplex half
speed 100
!
interface FastEthernet0 / 6
switchport mode dynamic Desirable
!
interface FastEthernet0 / 7
switchport mode dynamic Desirable
!
interface FastEthernet0 / 8
switchport mode dynamic Desirable
interface FastEthernet0 / 9
switchport mode access
!
interface FastEthernet0/10
switchport mode dynamic Desirable
!
interface FastEthernet0/11
switchport mode dynamic Desirable
!
interface FastEthernet0/12
switchport mode dynamic Desirable
!
interface FastEthernet0/13
switchport mode dynamic Desirable
!
interface FastEthernet0/14
switchport mode dynamic Desirable
!
interface FastEthernet0/15
switchport mode dynamic Desirable
!
interface FastEthernet0/16
switchport mode dynamic Desirable
!
interface FastEthernet0/17
switchport mode dynamic Desirable
!
interface FastEthernet0/18
switchport mode dynamic Desirable
!
interface FastEthernet0/19
switchport mode dynamic Desirable
!
interface FastEthernet0/20
switchport mode dynamic Desirable
!
interface FastEthernet0/21
switchport mode dynamic Desirable
!
interface FastEthernet0/22
switchport mode dynamic Desirable
!
interface FastEthernet0/23
switchport mode dynamic Desirable
!
interface FastEthernet0/24
switchport mode dynamic Desirable
!
interface GigabitEthernet0 / 1
switchport mode dynamic Desirable
!
interface GigabitEthernet0 / 2
switchport mode dynamic Desirable
!
interface VLAN1
ip address 192.168.5.1 255.255.255.0
!
VLAN2 interface
ip address 192.168.2.1 255.255.255.0
define interface-range intensity FastEthernet0 / 1-4
!
router ospf 1
log-adjacency-changes
passive-interface Port-channel1
network 192.168.2.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 0
!

ip classless
ip http server
line con 0
logging synchronous
line vty 0 4
password cisco
no login
line vty 5 15
login
!
!
monitor session 1 source interface Po1
monitor session 1 destination interface Fa0/10
end


R1 # show run
Building configuration ...

Current configuration:
!
Version 1.12
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
enable password cisco
!

memory-size iomem 10
ip subnet-zero
no ip domain-lookup
!

Loopback1 interface
ip address 11.1.1.1 255.255.255.0
!
interface Ethernet0 / 0
ip address 192.168.1.1 255.255.255.0
half-duplex
!
interface Serial0 / 0
no ip address
encapsulation frame-relay
no fair-queue
clockrate 64000
!
Serial0/0.122 interface point-to-point
ip address 172.16.1.1 255.255.255.0
frame-relay interface-DLCI 122
!
interface Serial0 / 1
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 11.0.0.0 0.0.0.255 area 0
network 172.16.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
!
ip classless
ip http server
!
access-list 101 permit ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255
!
line con 0
logging synchronous
transport input none
line aux 0
line vty 0 4
no login
!
end

R2
!
hostname R2
!
enable password cisco
no ip domain-lookup
!
interface FastEthernet0 / 0
ip address 192.168.3.1 255.255.255.0
no ip directed-broadcast
speed 100
!
interface Serial0 / 0
no ip address
no ip directed-broadcast
encapsulation frame-relay
no ip mroute-cache
no fair-queue
clockrate 64000
cdp enable
LMI-type frame-relay cisco
!
Serial0/0.221 interface point-to-point
ip address 172.16.1.2 255.255.255.0
no ip directed-broadcast
frame-relay interface-DLCI 221
!
router ospf 1
network 172.16.1.0 0.0.0.255 area 0
network 172.16.3.0 0.0.0.255 area 0
255 255 255 255 area 0 network 0.0.0.0
!
router rip
network 192.168.3.0
!
ip classless
ip http server
!
access-list 101 permit ip 192.168.1.0 0.0.0.255 172.16.2.0 0.0.0.255
!
end
Check
Show EtherChannel port to view the status of all ports in the group
Core # show port EtherChannel
Channel-group listing:
-----------------------
Group: 1
----------
Ports in the group:
-------------------
Port: Fa0 / 1
------------
Port state = Up Mstr In-Bndl
Channel group = 1 Mode = Desirable-Sl Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo port-channel = Po1
Port index = 0 Load = 0x00 Protocol = PAgP
Flags: S - Device is sending Slow hello. C - Device is in Consistent state.
A - Device is in Auto mode. P - Device Learns on physical port.
d - PAgP is down.
Timers: H - Hello timer is running. Q - Quit timer is running.
S - Switching timer is running. I - Interface timer is running.

Local information:
Hello Partner PAgP Learning Group
Port Flags State Timers Interval Count Priority Method Ifindex
Fa0 / 1 SC U6/S7 H 30s 1 128 Any 29

Partner's information:

Partner Partner Partner Partner Group
Port Name Device ID Port Age Flags Cap.
Fa0 / 1 Fa0 000d.bc33.2b00 Access / 1 0s SC 10001
Age of the port in the current state: 00d: 00h: 06m: 04s
Port: Fa0 / 2
------------
Port state = Up Mstr In-Bndl
Channel group = 1 Mode = Desirable-Sl Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo port-channel = Po1
Port index = 0 Load = 0x00 Protocol = PAgP

Flags: S - Device is sending Slow hello. C - Device is in Consistent state.
A - Device is in Auto mode. P - Device Learns on physical port.
d - PAgP is down.
Timers: H - Hello timer is running. Q - Quit timer is running.
S - Switching timer is running. I - Interface timer is running.

Local information:
Hello Partner PAgP Learning Group
Port Flags State Timers Interval Count Priority Method Ifindex
Fa0 / 2 SC U6/S7 H 30s 1 128 Any 29

Partner's information:

Partner Partner Partner Partner Group
Port Name Device ID Port Age Flags Cap.
Fa0 / 2 Fa0 Access 000d.bc33.2b00 / 2 2s SC 10001

Age of the port in the current state: 00d: 00h: 32m: 20s

Port: Fa0 / 3
------------

Port state = Up Mstr In-Bndl
Channel group = 1 Mode = Desirable-Sl Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo port-channel = Po1
Port index = 0 Load = 0x00 Protocol = PAgP

Flags: S - Device is sending Slow hello. C - Device is in Consistent state.
A - Device is in Auto mode. P - Device Learns on physical port.
d - PAgP is down.
Timers: H - Hello timer is running. Q - Quit timer is running.
S - Switching timer is running. I - Interface timer is running.

Local information:
Hello Partner PAgP Learning Group
Port Flags State Timers Interval Count Priority Method Ifindex
Fa0 / 3 SC U6/S7 H 30s 1 128 Any 29

Partner's information:

Partner Partner Partner Partner Group
Port Name Device ID Port Age Flags Cap.
Fa0 / 3 Fa0 Access 000d.bc33.2b00 / 3 14s SC 10001

Age of the port in the current state: 00d: 00h: 04m: 19s

Channel group = 1 Mode = Desirable-Sl Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo port-channel = Po1
Port index = 0 Load = 0x00 Protocol = PAgP

Flags: S - Device is sending Slow hello. C - Device is in Consistent state.
A - Device is in Auto mode. P - Device Learns on physical port.
d - PAgP is down.
Timers: H - Hello timer is running. Q - Quit timer is running.
S - Switching timer is running. I - Interface timer is running.

Local information:
Hello Partner PAgP Learning Group
Port Flags State Timers Interval Count Priority Method Ifindex
Fa0 / 4 SC U6/S7 H 30s 1 128 Any 29

Partner's information:

Partner Partner Partner Partner Group
Port Name Device ID Port Age Flags Cap.
Fa0 / 4 Fa0 Access 000d.bc33.2b00 / 4 14s SC 10001

Age of the port in the current state: 00d: 00h: 48m: 29S
One can use EtherChannel summary command to show more to consider.
Core # show summary EtherChannel
Flags: D - down P - in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - S Layer 3 - Layer 2
u - unsuitable for bundling
U - in use f - failed to cấp phát aggregator
d - default port

Number of channel-groups in use: 1
Number of aggregators: 1

Group Port-channel Protocol Ports
------+-------------+-----------+----------------- ------------------------------
1 Po1 (SU) PAgP Fa0 / 1 (P) Fa0 / 2 (P) Fa0 / 3 (P)
Fa0 / 4 (P)

Check with Ethereal:
When the four ports are up



When we shut dow of a port group that is fa0 / 2 and fa0 / 3, we have the following result



Configuring LACP
For this configuration, we also use four fa0/1- interface fa0 / 4 as EtherChannel, consider here only 2 Core Switch and Switch Access. Show run to test configuration
Core
!
Core hostname
!
enable password cisco
!
ip subnet-zero
!
LACP system-priority 100
!
interface Port-channel1
no ip address
!
interface FastEthernet0 / 1
switchport trunk encapsulation dot1q
switchport mode trunk
no ip address
channel-group 1 mode active
LACP channel-protocol
!
interface FastEthernet0 / 2
switchport trunk encapsulation dot1q
switchport mode trunk
no ip address
channel-group 1 mode active
LACP channel-protocol
!
interface FastEthernet0 / 3
switchport trunk encapsulation dot1q
switchport mode trunk
no ip address
channel-group 1 mode active
LACP channel-protocol
!
interface FastEthernet0 / 4
switchport trunk encapsulation dot1q
switchport mode trunk
no ip address
channel-group 1 mode active
LACP channel-protocol
!
interface FastEthernet0 / 5
switchport mode access
no ip address
spanning-tree portfast
!
interface FastEthernet0 / 6
no ip address
!
interface FastEthernet0 / 7
no ip address
!
interface FastEthernet0 / 8
no ip address
!
interface FastEthernet0 / 9
no ip address
interface FastEthernet0/10
no ip address
!
interface FastEthernet0/11
no ip address
!
interface FastEthernet0/12
no ip address
!
interface FastEthernet0/13
no ip address
!
interface FastEthernet0/14
no ip address
!
interface FastEthernet0/15
no ip address
!
interface FastEthernet0/16
no ip address
!
interface FastEthernet0/17
no ip address
!
interface FastEthernet0/18
no ip address
!
interface FastEthernet0/19
no ip address
!
interface FastEthernet0/20
no ip address
!
interface FastEthernet0/21
no ip address
!
interface FastEthernet0/22
no ip address
!
interface FastEthernet0/23
no ip address
!
interface FastEthernet0/24
no ip address
!
interface GigabitEthernet0 / 1
no ip address
!
interface GigabitEthernet0 / 2
no ip address
!
interface VLAN1
ip address 192.168.5.1 255.255.255.0
define interface-range intensity FastEthernet0 / 1-4
!
ip classless
ip http server
!
monitor session 1 source interface Po1
monitor session 1 destination interface Fa0 / 5
end

Access
!
Access hostname
!
enable password cisco
!
ip subnet-zero
!
no ip domain-lookup
!
spanning-tree mode pvst
spanning-tree extend system-id
LACP system-priority 10
!
interface Port-channel1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0 / 1
switchport trunk encapsulation dot1q
switchport mode trunk
full duplex
speed 100
channel-group 1 mode active
LACP channel-protocol
!
interface FastEthernet0 / 2
switchport trunk encapsulation dot1q
switchport mode trunk
full duplex
speed 100
channel-group 1 mode active
LACP channel-protocol
!
interface FastEthernet0 / 3
switchport trunk encapsulation dot1q
switchport mode trunk
full duplex
speed 100
channel-group 1 mode active
LACP channel-protocol
!
interface FastEthernet0 / 4
switchport trunk encapsulation dot1q
switchport mode trunk
full duplex
speed 100
channel-group 1 mode active
LACP channel-protocol
!
interface FastEthernet0 / 5
switchport mode access
spanning-tree portfast
!
interface FastEthernet0 / 6
switchport mode dynamic Desirable
!
interface FastEthernet0 / 7
switchport mode dynamic Desirable
!
interface FastEthernet0 / 8
switchport mode dynamic Desirable
!
interface FastEthernet0 / 9
switchport mode dynamic Desirable
!
interface FastEthernet0/10
switchport mode dynamic Desirable
!
interface FastEthernet0/11
switchport mode dynamic Desirable
!
interface FastEthernet0/12
switchport mode dynamic Desirable
!
interface FastEthernet0/13
switchport mode dynamic Desirable
!
interface FastEthernet0/14
switchport mode dynamic Desirable
!
interface FastEthernet0/15
switchport mode dynamic Desirable
interface FastEthernet0/16
switchport mode dynamic Desirable
!
interface FastEthernet0/17
switchport mode dynamic Desirable
!
interface FastEthernet0/18
switchport mode dynamic Desirable
!
interface FastEthernet0/19
switchport mode dynamic Desirable
!
interface FastEthernet0/20
switchport mode dynamic Desirable
!
interface FastEthernet0/21
switchport mode dynamic Desirable
!
interface FastEthernet0/22
switchport mode dynamic Desirable
!
interface FastEthernet0/23
switchport mode dynamic Desirable
!
interface FastEthernet0/24
switchport mode dynamic Desirable
!
interface GigabitEthernet0 / 1
switchport mode dynamic Desirable
!
interface GigabitEthernet0 / 2
switchport mode dynamic Desirable
!
interface VLAN1
ip address 192.168.5.2 255.255.255.0
define interface-range intensity FastEthernet0 / 1-4
!
ip classless
ip http server
end
Check
LACP neighbor show commands:
SW1 # show LACP neighbor
Flags: S - Device is sending Slow LACPDUs F - Device is sending Fast LACPDUs
A - Device is in Active mode P - Device is in Passive mode
Channel group 1 neighbors
Partner's information:

Partner Partner Partner
Port System ID Port Number Age Flags
Fa0 / 1 00010,000 d.299a.7e00 SA 0x0 29S
LACP Partner Partner Partner
Oper Key Port State Port Priority
32768 0x1 0x3D
Partner's information:
Partner Partner Partner
Port System ID Port Number Age Flags
Fa0 / 2 11s 0x1 SA d.299a.7e00 00010,000
LACP Partner Partner Partner
Oper Key Port State Port Priority
32768 0x1 0x3D
Partner's information:
Partner Partner Partner
Port System ID Port Number Age Flags
Fa0 / 3 00010,000 d.299a.7e00 SA 0x2 27s
LACP Partner Partner Partner
Oper Key Port State Port Priority
32768 0x1 0x3D
Partner's information:
Partner Partner Partner
Port System ID Port Number Age Flags
Fa0 / 4 00010,000 d.299a.7e00 SA 0x3 12s
LACP Partner Partner Partner
Oper Key Port State Port Priority
32768 0x1 0x3D
Check the status of the port with internal or show EtherChannel LACP show detail

SW1 # show internal LACP
Flags: S - Device is sending Slow LACPDUs F - Device is sending Fast LACPDUs
A - Device is in Active mode P - Device is in Passive mode

Channel group 1
LACP port Admin Port Port oper
Port Flags State Priority Key Key Number State
Fa0 / 1 SA 0x1 0x1 0x0 0x3D bndl 32768
Fa0 / 2 SA 32768 0x1 0x1 0x1 0x3D bndl
Fa0 / 3 SA 0x1 0x1 0x2 0x3D bndl 32768
Fa0 / 4 SA 0x1 0x1 0x3 0x3D bndl 32768
Checking sys command priority
LACP SW2 # show sys-id
150, 000d.299a.7e00
By Ethereal is the same as in the case PAgP