EtherChannel et agrégation de liens
Définition
EtherChannel est une technologie qui permet de regrouper plusieurs liens physiques parallèles entre deux switches en un seul lien logique (Port-channel). Cela augmente la bande passante agrégée, fournit de la redondance en cas de panne d'un lien, et évite que le Spanning Tree Protocol (STP) ne bloque les liens redondants.
Contexte
Sans EtherChannel, si deux switches sont connectés par 4 câbles Gigabit, STP en bloquera 3 pour éviter les boucles — seul 1 Gbps sera utilisé. Avec EtherChannel, les 4 liens forment un seul canal logique de 4 Gbps sans boucle STP. La certification CCST couvre les principes de l'agrégation de liens.
Détails techniques
Protocoles de négociation
| Protocole | Standard | Modes |
|---|---|---|
| PAgP (Port Aggregation Protocol) | Propriétaire Cisco | desirable (initie), auto (attend) |
| LACP (Link Aggregation Control Protocol) | IEEE 802.3ad | active (initie), passive (attend) |
Static (mode on) |
Aucun | Pas de négociation — force l'agrégation |
Recommandation : utiliser LACP car c'est un standard ouvert, compatible multi-vendeur.
Règles de compatibilité
Pour que les ports puissent former un EtherChannel, ils doivent tous avoir :
- La même vitesse et le même duplex
- Le même mode (tous access dans le même VLAN, ou tous trunk avec les mêmes VLANs autorisés)
- La même configuration STP (même coût, même priorité)
- Pas de configuration contradictoire (port-security, SPAN, etc.)
Combinaisons de modes
PAgP :
| Côté A | Côté B | Résultat |
|---|---|---|
| desirable | desirable | EtherChannel formé |
| desirable | auto | EtherChannel formé |
| auto | auto | Pas de canal (aucun côté n'initie) |
LACP :
| Côté A | Côté B | Résultat |
|---|---|---|
| active | active | EtherChannel formé |
| active | passive | EtherChannel formé |
| passive | passive | Pas de canal (aucun côté n'initie) |
Configuration LACP
! Switch A
Switch-A(config)# interface range GigabitEthernet 0/1 - 4
Switch-A(config-if-range)# channel-group 1 mode active
Switch-A(config-if-range)# exit
Switch-A(config)# interface port-channel 1
Switch-A(config-if)# switchport mode trunk
Switch-A(config-if)# switchport trunk allowed vlan 10,20,30
! Switch B
Switch-B(config)# interface range GigabitEthernet 0/1 - 4
Switch-B(config-if-range)# channel-group 1 mode active
Switch-B(config-if-range)# exit
Switch-B(config)# interface port-channel 1
Switch-B(config-if)# switchport mode trunk
Switch-B(config-if)# switchport trunk allowed vlan 10,20,30
Algorithme de répartition du trafic (load balancing)
EtherChannel ne fait pas du round-robin paquet par paquet. Il utilise un hash basé sur certains critères pour distribuer les flux sur les liens membres :
| Méthode | Hash basé sur |
|---|---|
src-mac |
Adresse MAC source |
dst-mac |
Adresse MAC destination |
src-dst-mac |
Combinaison source + destination MAC |
src-ip |
Adresse IP source |
dst-ip |
Adresse IP destination |
src-dst-ip |
Combinaison source + destination IP (recommandé) |
Switch(config)# port-channel load-balance src-dst-ip
Commandes de vérification
| Commande | Information |
|---|---|
show etherchannel summary |
Vue d'ensemble de tous les port-channels (état, protocole, membres) |
show etherchannel port-channel |
Détails du port-channel (STP, flags) |
show etherchannel detail |
Informations complètes (timers, élection) |
show interfaces port-channel 1 |
Compteurs et état du lien logique |
show lacp neighbor |
Informations LACP des voisins |
Symboles dans show etherchannel summary
| Flag | Signification |
|---|---|
P |
Port bundled (intégré au canal) |
s |
Port en standby |
D |
Port down |
I |
Port standalone (incompatible) |
SU |
Port-channel L2 In Use |
RU |
Port-channel L3 In Use |
Exemple concret
Scénario : deux switches de distribution (DS1 et DS2) sont interconnectés par 4 câbles Gigabit pour assurer la redondance et la performance vers le cœur de réseau.
- Sans EtherChannel : STP bloque 3 liens → 1 Gbps effectif.
- Avec EtherChannel LACP (4 × 1 Gbps) :
- Bande passante agrégée : 4 Gbps.
- Si un câble est débranché : le canal passe à 3 Gbps (dégradation gracieuse, pas de coupure).
- Le trafic est réparti via hash
src-dst-ippour une distribution équilibrée.
show etherchannel summary:Group Port-channel Protocol Ports ------+-------------+-----------+------------------------------ 1 Po1(SU) LACP Gi0/1(P) Gi0/2(P) Gi0/3(P) Gi0/4(P)- Tous les ports sont bundled (
P) et le canal est opérationnel (SU).