Vamos a ver cómo configurar EtherChannel en un switch Capa 2 de Cisco, también conocido como LAG (link aggregation group).
Nota: En este capítulo veremos la configuración y funcionamiento de EtherChannel en la Capa 2, no en la Capa 3 (esto lo veremos en el capítulo 17).
Qués es EtherChannel y para qué Sirve
Dos switches vecinos pueden tener múltiples enlaces en paralelo entre ellos, como un único enlace lógico, llamado EtherChannel. Sin EtherChannel un switch maneja cada enlace por separado.
Sin EtherChannel, con enlaces en paralelo entre los switches, STP/RSTP podría bloquear todos los enlaces excepto uno, sin embargo con EtherChannel, el switch puede usar todos los enlaces balanceando el tráfico a través de los enlaces.
Cómo Configurar EtherChannel en un Switch Capa 2
Configuración Manual de EtherChannel
Paso 1. Usar el comando channel-group number mode on para agregar la interfaz física al channel.
Paso 2. Usar el mismo número en todas las interfaces físicas del switch. El número usado (channel-group number) puede diferir del usado en en los switches vecinos.

SW1# configure terminal Enter configuration commands, one per line. End with CNTL/Z. SW1(config)# interface fa 0/14 SW1(config-if)# channel-group 1 mode on SW1(config)# interface fa 0/15 SW1(config-if)# channel-group 1 mode on SW1(config-if)# ^Z SW1# show spanning-tree vlan 3 VLAN0003 Spanning tree enabled protocol ieee Root ID Priority 28675 Address 0019.e859.5380 Cost 12 Port 72 (Port-channel1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 28675 (priority 28672 sys-id-ext 3) Address 0019.e86a.6f80 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Po1 Root FWD 12 128.64 P2p Peer(STP) SW1# show etherchannel 1 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 - formed by Auto LAG Number of channel-groups in use: 1 Number of aggregators: 1 Group Port-channel Protocol Ports ------+-------------+-----------+----------------------------------------------- 1 Po1(SU) - Fa0/14(P) Fa0/15(P)
Configuración Dinámica de EtherChannel
Para configurar dinámicamente un EtherChannel es necesario usar un protocolo. Cisco soporta dos protocolos para cumplir esta función; PAgP (Port Aggregation Protocol) y el estándar IEEE LACP (Link Aggregation Control Protocol), basado en el estándar 802.3ad.
Existen diferencias entre ambos protocolos.
PAgP VS LACP
LACP soporta más enlaces en un channel -16- comparado con PAgP que soporta un máximo de 8.
Con LACP, sólo 8 pueden estar activos al mismo tiempo, mientras que los otros quedan en estado de espera para ser usados en caso que un enlace activo falle.
Ambos protocolos se configuran usando un channel-group, pero cada protocolo usa una manera de iniciar una negociación y de esperando que el otro comience la negociación.
El siguiente ejemplo muestra el modo de configuración según el protocolo:

Ejemplo de Verificación:
SW1# show etherchannel 1 port-channel Port-channels in the group: --------------------------- Port-channel: Po1 ------------ Age of the Port-channel = 0d:00h:04m:04s Logical slot/port = 16/1 Number of ports = 2 GC = 0x00020001 HotStandBy port = null Port state = Port-channel Ag-Inuse Protocol = PAgP Port security = Disabled Load share deferral = Disabled Ports in the Port-channel: Index Load Port EC state No of bits ------+------+------+------------------+----------- 0 00 Gi0/1 Desirable-Sl 0 0 00 Gi0/2 Desirable-Sl 0 Time since last port bundled: 0d:00h:03m:57s Gi0/2
Configuración Física de Interfaces y EtherChannel
Aunque todo esté configurado correctamente, otras configuraciones del switch podría evitar que un puerto sea parte de un EtherChannel. A continuación explico las razones.
Primero, antes de usar un puerto físico en un EtherChannel, el switch compara la configuración del nuevo puerto físico con los puertos existentes en el channel.
La configuración de esa nueva interfaz física debe ser la misma que la configuración de los puertos existentes; de lo contrario, el conmutador no agrega el nuevo enlace a la lista de interfaces aprobadas y en funcionamiento en el canal.
Es decir, la interfaz física permanece configurada como parte del PortChannel, pero no se usa como parte del channel, a menudo se coloca en un estado no operativo.
La lista de elementos que verifica el switch incluye lo siguiente:
- Velocidad
- Duplex
- Acceso operacional o estado del trunking (todos deben ser puertos -access- de acceso, o todos deben ser puertos -trunks- troncales)
- Si es un puerto de acceso (switchport mode access), verifica la VLAN de acceso
- Si es un puerto trunk, verifica la lista de VLAN permitida (comando switchport trunk allowed)
- Si es un puerto trunk, verifica la VLAN nativa
- Configuraciones de STP en la interfaz
Adicionalmente los switches verifican las configuraciones del switch vecino.
Para esto los switches usan PAgP o LACP ó Cisco Discovery Protocol (CDP) si están usando una configuración EtherChannel manual.
Cuando hacen esta verificación con el vecino, todas las configuraciones deben ser iguales, a excepción de STP.
Ejemplo de fallo
*Mar 1 23:18:56.132: %PM-4-ERR_DISABLE: channel-misconfig (STP) error detected on Po1, putting Gi0/1 in err-disable state *Mar 1 23:18:56.132: %PM-4-ERR_DISABLE: channel-misconfig (STP) error detected on Po1, putting Gi0/2 in err-disable state *Mar 1 23:18:56.132: %PM-4-ERR_DISABLE: channel-misconfig (STP) error detected on Po1, putting Po1 in err-disable state *Mar 1 23:18:58.120: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to down *Mar 1 23:18:58.137: %LINK-3-UPDOWN: Interface Port-channel1, changed state to down *Mar 1 23:18:58.137: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to down SW1# 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 - formed by Auto LAG Number of channel-groups in use: 1 Number of aggregators: 1 Group Port-channel Protocol Ports ------+-------------+-----------+----------------------------------------------- 1 Po1(SD) - Gi0/1(D) Gi0/2(D)
Distribución de Carga en EtherChannel
Puedes configurar la distribución de carga de un EtherChannel usando el comando port-channel load-balance method.
Comando de configuración (method) | Lógica que usa… | Capa |
---|---|---|
src-mac | Dirección MAC de origen | 2 |
dst-mac | Dirección MAC de destino | 2 |
src-dst-mac | Ambos, origen y destino de la dirección MAC | 2 |
src-ip | Dirección IP de origen | 3 |
dst-ip | Dirección IP de destino | 3 |
src-dst-ip | Ambos, origen y destino de la dirección IP | 3 |
src-port | Puerto origen de TCP o UDP | 4 |
dst-port | Puerto destino de TCP o UDP | 4 |
src-dst-port | Ambos, origen y destino de TCP o UDP | 4 |