Bài Viết Về EtherChannelTác giả Lê Văn Cương Giới Thiệu Về EtherChannel etherchannel Nguyên tắc phân phối tải qua etherchannel: Việc phân phối tải qua các đường của một bundleetherchann
Trang 1Bài Viết Về EtherChannel
Tác giả Lê Văn Cương
Giới Thiệu Về EtherChannel
etherchannel
Nguyên tắc phân phối tải qua etherchannel:
Việc phân phối tải qua các đường của một bundle(etherchannel) được thực hiện theo thuật toán hashing: Thuật toán này có thể sử dụng : Địa chỉ IP nguồn, đích; Hoặc địa chỉ MAC nguồn, dích, hoặc có thể sử dụng TCP/UDP port
- Nếu chỉ sử dụng một địa chỉ hay một port thì việc truyền tải qua port này hay port khác được thực hiện dựa vào các bit cuối cùng, và phụ thuộc vào số port của etherchannel
- Nếu sử dụng cả địch, và nguồn thì thuật toán này được thực hiện nhờ phép toán XOR các bit cuối của địa chỉ
Các lệnh cơ bản để cấu hình Ethechannel
- Cấu hình PAGP Ethechannel:
Switch(config-if)#channel-protocol pagp Switch(config-if)#channel-group number mode {on | auto | desirable }
- Các mode:
- ON mode: ở mode này thì Switch tự động enale etherchannel tuy nhiên nó lại không gởI hay nhận bất kỳ
Trang 2gói PAGP nào, do đó mà phải cấu hình on mode ở hai dầu
- Auto mode: Nó sẻ tự động enable ethechannel nếu nónhận được PAGP packet
- Desirable: Nó sẻ tự động cố gắng yêu cầu đầu kia enable ethechannel
- Ta còn xác định priority của port để xác định xem port nào là active và port nào ở trạng thái standby Port
có priority nhỏ sẽ active và, lớn sẽ ở trạng thái standby
- Các mode trong lệnh channel-group On, Passive, active tuần tự tương tự như On, Auto , Desirable trong PAGP
Cấu hình cho sơ đồ thực tế
Trang 31 Giải thích sơ bộ về sơ đồ trên:
Ở sơ đồ này ta lấy lại sơ đồ bài qos trứơc để thực hiện Etherchannel giữa Core
va Access Switch Ở đây thì ta sử dụng 4 port fastethernet 0/1 – 0/4 làm
etherchannel, Ta sẽ cấu hình ehterchannel dùng cả PAGP, và LACP Trước hết
Trang 4service timestamps debug uptimeservice timestamps log uptime
Trang 5channel-group 1 mode desirable
Trang 6switchport access vlan 2
switchport mode access
Trang 11spanning-tree extend system-id
Trang 12switchport mode dynamic desirable duplex full
Trang 13switchport mode dynamic desirable
Trang 15switchport mode dynamic desirable
Trang 16monitor session 1 source interface Po1
monitor session 1 destination interface Fa0/10end
Trang 18interface Ethernet0/0
ip address 192.168.1.1 255.255.255.0 half-duplex
Trang 24-Port state = Up Mstr In-Bndl
Channel group = 1 Mode = Desirable-Sl Gcchange = 0Port-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 GroupPort Name Device ID Port Age Flags Cap.Fa0/1 Access 000d.bc33.2b00 Fa0/1 0s
Trang 25SC 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 channel = Po1
port-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
Trang 26-Port state = Up Mstr In-Bndl
Channel group = 1 Mode = Desirable-Sl Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo channel = Po1
port-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
Trang 27d - 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 GroupPort Name Device ID Port Age Flags Cap.Fa0/3 Access 000d.bc33.2b00 Fa0/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 channel = Po1
port-Port index = 0 Load = 0x00 Protocol = PAgP
Trang 28Flags: 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
Age of the port in the current state: 00d:00h:48m:29s
- Ta có thể sử dụng lênh show etherchannel summary để dể xemxét hơn
Trang 29Core#show etherchannel summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
u - unsuitable for bundling
U - in use f - failed to allocate aggregator
4 Kiểm tra bằng Ethereal:
- Khi 4 port đều up
Trang 30- Khi ta shut dow một cổng của group đó là fa0/2 và fa0/3 ta có kết quả sau
Trang 315 Cấu hình LACP
Đối với cấu hình này thì ta cũng sữ dụng 4 interface fa0/1- fa0/4 làm etherchannel, Ở đây chỉ xét đến 2 Switch Core và Switch Access thôi
- Show run để kiểm tra cấu hình
Core#sho run
Building configuration
Current configuration : 2142 bytes
!version 12.1
no service padservice timestamps debug uptimeservice timestamps log uptime
no service password-encryption
!hostname Core
!enable password cisco
Trang 37service timestamps debug uptime
service timestamps log uptime
no service password-encryption
Trang 39channel-group 1 mode active
Trang 41switchport mode dynamic desirable
Trang 43switchport mode dynamic desirable
!interface GigabitEthernet0/2 switchport mode dynamic desirable
!interface Vlan1
ip address 192.168.5.2 255.255.255.0define interface-range cuong FastEthernet0/1 - 4
!
ip classless
ip http serverline con 0 logging synchronousline vty 0 4
no loginline vty 5 15 login
!end
Trang 446 Kiểm tra
- Lệnh show lacp neighbor:
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 FlagsFa0/1 00010,000d.299a.7e00 0x0 29s SA LACP Partner Partner Partner
Port Priority Oper Key Port State
32768 0x1 0x3D
Partner's information:
Partner Partner Partner
Port System ID Port Number Age FlagsFa0/2 00010,000d.299a.7e00 0x1 11s SA
Trang 45LACP Partner Partner Partner Port Priority Oper Key Port State
32768 0x1 0x3DPartner's information:
Partner Partner PartnerPort System ID Port Number Age FlagsFa0/3 00010,000d.299a.7e00 0x2 27s SA LACP Partner Partner Partner
Port Priority Oper Key Port State
32768 0x1 0x3DPartner's information:
Partner Partner PartnerPort System ID Port Number Age FlagsFa0/4 00010,000d.299a.7e00 0x3 12s SA LACP Partner Partner Partner
Port Priority Oper Key Port State
Trang 46Flags: 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 Oper Port PortPort Flags State Priority Key Key Number StateFa0/1 SA bndl 32768 0x1 0x1 0x0 0x3D Fa0/2 SA bndl 32768 0x1 0x1 0x1 0x3D Fa0/3 SA bndl 32768 0x1 0x1 0x2 0x3D Fa0/4 SA bndl 32768 0x1 0x1 0x3 0x3D
- Kiểm tra sys priority bằng lệnh
Sw2#show lacp sys-id
150 ,000d.299a.7e00
- Bằng Ethereal thì tương tự như trong trường hợp PAGP