Command Line Reference
Basic Configuration
21 min
login system login system by default, asternos appliances both support serial console based login and ssh based login the default user is username admin password asteros in the case of ssh login, the user can use the serial console configured management interface (mgmt 0) ip address serial login serial login \[ use cases ] debian gnu/linux 9 sonic ttys0 sonic login admin password last login mon jun 3 14 44 09 cst 2019 from 192 168 10 161 on pts/4 linux sonic 4 9 0 8 amd64 #1 smp debian 4 9 110 3+deb9u6 (2015 12 19) x86 64 / \ | | | \ | | / \ / | / \ / || | / \\| ' || \\| || | | |\\ \\ / \ \\ \\| | | /| | | |\ || | | | ) | / / \\ \\| / \\ | \\ || | | | \\ | \\ / | / \ asterfusion network operating system help http //www asterfusion com/ admin\@sonic enter the command line configuration interface enter the command line configuration interface to use the klish command line, you need to first enter the klish view sonic cli sonic cli \[command] sonic cli \[purpose] enter the klish command line view note this command is executed in the terminal and use system bash command to exit the cli view \[ use cases ] admin\@sonic $ sonic cli sonic# help help all commands support help by typing tab or "?" to help the user understand the command and its parameters tab and "?" can be used at any level of the command and will show the next possible input command or sub command if you have problems using the command line, you can use the help function to get help without having to remember a lot of complicated commands when you enter a command, press the tab key, the system will list the set of keywords that can be matched; enter "? , the system will give the corresponding keyword hint or explanation of the meaning of the parameter example 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 description enter an incorrect command or a command that does not apply to this view will not allow a carriage return to be entered if the command line is not entered completely, press the entry key directly, the system will give a prompt indicates that there are no keywords or parameters in this position, and can be executed by typing directly into the carriage return exit exit \[command] exit \[purpose] exit a view this command is executed in any view show this show this \[command] show this \[purpose] show all configuration commands in the current view \[usage scenario] this command would display the currently running configuration on the device, including all the parameters and settings that are currently in effect \[notes] this command is executed in any view \[ use cases ] sonic(config)# interface ethernet 1 sonic(config if 1)# show this interface ethernet 1 ip address 2022 9110/127 ip address 30 11 13 1/30 speed 10000 system bash system bash \[command] system bash \[purpose] exit system view and enter the linux operating system view \[view] system view \[ use cases ] sonic# system bash use 'exit' to return sonic cli admin\@sonic $ management port configuration management port configuration the management interface (mgmt 0) of asternos can be used by default to obtain an ip address from a dhcp server via a dhcp client, connecting the management interface to a network with a dhcp server on the same network segment the management port can only have one ipv4 address and one ipv6 address, multiple configurations will overwrite the original configuration and the last one will prevail show interface mgmt show interface mgmt \[command] show interface mgmt \[purpose] display management port configuration information \[view] system view \[ use cases ] sonic# show interface mgmt management ip address = 192 168 1 10/24 management network default gateway = 192 168 0 1 ip address ip address \[command] ip address a b c d/m a b c d \[purpose] configure/modify management port ip address and gateway \[parameter] parameter description a b c d/m ip address with prefix length a b c d optional parameter, gateway ip, ip address without prefix length \[view] management port configuration view \[ use cases ] sonic# configure sonic(config)# interface mgmt 0 sonic(config mgmt 0)# ip address 10 250 0 103/24 10 250 0 254 vrf mgmt vrf mgmt \[command] vrf mgmt \[purpose] add the management network port to the mgmt vrf by default, the management port and the service port belong to default vrf, if user need to isolate the management port and the service port can add the management port to mgmt vrf \[view] management port configuration view \[ use cases ] sonic# configure sonic(config)# interface mgmt 0 sonic(config mgmt 0)# vrf mgmt device upgrade device upgrade image update image update \[command] image update bin file \[purpose] upgrade system version \[parameter] parameter description bin file software image file name \[view] system view \[notes] by default, during an upgrade, the system will automatically copy the currently saved configuration file to the new version and load it after the restart if you need to clear the configuration or save the latest configuration, please execute the appropriate commands before the upgrade \[ use cases ] sonic# image update asternos v5 2r001 bin system boot configuration system boot configuration show running config show running config \[command] show running config \[purpose] display the currently running configuration information \[view] system view \[ use cases ] sonic# show running config! interface ethernet 1 dot1x accounting realtime 1000 dot1x reauthenticate period 1000 mtu 9210 no storm suppress broadcast storm suppress broadcast packets 10 ! ! ip protocol static route map rm set src ! line vty ! end show startup config show startup config \[command] show startup config \[purpose] display configuration information for startup \[view] system view \[ use cases ] sonic# show startup config ! interface ethernet 1 dot1x accounting realtime 1000 dot1x reauthenticate period 1000 mtu 9210 no storm suppress broadcast storm suppress broadcast packets 10 ! ! ip protocol static route map rm set src ! ip protocol bgp route map rm set src ! ipv6 protocol bgp route map rm set src6 ! line vty ! end reboot reboot \[command] reboot \[ y] \[purpose] reboot system \[view] system view \[ use cases ] sonic# reboot write write \[command] write running config \[ y] \[purpose] configuration saving \[view] system view \[usage scenario] users modify the device's current configuration via the command line, and these configurations are temporary to ensure that the current configuration remains effective after the device is rebooted, it's necessary to save the current configuration to a configuration file before restarting the device note the configurations will be saved in json format in the system's /etc/sonic directory, with the filename as config db json the file saved during the previous 'write' command execution will be renamed in the format config db date for record keeping and rollback purposes \[ use cases ] sonic# wite running config save running config delete startup config delete startup config \[command] delete startup config \[all] \[ y] \[purpose] delete saved configuration \[view] system view \[notes] saved configurations related to the management interface will not be deleted if the "all" parameter is used, all configurations will be deleted \[ use cases ] sonic# delete startup config
