etherchannellacppagp
MDstable
NoteSnippetChecklistPlaybook
EtherChannel — LACP & PAgP
Agréger des liens physiques en EtherChannel (LACP/PAgP) pour redondance et bande passante
snippetintermediate 2025-05-14 5 min read
etherchannellacppagpciscobondinglink-aggregation802.3ad
Concepts
EtherChannel agrgation de liens physiques en un lien logique uniqueNoms quivalents LAG Link Aggregation Group bonding Linux 802 LACPAvantagesBande passante cumule 2 2 Gbps logiqueRedondance si un lien tombe le traffic bascule sur les autres sans convergence STPSTP voit un seul lien logique pas de port bloquProtocoles de ngociationLACP 802 standard IEEE interoprable RECOMMANDPAgP propritaire Cisco viter sur infra multi-vendorStatic on pas de ngociation risque de boucle si mal configurModes LACPactive initie la ngociation LACP recommandpassive attend la ngociation de lautre ctactive/active ou active/passive fonctionnent ; passive/passive pas de channelModes PAgPdesirable initie la ngociation PAgPauto attend la ngociation de lautre ctdesirable/desirable ou desirable/auto fonctionnentLimite max 8 ports actifs par EtherChannel Cisco 8 en standby avec LACP
Configuration Cisco — LACP (L2)
EtherChannel L2 entre deux switches
text
! ── Sur SW1 ──────────────────────────────────────────conf tinterface range GigabitEthernet0/1-2! Prérequis : même speed, duplex, mode (access ou trunk) sur tous les portsswitchport mode trunkswitchport trunk encapsulation dot1qswitchport trunk allowed vlan 10,20,30channel-group 1 mode active ! LACP activeno shutdown! L'interface logique Po1 est créée automatiquementinterface Port-channel1description ** EtherChannel vers SW2 **switchport mode trunkswitchport trunk encapsulation dot1qswitchport trunk allowed vlan 10,20,30! ── Sur SW2 ──────────────────────────────────────────conf tinterface range GigabitEthernet0/1-2switchport mode trunkswitchport trunk encapsulation dot1qswitchport trunk allowed vlan 10,20,30channel-group 1 mode active ! active/active = OK avec LACPno shutdowninterface Port-channel1description ** EtherChannel vers SW1 **switchport mode trunkswitchport trunk encapsulation dot1qswitchport trunk allowed vlan 10,20,30
EtherChannel L2 access (vers serveur)
text
conf tinterface range GigabitEthernet0/3-4switchport mode accessswitchport access vlan 20channel-group 2 mode activeno shutdowninterface Port-channel2description ** Bond vers Serveur Linux **switchport mode accessswitchport access vlan 20
Configuration Cisco — PAgP
text
conf tinterface range GigabitEthernet0/1-2switchport mode trunkswitchport trunk encapsulation dot1qchannel-group 1 mode desirable ! PAgP desirableno shutdown
Configuration Cisco — Static (on/on)
text
! ATTENTION : mode "on" = pas de négociation! Si un côté est "on" et l'autre est en LACP/PAgP → boucle potentielle! Utiliser uniquement en lab ou si le protocole de négociation ne fonctionne pasconf tinterface range GigabitEthernet0/1-2channel-group 1 mode onno shutdown
EtherChannel L3 (routed)
text
Variables
{{L3_EC_IP}}
{{L3_EC_MASK}}
! Sur un switch L3 ou routeur — EtherChannel sans switchport (lien routé)conf tinterface range GigabitEthernet1/0/1-2no switchport ! mode routedchannel-group 1 mode activeno shutdowninterface Port-channel1description ** L3 EtherChannel vers Core **no switchportip address {{L3_EC_IP}} {{L3_EC_MASK}}no shutdown
Load balancing
text
Variables
{{SRC_IP}}
{{DST_IP}}
! Algorithme de répartition du trafic sur les membres du channel! Changer selon le type de trafic dominantconf t! Options disponibles (selon plateforme) :! dst-ip, dst-mac, src-dst-ip, src-dst-mac, src-dst-port, src-ip, src-macport-channel load-balance src-dst-ip ! recommandé pour trafic IP mixteport-channel load-balance src-dst-mac ! utile si peu d'IPs différentesport-channel load-balance src-dst-port ! pour flux TCP/UDP variés! Vérifier l'algorithme actuelshow etherchannel load-balance! Tester la répartition (hash) pour un flux donnétest etherchannel load-balance interface Port-channel1 ip {{SRC_IP}} {{DST_IP}}
Vérifications
text
! Vue résumée de tous les EtherChannelsshow etherchannel summary! Exemple de sortie :! Group Port-channel Protocol Ports! ------+-------------+-----------+------------------------------------------! 1 Po1(SU) LACP Gi0/1(P) Gi0/2(P)! SU = layer2, in use | P = bundled in port-channel! Détail complet (états LACP, timeouts, PDUs)show etherchannel 1 detail! État de l'interface Port-channelshow interfaces Port-channel1show interfaces Port-channel1 trunk! Membres d'un channelshow etherchannel 1 port-channel! Conteurs LACPshow lacp 1 internalshow lacp 1 neighborshow lacp counters
Troubleshooting
text
! Problèmes courants :! 1. Modes incompatibles → vérifier active/passive ou desirable/auto! 2. VLAN mismatch → les ports membres doivent avoir les mêmes VLANs autorisés! 3. Speed/duplex mismatch → tous les membres doivent être identiques! 4. STP → Port-channel doit hériter la config STP, pas les ports individuels! 5. Native VLAN différent → show interfaces trunk sur les deux côtés! Diagnosticshow interfaces GigabitEthernet0/1 status ! vérifier speed/duplexshow interfaces trunk ! vérifier VLAN allowedshow spanning-tree ! vérifier que Po1 est visibledebug lacp packet ! voir les PDUs LACP (lab uniquement)! Réinitialiser un EtherChannelconf tinterface range GigabitEthernet0/1-2no channel-group 1interface range GigabitEthernet0/1-2channel-group 1 mode active
Linux Bonding (équivalent)
Debian/Ubuntu — /etc/network/interfaces
bash
Variables
{{BOND_IP}}
{{BOND_MASK}}
{{BOND_GW}}
# Installer le paquet bonding si besoinapt install ifenslave# /etc/network/interfacesauto bond0iface bond0 inet staticaddress {{BOND_IP}}netmask {{BOND_MASK}}gateway {{BOND_GW}}bond-slaves eth0 eth1bond-mode 802 # LACPbond-miimon 100 # check liaison toutes les 100msbond-lacp-rate fast # LACP PDU toutes les 1s (défaut = slow = 30s)bond-xmit-hash-policy layer34 # load-balance src-dst IP+port
systemd-networkd
bash
Variables
{{BOND_IP}}
{{PREFIX}}
{{BOND_GW}}
# /etc/systemd/network/10-bond0.netdevNetDevNamebond0KindbondBondMode802MIIMonitorSecLACPTransmitRatefastTransmitHashPolicylayer34# /etc/systemd/network/20-bond0-slave.network (répéter pour eth1)MatchNameeth0NetworkBondbond0# /etc/systemd/network/30-bond0.networkMatchNamebond0NetworkAddress{{BOND_IP}}{{PREFIX}}Gateway{{BOND_GW}}
Vérification Linux
bash
cat /proc/net/bonding/bond0 # état détaillé (mode, membres, actif)ip link show bond0ethtool bond0
💡 Tip —
Tous les ports membres d'un EtherChannel doivent avoir une configuration identique : même speed, duplex, mode (access/trunk), VLANs autorisés et native VLAN. Un seul port avec une config différente empêche le channel de monter. Sur Cisco, show etherchannel summary affichera le port avec le flag "s" (suspended) ou "D" (down) au lieu de "P" (bundled).
OPS·BRAIN v1.027 notes · Networklocal