Basic Configuration and Login
First Login
Section titled “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
Section titled “Console Login”[Use Cases]
Debian GNU/Linux 9 sonic ttyS0sonic login: adminPassword: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
Section titled “SSH Login”[Use Cases]
[C:~]$ ssh admin@10.250.0.138Connecting 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
Section titled “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
Section titled “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 terminalsonic(config)#ssh server disableAfter disabling the SSH service, log in to the switch via SSH and prompt login failuresonic@sonic-Super-Server:~$ ssh admin@10.250.0.171ssh: connect to host 10.250.0.171 port 22: Connection refusedssh ip user
Section titled “ssh ip user”[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 22admin@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.114sonic#telnet server enable
Section titled “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 terminalsonic(config)#telnet server enableAfter enabling the Telnet service, log in to the switch using Telnet and the login is successful.sonic@sonic-Super-Server:~$ telnet 10.250.0.171Trying 10.250.0.171...Connected to 10.250.0.171.Escape character is '^]'.Debian GNU/Linux 11sonic login: adminPassword: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/1sonic#telnet ip user
Section titled “telnet ip user”[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.114Trying 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/0sonic#CISCO-LIKE View
Section titled “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.
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}
Section titled “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 terminalsonic(config)# cli-mode bashCLI mode changes to sonic-bash, Some configurations lose and need to be reconfigured. sure? [Y/n]: yconfigure terminal
Section titled “configure terminal”[Command]
configure terminal
[Purpose]
Enter Global Configuration View.
[View]
Privileged User View
[Use Cases]
admin@sonic:~$ sudo sonic-clisonic# configure terminalsonic(config)#[Command]
end
[Purpose]
Exit to Privileged User View.
[View]
All Views
[Use Cases]
admin@sonic:~$ sudo sonic-clisonic# configure terminalsonic(config)#sonic(config)# interface ethernet 0/0sonic(config-if-0/0)# endsonic#[Command]
exit
[Purpose]
Exit current view.
[View]
All Views
[Use Cases]
admin@sonic:~$ sudo sonic-clisonic# configure terminalsonic(config)#sonic(config)# interface ethernet 0/0sonic(config-if-0/0)# exitsonic(config)#sonic-cli
Section titled “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-clisonic#system bash
Section titled “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 bashadmin@sonic:~$ exitsonic#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-aggregationlldp mac-address platform running-config startup-config sub-interface trafficsonic# configure terminalsonic(config)# access-list l3 test ingress <tab> <cr>sonic(config)# access-list l3 test <enter>Syntax error: The command is not completedsonic(config)# access-list l3 test1 ingresssonic(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-configsonic(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