Home > Networking Solutions > Enterprise/Data Center Networking Solutions > Enterprise SONiC Networking Solutions > Guides > Enterprise SONiC Distribution by Dell Technologies - Lifecycle Management > Python-based SONiC CLI
The Python-based SONiC CLI is built on the implementation of Python Click library. The CLI component provides the administrators with a customizable approach to creating command-line tools. It uses the Python Click library to create a command-line interface. Click provides users with the option to perform various configurations and leverage the defaults that are provided with the package.
Note: For more information about Click, see https://click.palletsprojects.com/en/7.x/.
Note: The Python-based SONiC CLI is also referred to as the Click CLI, or SONiC CLI.
The following are some of the configurations supported using the Python-based SONiC CLI:
admin@sonic:~$ sudo config ?
Usage: config [OPTIONS] COMMAND [ARGS]...
SONiC command line - 'config' command
Options:
--help Show this message and exit.
Commands:
aaa AAA command line
acl ACL-related configuration tasks
bgp BGP-related configuration tasks
classifier Classifiers related configuration tasks
copp Configure COPP
core Configure coredump
custom_assert Configuration action on assert
ecn ECN-related configuration tasks
export
flow Flow related configuration tasks
hardware Configure hardware parameters
hostname
igmp_snooping igmp-snooping configuration tasks
interface Interface-related configuration tasks
***** OUTPUT TRUNCATED *****
Note: Root privilege is required to run the configuration commands.
For example, both IPv4 and IPv6 can be assigned to interfaces. To assign or remove an IP address for an interface, use the following commands:
sudo config interface ip add <interface-name> <ip-address>
sudo config interface ip remove <interface-name> <ip-address>
To assign the 192.168.1.0/31 IP address to Ethernet0 on the switch, enter the following command:
sudo config interface ip add Ethernet0 192.168.1.0/31
sudo config save
The below example shows the configuration of VLAN 1611 on a switch using the Python-based SONiC CLI.
To configure an interface in a VLAN, assign the VLAN ID, then assign an interface to the VLAN ID. Optionally, an IP address can be assigned to the VLAN.
Enter the following command to create VLAN 1611:
sudo config vlan add 1611
To add interface Ethernet4 to VLAN 1611, enter the following command:
sudo config vlan member add 1611 Ethernet4
To assign IP address 172.16.11.254/24 to VLAN 1611, enter the following command:
sudo config interface ip add Vlan1611 172.16.11.254/24