First Use
此内容尚不支持你的语言。
First Login to the switch
Section titled “First Login to the switch”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.
Connections
Section titled “Connections”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
| Parameters | Default value |
|---|---|
| Transmission speed | 115200bit/s |
| Flow control method | No flow control |
| Calibration method | No calibration |
| Stop bits | 1 |
| Data bits | 8 |
Serial Login
Section titled “Serial Login”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.
- First go to the system’s device manager and confirm the serial port name.
- Open Xshell, select File —> New in the navigation menu, create a new session, enter a name and select SERIAL (serial interface) for the protocol.

- Select
SERIALorSerialin theCategorywindow on the left to set the communication parameters, selectCOM3for the port and115200for the baud rate, then clickConnect.

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

- 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).
- First go to the minicom tool and in the terminal type the command.
sudo minicom -s- Select Serial port setup to enter the serial port configuration interface.

- 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.

- Select Exit and enter.

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

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

Configure the Management Port IP
Section titled “Configure the Management Port IP”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
| Purpose | Commands | Description |
|---|---|---|
| Enter global configuration view | configure terminal | - |
| Enter the management port configuration view | interface mgmt 0 | - |
| Configure a management IPv4 address | ip address A.B.C.D/M gw A.B.C.D | IPv4 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 address | ipv6 address A::B/M gw A::B | IPv6 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 view | exit | - |
| Save configuration | write | - |
Configure the Device Name
Section titled “Configure the Device Name”The user can configure different names for the switches in the network for easy differentiation.
Table 3 Configure the device name
| Purpose | Commands | Description |
|---|---|---|
| Configure the switch name | hostname hostname | This change will take effect when the user logs out and logs in again. |
| Save configuration | write | - |
Example of First Login Device Configure
Section titled “Example of First Login Device Configure”- 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.
- Topology

- Procedure
PC1 logs in to the switch via the switch serial port as described in Serial Login.
Configure the management port IP.
sonic# configure terminalsonic(config)# interface mgmt 0sonic(config-mgmt-0)# ip address 10.250.0.204/24 gw 10.250.0.254sonic(config-mgmt-0)# exitsonic(config)# exitsonic# writeConfigure the switch name.
sonic# hostname switchAsonic# write- Verify the configuration.
By accessing the IP address of the management port , you are able to log in to the switch normally.
➜ - ssh admin@10.250.0.204admin@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.198switchA:#Familiarity with the Command Line
Section titled “Familiarity with the Command Line”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.
Common views
Section titled “Common views”Table 4 Common views
| View name | How to enter | System Prompt | How to exit | Description |
|---|---|---|---|---|
| Privileged user view | default | Switch# | exit | Perform system configuration, display configuration and status information. |
| Global configuration view | Run configure terminal in privileged user mode | Switch(config)# | exit or end | Perform global or other feature configurations. |
Commonly Used Keywords
Section titled “Commonly Used Keywords”Table 5 Commonly Used Keywords
| Key words | Description |
|---|---|
| no | Cancel or disable a setting. |
| show this | Display current view configuration. |
| configure terminal | Enter global configuration mode. |
| reload | Reload the configuration. |
| reboot | Reboot the switch. |
| write | Save current configuration. |
| shutdown | Disable/shutdown ports. |
| end | Revert to privileged user mode. |
| exit | Return to top or log out. |
Edit Command Line
Section titled “Edit Command Line”CLI provides basic command line editing functionality.
Command Line Operation Tips
Section titled “Command Line Operation Tips”After entering an incomplete keyword, press the Tab or Space bar and the system will automatically complete the keyword.
Help on Using the Command Line
Section titled “Help on Using the Command Line”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-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 priorityDisplay history of commands
Section titled “Display history of commands”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
| Purpose | Commands | Description |
|---|---|---|
| Show history commands | show history | - |
| Access the last history command | ↑ | - |
| Access the next history command | ↓ | - |
Configuration File Management
Section titled “Configuration File Management”Definition
Section titled “Definition”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.
Format of the configuration file
Section titled “Format of the configuration file”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.
Display configuration profile
Section titled “Display configuration profile”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.
Display current configuration
Section titled “Display current configuration”The user can view the entire configuration or specify a collection of configurations for a particular module.
Table 7 Display current configuration
| Purpose | Commands | Description |
|---|---|---|
| Display current configuration | show running-config | - |
Save the configuration
Section titled “Save the configuration”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
| Purpose | Commands | Description |
|---|---|---|
| Save configuration | write | - |
| Display saved configuration | show startup-config | - |
Reload the configuration
Section titled “Reload the configuration”Table 9 Reload the configuration
| Purpose | Commands | Description |
|---|---|---|
| Reload the configuration | reload | - |