Note : L'agrégat est réalisé entre deux switchs de marque Cisco. Par défaut, LACP et Etherchannel y sont désactivés.
1 Entrer dans la configuration
Entrer dans la config d'un groupe de ports
S1(config)# interface range FastEthernet0/1 - 2
Créer et nommer le canal (LACP)
S1(config-if-range)# channel-group 1 mode active
Le mot "active" détermine le protocole de contrôle. ici : active => LACP
Configurer le canal comme si c'était une interface
S1(config)# interface port-channel 1
S1(config-if)# switchport mode trunk
S1(config-if)# switchport trunk allowed vlan 1,2,20
et voilà
Voir doc sympa : Cisco Etherchannel : configuration, vérification et dépannage
Vérification du fonctionnement
En cas de problème, vérifier la config des ports (même techno, même(s) vlan(s) ou trunk partout - pas recommandé), vérifier les modes en correspondance.
Afficher l'état général d'un canal
S1# show interfaces port-channel 1
Port-channel1 is up, line protocol is up (connected)
Hardware is EtherChannel, address is c07b.bcc4.a981 (bia c07b.bcc4.a981)
MTU 1500 bytes, BW 200000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
(output omitted)
On voit ici que le canal 1 est actif (up), son adresse mac du canal (c0:7b:bd:d4:a8:81) et le débit (200000Kb/s = 200Mb/s BW = band width = bande passante)
Afficher un récap de l'état des canaux
S1# 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 - formé par Auto LAG
Number of channel-groups in use: 2
Number of aggregators: 2
Group Port-channel Protocol Ports
-----+------------+-----------+-----------------------------------------------
1 Po1(SU) LACP Fa0/1(P) Fa0/2(P)
2 Po2(SD) - Gi0/0/0(D) Gi0/0/1(D)
Dernière(s) lignes, un tableau des canaux définis avec leur état :
- SU= up, SD=down
- Po1 = pseudo port-channel 1
Afficher les infos sur un port d'un canal
S1# show etherchannel port-channel
Channel-group listing:
----------------------
Groupe : 1
----------
Port-channels in the group:
---------------------------
Port-channel: Po1 (Primary Aggregator)
------------
Age of the Port-channel = 0d:01h:02m:10s
Logical slot/port = 2/1 Number of ports = 2
HotStandBy port = null
Port state = Port-channel Ag-Inuse
Protocole = LACP
Port security = Disabled
Load share deferral = Disabled
Ports in the Port-channel:
Index Load Port EC state No of bits
------+------+------+------------------+-----------
0 00 Fa0/1 Active 0
0 00 Fa0/2 Active 0
Time since last port bundled: 0d:00h:09m:30s Fa0/2
Affichage du groupe 1, d'informations sur ce groupe et des ports utilisés par le groupe
Afficher les infos sur le rôle de l'interface dans le canal etherchannel
S1# show interfaces fa0/1 etherchannel
Port state = Up Mstr Assoc In-Bndl
Channel group = 1 Mode = Active Gcchange = -
Port-channel = Po1 GC = - Pseudo port-channel = Po1
Port index = 0 Load = 0x00 Protocol = LACP
Flags: S - Device is sending Slow LACPDUs F - Device is sending fastLACPDUs.
A - Device is in active mode. P - Device is in passive mode.
Local information:
LACP port Admin Oper Port
Port Flags State Priority Key Number State
Fax/1 SA bndl 32768 0x1 0x1 0x102 0x3D
Partner's information:
LACP port Admin Oper Port Port
Port Flags Priority Dev ID Age key Key Number State
Fa0/1 SA 32768 c025.5cd7.ef00 12s 0x0 0x1 0x102 0x3Dof the port in the current state: 0d:00h:11m:51s allowed vlan 1,2,20
Affichage d'informations sur un port et des informations de canal auquel il participe.
On retrouve le numéro du groupe, l'état et le mode (SA), la priorité, la durées de fonctionnement, les vlan autorisés, etc. …
Afficher la configuration des canaux de ports
S1# show run | begin interface port-channel
interface Port-channel1
switchport trunk allowed vlan 1,2,20
switchport mode trunk
!
interface FastEthernet0/1
switchport trunk allowed vlan 1,2,20
switchport mode trunk
channel-group 1 mode on
!
interface FastEthernet0/2
switchport trunk allowed vlan 1,2,20
switchport mode trunk
channel-group 1 mode on
! ======================================
S2# show run | begin interface port-channel
interface Port-channel1
switchport trunk allowed vlan 1,2,20
switchport mode trunk
!
interface FastEthernet0/1
switchport trunk allowed vlan 1,2,20
switchport mode trunk
channel-group 1 mode desirable
!
interface FastEthernet0/2
switchport trunk allowed vlan 1,2,20
switchport mode trunk
channel-group 1 mode desirable
Les deux commandes sont faites sur chaque switch (S1 et S2).
On constate ici une incohérence entre les modes on et desirable (voir le tableau des modes).
Le canal ne peut donc être établi avant de modifier la configuration sur l'un des switch.
Ces différentes commandes permettent de vérifier le fonctionnement et de déterminer les causes de blocage.