Command Line Reference
Basic Configuration and Login
18 min
first login first login asternos switches support both serial plaintext based logins and ssh based logins the default login credential is admin/asteros after initial power on, you can log in via the serial plaintext to set the ip address of management port (mgmt 0) (refer to management port configuration) afterward, ssh login is enabled using the management ip console login console login \[use cases] debian gnu/linux 9 sonic ttys0 sonic login admin password linux sonic 5 10 0 8 2 amd64 #1 smp debian 5 10 46 4 (2021 08 03) x86 64 / \ | | | \ | | / \ / | / \ / || | / \\| ' || \\| || | | |\\ \\ / \ \\ \\| | | /| | | |\ || | | | ) | / / \\ \\| / \\ | \\ || | | | \\ | \\ / | / \ asterfusion network operating system help http //www asterfusion com/ sonic# ssh login ssh login \[use cases] \[c ]$ ssh admin\@10 250 0 138 connecting to 10 250 0 138 22 connection established to escape to local shell, press 'ctrl+alt+]' warning! the remote ssh server rejected x11 forwarding request linux sonic 5 10 0 8 2 amd64 #1 smp debian 5 10 46 4 (2021 08 03) x86 64 / \ | | | \ | | / \ / | / \ / || | / \\| ' || \\| || | | |\\ \\ / \ \\ \\| | | /| | | |\ || | | | ) | / / \\ \\| / \\ | \\ || | | | \\ | \\ / | / \ asterfusion network operating system help http //www asterfusion com/ sonic# login config login config table 1 login config command purpose ssh server disbale disable ssh service ssh ipuser user name ip address \[ port port id | interface interface name | vrf vrf name | src source ip ] login to other devices via ssh telnet server enable enable telnet service telnet ip user user name ip address \[ vrf vrf name | src source ip ] login to other devices via telnet ssh server disbale ssh server disbale \[command] ssh server disbale \[purpose] disable ssh service \[view] global configuration view \[notes] default enable run command no ssh server disable to enable ssh service \[use cases] sonic# configure terminal sonic(config)#ssh server disable after disabling the ssh service, log in to the switch via ssh and prompt login failure sonic\@sonic super server $ ssh admin\@10 250 0 171 ssh connect to host 10 250 0 171 port 22 connection refused ssh ip user ssh ip user user name ip address \[port port id |interface interface name |vrf vrf name |src source ip ] \[command] ssh ip user user name ip address \[ port port id | interface interface name | vrf vrf name | src source ip ] \[purpose] login to other devices via ssh \[parameters] parameter description user name user name ip address ip address port id port id interface name interface name vrf name vrf name source ip source ip address \[view] privileged user view \[use cases] sonic# ssh ip user admin 10 250 0 167 port 22 admin\@10 250 0 167's password linux sonic 5 10 0 8 2 amd64 #1 smp debian 5 10 46 4 (2021 08 03) x86 64 / \ | | | \ | | / \ / | / \ / || | / \\| ' || \\| || | | |\\ \\ / \ \\ \\| | | /| | | |\ || | | | ) | / / \\ \\| / \\ | \\ || | | | \\ | \\ / | / \ asterfusion network operating system help http //www asterfusion com/ last login wed dec 25 10 15 08 2024 from 10 250 0 114 sonic# telnet server enable telnet server enable \[command] telnet server enable \[purpose] enable telnet service \[view] global configuration view \[notes] default disbale run command no telnet server enable to disable telnet service \[use cases] sonic# configure terminal sonic(config)#telnet server enable after enabling the telnet service, log in to the switch using telnet and the login is successful sonic\@sonic super server $ telnet 10 250 0 171 trying 10 250 0 171 connected to 10 250 0 171 escape character is '^]' debian gnu/linux 11 sonic login admin password linux sonic 5 10 0 8 2 amd64 #1 smp debian 5 10 46 4 (2021 08 03) x86 64 / \ | | | \ | | / \ / | / \ / || | / \\| ' || \\| || | | |\\ \\ / \ \\ \\| | | /| | | |\ || | | | ) | / / \\ \\| / \\ | \\ || | | | \\ | \\ / | / \ asterfusion network operating system help http //www asterfusion com/ last login wed oct 16 11 00 33 utc 2024 from 192 168 20 102 on pts/1 sonic# telnet ip user telnet ip user user name ip address \[vrf vrf name | src source ip ] \[command] telnet ip user user name ip address \[ vrf vrf name | src source ip ] \[purpose] login to other devices via telnet \[parameters] parameter description user name username ip address ip address vrf name vrf name source ip source ip address \[view] privileged user view \[use cases] sonic# telnet ip user admin 10 250 0 167 src 10 250 0 114 trying 10 250 0 167 connected to 10 250 0 167 escape character is '^]' password linux sonic 5 10 0 8 2 amd64 #1 smp debian 5 10 46 4 (2021 08 03) x86 64 / \ | | | \ | | / \ / | / \ / || | / \\| ' || \\| || | | |\\ \\ / \ \\ \\| | | /| | | |\ || | | | ) | / / \\ \\| / \\ | \\ || | | | \\ | \\ / | / \ asterfusion network operating system help http //www asterfusion com/ last login wed dec 25 10 19 38 cst 2024 from 192 168 23 198 on pts/0 sonic# cisco like view cisco like view in order to meet different users' habits, asternos supports two methods of configuration linux bash style and cisco like style command line, which are not compatible with each other linux bash style bash mode, also named sonic command line, uses config and show series of commands to manage the switch there is no concept of view, and commands are organized independently the configuration file stores the results of the configuration, rather than the configuration command cisco like style cli mode, also named klish command line, uses cisco like style commands provided by sonic cli to manage the switch following the cli style of traditional commercial switches, commands are organized under views the configuration file stores the commands that have been configured attention please since the commands and configuration storage of the two configuration interfaces above are not one to one correspondence, and there are differences between background processing therefore, these two methods cannot be converted synchronously, i e they are not compatible please do not combine them if you need to change cli mode during use, we suggest you to clean up the configuration first, otherwise there may be incompatible configuration problems for protection, the system will restart bgp service automatically when cli mode is changed when logging into the switch, you will enter cisco like cli by default table 2 cisco like view command purpose cli mode {bash|cli} change cli mode of the system configure terminal enter global configuration view end exit to privileged user view exit exit current view sonic cli enter cisco like cli view system bash change to bash cli cli mode {bash|cli} cli mode {bash|cli} \[command] cli mode { bash | cli } \[purpose] change cli mode of the system \[view] global configuration view \[notes] the default cli mode is cli this command is only available for admin and root users \[use cases] sonic# configure terminal sonic(config)# cli mode bash cli mode changes to sonic bash, some configurations lose and need to be reconfigured sure? \[y/n] y configure terminal configure terminal \[command] configure terminal \[purpose] enter global configuration view \[view] privileged user view \[use cases] admin\@sonic $ sudo sonic cli sonic# configure terminal sonic(config)# end end \[command] end \[purpose] exit to privileged user view \[view] all views \[use cases] admin\@sonic $ sudo sonic cli sonic# configure terminal sonic(config)# sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# end sonic# exit exit \[command] exit \[purpose] exit current view \[view] all views \[use cases] admin\@sonic $ sudo sonic cli sonic# configure terminal sonic(config)# sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# exit sonic(config)# sonic cli sonic cli \[command] sonic cli \[purpose] enter cisco like cli view \[view] system terminal \[notes] this command requires root privileges after entering cisco like cli, the default view is privileged user view, which is not allowed to run configuration commands if you want to deploy the switch, please run configure terminal to enter global configuration view \[use cases] admin\@sonic $ sudo sonic cli sonic# system bash system bash \[command] system bash \[purpose] change to bash cli \[view] system terminal \[notes] running the command exit in bash will return you to the cisco like cli this command is only available for admin and root users \[use cases] sonic# system bash admin\@sonic $ exit sonic# help help when using klish command, you can use \<tab> or ? at any level to get help information at any level this will help you to understand the purpose of the command and the meaning of the parameters, thus you do not need to remember a large number of complex commands \[command] command + \<tab> or ? \[purpose] get help information \[view] all views \[notes] press \<tab> when you type a command, the system will automatically complete the keyword or list the set of matching keywords type ? , the system will give you a message or explanation of the meaning of the corresponding keyword or parameter if you type an incorrect command or the command is not for this view, you will not be allowed to type \<enter> if the command line is not typed completely, the system will give a prompt \<cr> means that there is no keyword or parameter in this position, type \<enter> to run \[use cases] 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
