How to Configure Portchannel (Link Aggregation Group - LAG)

How to Configure Portchannel (Link Aggregation Group - LAG)

Portchannel (Link Aggregation Group - LAG) 

Objective 

This document explains how to configure a port channel (Link Aggregation Group, LAG) . A port channel is a logical communication link that combines multiple physical Ethernet ports into one aggregated connection, increasing bandwidth and providing redundancy between two network devices (such as switches or routers). 

Prerequisites 

Hardware: 

  • Switches or routers that support VLANs 
    (e.g., edgecore, ufispace) 

Software: 

  • Network operating systems that support VLAN configuration 
    (e.g., SONiC-OS-4.4.0-Enterprise_Base, SONiC-OS-4.4.2-Enterprise_Base) 

Access: 

  • Administrative or privileged CLI access 

Network: 

  • At least two physical interfaces per side to bundle into the port channel 

  • Consistent configuration on both ends (same speed, duplex, MTU, etc.) 

Topology Diagram 

Picture 
 

Example: 

Aggregating multiple links between two switches to increase bandwidth and provide failover. 

Basic Configuration Steps 

1. Identify Member Interfaces 

Choose the interfaces to include in the port channel. 

 

2. Create Port Channel 

Define the logical port channel or channel group on the device. 

Syntax: 

sonic# configure terminal 
sonic(config)# interface PortChannel <id> 
sonic(config-if-po1)# description <string> 

 

Example: 

sonic(config)# interface PortChannel 1 

sonic(config-if-po1)# description portchannel-for-testing 

3. Assign Interfaces to the Port Channel 

Add the selected physical interfaces into the port channel. 

Syntax: 

sonic# configure terminal 
sonic(config)# interface Ethernet <interface_id> 

sonic(config-if)# channel-group <port-channel-id> 

 

Example: 

sonic(config)# interface Ethernet 124 
sonic(config-if)# channel-group 1 

 

Example Configuration (DUT_1 and DUT_2) 

DUT_1 

configure terminal 
interface PortChannel 1 
description portchannel-for-testing 
 
interface ethernet 124 
channel-group 1 
 
interface ethernet 128 
channel-group 1 

 

DUT_2 

configure terminal 
interface PortChannel 1 
description portchannel-for-testing 
 
interface ethernet 64 
channel-group 1 
 
interface ethernet 68 
channel-group 1 

 
 

 

Verification 

show port-channel summary           #shows port channel status 

show interfaces status              #shows interface status  

#Check used interfaces admin and oper status is up or not. 

 

Troubleshooting Tips 

  • Ensure identical configuration (speed, duplex, MTU) on both ends. 

  • Check that all member interfaces are up and properly joined. 

  • Verify LACP mode (active/passive) matches on both sides. 

  • Monitor show port-channel and show lacp outputs for mismatches or failures. 

  • Review logs for interface or aggregation-related errors. 

    • Related Articles

    • How to Configure MC-LAG (Multi-Chassis Link Aggregation)

      MC-LAG (Multi-Chassis Link Aggregation) Objective This document explains how to configure MC-LAG (Multi-Chassis Link Aggregation) between two switches and a host. MC-LAG provides link redundancy and load balancing by allowing two physical switches to ...
    • How to configure BGP

      BGP (Border Gateway Protocol) Objective BGP (Border Gateway Protocol) is the protocol that enables the global routing system of the internet. It manages how packets get routed from network to network by exchanging routing and reachability information ...
    • How to configure subinterface

      Sub-Interface: Sub interfaces divide the parent interface into two or more virtual interfaces on which you can assign unique Layer 3 parameters such as IP addresses and dynamic routing protocols. The IP address for each sub interface should be in a ...
    • How to configure vlan

      VLAN (Virtual Local Area Network) Objective A VLAN (Virtual Local Area Network) allows network administrators to logically segment Layer 2 broadcast domains within a switch or across multiple switches. This segmentation is independent of the physical ...
    • How to Configure Basic VRF Management

      VRF Management Objective This document explains how to configure Basic VRF (Virtual Routing and Forwarding) Management on SONiC-OS-4.4.2-Enterprise_Base. Management VRF provides a separate routing table specifically for out-of-band management ...