How to configure the port breakout in SONiC?

[stordis-toc]

Introduction

Welcome to the STORDIS Support Portal guide!

This article explains how to manually configure port breakout in SONiC by modifying the port_config.ini file. This method is essential for platforms that use static configuration to split high-speed ports (e.g., 100G) into multiple lower-speed channels (e.g., 4x25G).

 

Prerequisites

  • Access to the SONiC switch via console or SSH
  • Administrator or root privileges
  • Basic knowledge of the Vim text editor

     

 

Step-By-Step Guide

Follow these steps to configure port breakout by editing the underlying configuration files:

STEP 1: Navigate to your hardware configuration directory e.g.

admin@sonic:~$ cd /usr/share/sonic/device/x86_64-accton_as7712_32x-r0/Accton-AS7712-32X/

Note: The exact path may vary depending on your installation, but typically it resides in the directory named after your switch model.

STEP 2: Edit the port_config.ini file.

Open the file using Vim:

admin@sonic:~$ sudo vim port_config.ini

Locate the port you wish to break out. You must redefine the lanes and speed for each sub-port.

Example: Breaking out Ethernet0 (100G) into 4x25G

Change this:

Into this:

To save and exit in Vim, press Esc, type :wq, and press Enter.

STEP 3: Apply the changes to the Configuration Database.

After saving the file, you need to adjust the file config_db.json to match the port_config.ini file:

admin@sonic:~$ sudo vim /etc/sonic/config_db.json

Change this:

"PORT": {
"Ethernet0": {
"admin_status": "up",
"alias": "Eth1(Port1)",
"autoneg": "off",
"dhcp_rate_limit": "300",
"index": "1",
"lanes": "49,50,51,52",
"mtu": "9100",
"speed": "100000",
"subport": "0"
},

Into this:

"PORT": {
"Ethernet0": {
"admin_status": "up",
"alias": "Eth1(Port1)",
"autoneg": "off",
"dhcp_rate_limit": "300",
"index": "1",
"lanes": "49",
"mtu": "9100",
"speed": "25000",
"subport": "0"
},
"Ethernet1": {
"admin_status": "up",
"alias": "Eth1(Port1)",
"autoneg": "off",
"dhcp_rate_limit": "300",
"index": "1",
"lanes": "50",
"mtu": "9100",
"speed": "25000",
"subport": "0"
},
"Ethernet2": {
"admin_status": "up",
"alias": "Eth1(Port1)",
"autoneg": "off",
"dhcp_rate_limit": "300",
"index": "1",
"lanes": "51",
"mtu": "9100",
"speed": "25000",
"subport": "0"
},
"Ethernet3": {
"admin_status": "up",
"alias": "Eth1(Port1)",
"autoneg": "off",
"dhcp_rate_limit": "300",
"index": "1",
"lanes": "52",
"mtu": "9100",
"speed": "25000",
"subport": "0"
},

To save and exit in Vim, press Esc, type :wq, and press Enter.

STEP 4: After saving the file, you need to reload the configuration so SONiC can rebuild the config_db.json:

admin@sonic:~$ sudo config reload -y

STEP 5: Verify the new port configuration.

admin@sonic:~$ show interfaces status

Check if the interfaces (e.g., Ethernet0 through Ethernet3) are present and reporting the correct speed (25000).

STEP 6: Save the running configuration.

admin@sonic:~$ sudo config save -y

 

Congratulations!

You have successfully manually configured port breakout on your SONiC switch. Your interface density is now optimized for your network requirements.

Happy networking!

 

Useful links:

Official SONiC Wiki: How to breakout a port

STORDIS Support Portal FAQ 

Comments 0

Articles in this section