Skip to content
Ask AI

First Use

By default, AsterNOS both support serial console-based logins and SSH-based logins. When boot up the switch for the first time, it is required to log in from the console port (serial port) and configure the management port IP to log into the switch via SSH. Local login via the serial port is the most basic way to log in to the switch and also the basis for configuring login through other methods. The certain steps are as follows.

Data center series switches use RJ-45 connectors for the serial ports. The distribution of the serial ports varies from model to model. Generally, it is located on the front panel of the switch, with some on the rear panel. This can be confirmed by the interface designation CON, as shown in the picture below.

When connecting the device serial port to a server or PC, the communication parameters of the user terminal must be configured to match the default settings of the switch serial port for successful communication. The default values for each parameter are shown in the table below.

Table 1 Configuration of default parameters for serial ports

ParametersDefault value
Transmission speed115200bit/s
Flow control methodNo flow control
Calibration methodNo calibration
Stop bits1
Data bits8

Windows

Please refer to the specific software guide for the use of different terminal emulation software, here is an example of using Xshell in Windows 10 environment.

  1. First go to the system’s device manager and confirm the serial port name.
  2. Open Xshell, select File —> New in the navigation menu, create a new session, enter a name and select SERIAL (serial interface) for the protocol.

  1. Select SERIAL or Serial in the Category window on the left to set the communication parameters, select COM3 for the port and 115200 for the baud rate, then click Connect.

  1. Type Enter and you can see that the terminal prompts to enter the login username and password.

  1. Enter the username and password, the default is admin/asteros, to access the switch.

Linux

This is explained in detail using the serial terminal software minicom as an example (Linux systems generally come with minicom software).

  1. First go to the minicom tool and in the terminal type the command.
Terminal window
sudo minicom -s
  1. Select Serial port setup to enter the serial port configuration interface.

  1. Enter A: Change the port number, enter. Note that it should match the actual port number. Enter E: Change the baud rate to 115200, enter. Enter again to save this configuration and return to the initial menu.

  1. Select Exit and enter.

  1. When you enter the serial login screen, you have to press enter and the screen prompts you to enter the login username and password.

  1. Enter the username and password, the default is admin/asteros, to access the switch.

SSH is short for Secure Shell. When a user logs in to a device remotely through a network environment that cannot be guaranteed to be secure, SSH provides security using encryption and strong authentication to protect the switch from attacks such as IP address fraud, plaintext password interception, etc. By default, AsterNOS 3.0 and above devices support SSH-based logins with the default credentials of admin/asteros.

Table 2 Configure the Management Port IP

PurposeCommandsDescription
Enter global configuration viewconfigure terminal-
Enter the management port configuration viewinterface mgmt 0-
Configure a management IPv4 addressip address A.B.C.D/M gw A.B.C.DIPv4 address with subnet mask /32 is not allowed to be configured. Addresses with subnet mask /31 is allowed. In other subnet masks, addresses with the host portion all-zeros or all-ones are not allowed.
(Optional) Configure a management IPv6 addressipv6 address A::B/M gw A::BIPv6 address with subnet mask /127 or /128 is not allowed to be configured. In other subnet masks, addresses with the host portion all-zeros are not allowed, but all-ones are allowed.
Exit the management port configuration viewexit-
Save configurationwrite-

The user can configure different names for the switches in the network for easy differentiation.

Table 3 Configure the device name

PurposeCommandsDescription
Configure the switch namehostname hostnameThis change will take effect when the user logs out and logs in again.
Save configurationwrite-
  1. Networking Requirements After logging into the switch for the first time via the Console port, basic configuration (device name and management port IP) is carried out to enable PC2 to log into the switch via SSH. Route between PC2 and the switch is reachable.
  2. Topology

  1. Procedure

PC1 logs in to the switch via the switch serial port as described in Serial Login.

Configure the management port IP.

Terminal window
sonic# configure terminal
sonic(config)# interface mgmt 0
sonic(config-mgmt-0)# ip address 10.250.0.204/24 gw 10.250.0.254
sonic(config-mgmt-0)# exit
sonic(config)# exit
sonic# write

Configure the switch name.

Terminal window
sonic# hostname switchA
sonic# write
  1. Verify the configuration.

By accessing the IP address of the management port , you are able to log in to the switch normally.

Terminal window
- ssh admin@10.250.0.204
admin@10.250.0.204's password:
Linux sonic-204 4.9.0-11-2-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64
_ _ _ _ ___ ____
/ \ ___ | |_ ___ _ __ | \ | | / _ \ / ___|
/ _ \ / __|| __| / _ \| '__|| \| || | | |___ \
/ ___ \ __ \| |_ | __/| | | |\ || |_| | ___) |
/_/ _\|___/ __| ___||_| |_| _| ___/ |____/
------- Asterfusion Network Operating System -------
Help: http://www.asterfusion.com/
Last login: Wed Jun 23 06:44:22 2021 from 192.168.10.198
switchA:#

This series of switches offers a wide range of features and correspondingly a wide range of operations such as status checking and function configuration. We also provide accompanying command line manual documentation.

Table 4 Common views

View nameHow to enterSystem PromptHow to exitDescription
Privileged user viewdefaultSwitch#exitPerform system configuration, display configuration and status information.
Global configuration viewRun configure terminal in privileged user modeSwitch(config)#exit or endPerform global or other feature configurations.

Table 5 Commonly Used Keywords

Key wordsDescription
noCancel or disable a setting.
show thisDisplay current view configuration.
configure terminalEnter global configuration mode.
reloadReload the configuration.
rebootReboot the switch.
writeSave current configuration.
shutdownDisable/shutdown ports.
endRevert to privileged user mode.
exitReturn to top or log out.

CLI provides basic command line editing functionality.

After entering an incomplete keyword, press the Tab or Space bar and the system will automatically complete the keyword.

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 entering a command, press the Tab key and the system will list the set of keywords that can be matched; type ? and the system will give you an explanation of the keyword hint or the meaning of the parameter.

For 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

The switch can automatically save the history of commands typed by the user. When the user needs to enter a command that has been previously executed, the switch’s saved history of commands can be recalled.

Table 6 Display History of Commands

PurposeCommandsDescription
Show history commandsshow history-
Access the last history command-
Access the next history command-

Configuration file refers to a collection of configurations running on a device. Through the management of system configuration files, it enables configuration viewing, comparison, backup and restoration to avoid loss of user configurations and facilitate configuration migration.

The configuration file for this series of switches is in JSON (JavaScript Object Notation) format, a lightweight data interchange format with the usual .json suffix.

By default, the system configuration file is stored in the /etc/sonic directory. The default configuration file is named config_db.json, which is modified when a configuration save or restore operation is performed and determines the starting configuration of the switch at the next boot. In addition, a backup copy of the configuration file is stored in this directory, marked with a timestamp, so that the user can easily restore the configuration.

The user can view the entire configuration or specify a collection of configurations for a particular module.

Table 7 Display current configuration

PurposeCommandsDescription
Display current configurationshow running-config-

When the user logs into the switch, the switch configuration can be modified through operations such as the command line, but these configurations are temporary. If configuration persistence is required, the modified configuration should be manually saved and the current configuration updated to the default configuration file config_db.json, otherwise the switch’s configuration will revert to the pre-modification after reboot.

Table 8 Save configuration

PurposeCommandsDescription
Save configurationwrite-
Display saved configurationshow startup-config-

Table 9 Reload the configuration

PurposeCommandsDescription
Reload the configurationreload-