Skip to content
Ask AI

Basic Configuration and 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.

[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#

[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#

Table 1 Login Config

CommandPurpose
ssh server disbaleDisable 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 enableEnable TELNET service
telnet ip user user_name ip_address [vrf vrf_name | src source_ip]Login to other devices via Telnet.

[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

[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]

ParameterDescription
user_nameUser name
ip_addressIP address
port_idPort id
interface_nameInterface name
vrf_nameVRF name
source_ipSource 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#

[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#

[Command]

telnet ip user user_name ip_address [vrf vrf_name | src source_ip]

[Purpose]

Login to other devices via telnet.

[Parameters]

ParameterDescription
user_nameusername
ip_addressIP address
vrf_nameVRF name
source_ipSource 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#

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.

Table 2 CISCO-LIKE View

CommandPurpose
cli-mode {bash|cli}Change CLI mode of the system.
configure terminalEnter Global Configuration View.
endExit to Privileged User View.
exitExit current view.
sonic-cliEnter CISCO-LIKE CLI View.
system bashChange to 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

[Command]

configure terminal

[Purpose]

Enter Global Configuration View.

[View]

Privileged User View

[Use Cases]

admin@sonic:~$ sudo sonic-cli
sonic# configure terminal
sonic(config)#

[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#

[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)#

[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#

[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#

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