Command Line Reference
Basic Configuration
19 min
login device login device by default, asternos devices support login through both the serial console and ssh (secure shell) when initially logging into the switch, you will need to use the console port (referred to as the serial port below) to establish a connection after configuring the management interface's ip address, you can then use ssh to log into the switch local login via the serial console is the fundamental method for accessing the device, and it forms the basis for configuring other login methods the specific steps are as follows connect the lines connect the lines this series of switches utilize rj 45 connectors for serial console connections the distribution of serial console ports varies among different models generally, they can be found on the front panel of the device, while some might be located on the rear panel, often marked with the label "con " after the device is powered on, connect the switch's serial console port to a server or pc it's important to ensure that the communication parameter settings of the user terminal match the default configuration of the switch's serial console to establish communication the default values for each parameter are as shown in the table below parameter default value baud rate 115200 flow control method no flow control verification method no verification data bits 8 stop bits 1 serial port login device serial port login device initial login via console port connect to the device through the console port after pressing enter, a login prompt will appear welcome to minicom 2 7 options i18n compiled on nov 15 2018, 20 18 47 port /dev/ttyusb1, 11 24 17 debian gnu/linux 9 sonic ttys0 sonic login log in to the device using the default username and password sonic login admin password last login thu nov 3 17 17 59 utc 2016 from 192 168 0 79 on pts/0 linux sonic 5 10 34 asternos #5 smp preempt thu jul 14 08 20 14 edt 2022 aarch64 / \ | | | \ | | / \ / | / \ / || | / \\| ' || \\| || | | |\\ \\ / \ \\ \\| | | /| | | |\ || | | | ) | / / \\ \\| / \\ | \\ || | | | \\ | \\ / | / \ asterfusion network operating system help http //www asterfusion com/ last login wed jun 23 06 44 22 2021 from 192 168 10 198 entering cli view, please wait sonic# configure the management network port ip address sonic# configure sonic(config)# interface mgmt 0 sonic(config mgmt 0)# ip address 30 1 1 2/24 gw 30 1 1 1 sonic(config mgmt 0)# vrf mgmt save configuration sonic# write save running config existing files will be overwritten, continue? \[y/n] y running command /usr/local/bin/sonic cfggen d print data > /etc/sonic/config db json familiar with using cisco like command lines familiar with using cisco like command lines how to enter the command line view how to enter the command line view operation command description enter the cli view sonic cli by default, upon logging into the device, you will automatically enter the command line view if not, use 'sonic cli' exit the cli view system bash by default, use the 'system bash' command to return to the shell view use 'exit' if entering the cli view by 'sonic cli' before commond keywords commond keywords keywords description no cancel or disable a specific setting show this display the current configuration of the current view configure terminal enter the system configuration mode delete delete a configuration file reboot reboot the device write save the current configuration shutdown disable or turn off a port end return to privileged user mode exit exit to the previous level or log out command line usage assistance command line usage assistance when entering an incomplete keyword, pressing the tab or space key will automatically complete the keyword if you encounter issues while using the command line, you can utilize the help function to get assistance, eliminating the need to memorize extensive and intricate commands while entering a command, pressing the tab key will display a list of matching keywords entering "?" will provide hints for relevant keywords or explanations of parameters sonic# show \<tab> acl arp counters history image interface link aggregation lldp mac address platform running config startup config sub interface traffic sonic# configure terminal sonic(config)# access list l3 test ingress \<tab> \<cr> sonic(config)# access list l3 test \<enter> syntax error the command is not completed sonic(config)# access list l3 test1 ingress sonic(config l3 acl test1)# ? end exit to the exec mode exit exit from current mode no negate a command or set its defaults rule add an access list entry show show running config sonic(config l3 acl test1)# rule ? rule id (0 500) sonic(config l3 acl test1)# rule 1 ? source mac specify source mac address destination mac specify destination mac address ethernet type specify ethernet protocol type outer vlan specify outer vlan id vlan pri specify outer vlan priority configuration file management configuration file management the configuration files for this series of switches are in json (javascript object notation) format json is a lightweight data interchange format, and its file extension is typically json viewing configuration file viewing configuration file by default, the system configuration files are stored in the /etc/sonic directory the default system configuration file is named config db json when performing configuration saving or restoration operations, it's this file that gets modified, determining the initial configuration upon the device's next startup additionally, this directory also contains backups of configuration files, labeled with timestamps, which facilitates configuration recovery for users every time the "write" command is executed, a new config db json file is generated to save the current configuration, and the original file's name is modified to the format config db+timestamp configuration saving configuration saving after a user logs into the device, configurations made through command line operations or other means are temporary if you require persistent configurations, you should manually save the modified settings this involves updating the current configuration to the default configuration file, config db json if you don't save the configurations, the device's settings will revert to their state before modifications after a reboot operationmaintenance interface command description save configuration write display startup configuration show startup config equipment upgrade equipment upgrade the device supports multiple ways to copy the version image to the device to be upgraded copying images using tftp copying images using tftp the device and the file server communicate with each other the device functions as a tftp client and the file server functions as a tftp server you need to download the version image stored on the server to the device and complete the software version upgrade 1\ configure the ip address of the file server to ensure that the fileserver and the device are reachable 2\ start the tftp server of the device and complete the version image download admin\@sonic $ tftp tftp> help tftp> connect (to) 150 1 0 1 tftp> get asternos v5 2r001 bin received 17437 bytes in 0 0 seconds tftp> quit admin\@sonic $ ls asternos v5 2r001 bin copy the image using scp copy the image using scp 1\ configure the ip address of the file server to ensure that the file server and the device are reachable 2\ use the scp command on the device to complete the version image download admin\@sonic $ sudo scp server\@192 168 0 100 /share/asternos v5 2r001 bin admin\@sonic $ ls asternos v5 2r001 bin copy the image using a usb drive copy the image using a usb drive this method is suitable for the current no network environment but need to copy the version image to the device usually, the usb interface of the device is located on the front panel of the device insert the usb disk containing the system image into the usb port of the device execute the command to view the disk name corresponding to the usb disk admin\@sonic $ sudo /sbin/fdisk l create a directory for mounting the usb drive admin\@sonic $ sudo mkdir /mnt/usb/ mount the usb drive for example, the path of the usb drive is /dev/sdb4 please refer to the actual path admin\@sonic $ sudo mount /dev/sdb4 /mnt/usb enter the disk directory and copy files from the disk to the device admin\@sonic $ cd /mnt/usb admin\@sonic /mnt/usb$ sudo cp asternos v5 2r001 bin /home/admin executing the upgrade command executing the upgrade command operation command description execute the upgrade command image update image name if a configuration upgrade is required, please execute the "write" command to save the configuration before proceeding with the upgrade once the upgrade is completed without any errors, you'll need to manually restart the device to switch to the new version display the version show version
