SONiC Feature Control

How to Control Features in SONiC

Example model & SONiC version:

  • Aurora 830, Aurora 721, Aurora 621
  • Netberg SONiC: sonic-broadcom-202311.n0

SONiC has a lot of features available, but not all of them are enabled by default.

A CLI command is available to control the features:

admin@sonic:~$ sudo config feature
Usage: config feature [OPTIONS] COMMAND [ARGS]...
  Configure features
Options:
  -?, -h, --help  Show this message and exit.
Commands:
  autorestart  Enable/disable autosrestart of a feature
  fallback     set fallback for a feature
  owner        set owner for a feature
  state        Enable/disable a feature

The list of features, states, and statuses can be found here:

admin@sonic:~$ show feature
Usage: show feature [OPTIONS] COMMAND [ARGS]...
Commands:
  autorestart  Show auto-restart state for a feature
  config       Show feature config
  status       Show feature state

Example:

admin@sonic:~$ show feature status
Feature         State            AutoRestart     SetOwner
--------------  ---------------  --------------  ----------
bgp             enabled          enabled
database        always_enabled   always_enabled
dhcp_relay      disabled         enabled         local
eventd          enabled          enabled
gnmi            enabled          enabled
iccpd           disabled         enabled
lldp            enabled          enabled
macsec          disabled         enabled         local
mgmt-framework  enabled          enabled
mux             always_disabled  enabled
nat             disabled         enabled
p4rt            disabled         enabled
pmon            enabled          enabled
radv            enabled          enabled
sflow           disabled         enabled
snmp            enabled          enabled
swss            enabled          enabled
syncd           enabled          enabled
teamd           enabled          enabled

For example, BGP can be disabled using this command:

admin@sonic:~$ sudo config feature state bgp disabled
admin@sonic:~$ sudo config save -y
Running command: /usr/local/bin/sonic-cfggen -d --print-data > /etc/sonic/config_db.json

Now we can see this in the Feature status:

admin@sonic:~$ show feature status
Feature         State            AutoRestart     SetOwner
--------------  ---------------  --------------  ----------
bgp             disabled         enabled

Another example is the ICCPd service that provides the MC-LAG (MLAG) function. It is disabled by default.

admin@sonic:~$ sudo config feature state iccpd enabled
admin@sonic:~$ sudo config save -y
Running command: /usr/local/bin/sonic-cfggen -d --print-data > /etc/sonic/config_db.json

Now we can see this:

admin@sonic:~$ show feature status
Feature         State            AutoRestart     SetOwner
--------------  ---------------  --------------  ----------
bgp             enabled          enabled
database        always_enabled   always_enabled
dhcp_relay      disabled         enabled         local
eventd          enabled          enabled
gnmi            enabled          enabled
iccpd           disabled         enabled
NEWS

Latest news