---
title: First Use
slug: aidc/first-use
description: First Use
createdAt: 2025-11-12T12:13:54.673Z
---

## <font color="#1d50a2">First Login to the switch</font>

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.

### <font color="#1d50a2">Connections</font>

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.

![](https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/MXHrO7LUhr9ebxz4IBAtS-20251128-021636.png "Figure 1 CX532P-N ")

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.

<font color="#1d05a2">Table 1 Configuration of default parameters for serial ports</font>

| **Parameters**      | **Default value** |
| ------------------- | ----------------- |
| Transmission speed  | 115200bit/s       |
| Flow control method | No flow control   |
| Calibration method  | No calibration    |
| Stop bits           | 1                 |
| Data bits           | 8                 |

### <font color="#1d50a2">Serial Login</font>

<font color="#1d50a2">**Windows**</font>

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.

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/eqQoGiLRtemZF349-UU3Q-20251127-024859.png" size="50" width="457" height="452" darkWidth="457" darkHeight="452" position="center" caption="Figure 2 New Session" showCaption="true"}

3. 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`**.

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/kQGSY8xvsNlYEPZQNba7O-20251127-025051.png" size="50" width="441" height="424" darkWidth="441" darkHeight="424" position="center" caption="Figure 3 Configuration Of Serial Communication Parameters" showCaption="true"}

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

![](https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/BX5ycnG1SVpLQA8UkHI5O-20251127-025152.png "Figure 4 Accessing The Serial Login Screen")

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

![](https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/WuajlL3LK1KS5ywru-FF6-20251127-025235.png "Figure 5 Successful Login To The Switch")

<font color="#1d50a2">**Linux**</font>****

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.

```bash
sudo minicom -s
```

1. Select Serial port setup to enter the serial port configuration interface.

![](https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/xIciOgyGfSdn7nNGEA0Ot-20251127-025330.png "Figure 6 Minicom Initial Menu")

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

![](https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/fgXVFU7YZqb7KLSSOuVDD-20251127-025408.png "Figure 7 Serial Port Configuration Interface")

4. Select Exit and enter.

![](https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/KRPfnKDgWAeAyrcT8APgA-20251127-025450.png "Figure 8 Minicom Initial Menu")

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

![](https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/Hux8a7P-Jyk0RzwnfiCW0-20251127-025526.png "Figure 9 Serial Port Login Screen")

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

![](https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/apaaFbpwpvHv2FVH8hZVn-20251127-025653.png "Figure 10 Successful Login To The Switch")

### <font color="#1d50a2">Configure the Management Port IP</font>

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

<font color="#1d05a2">Table 2 Configure the Management Port IP</font>

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

### <font color="#1d50a2">Configure the Device Name</font>

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

<font color="#1d05a2">Table 3 Configure the device name</font>

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

### <font color="#1d50a2">Example of First Login Device Configure</font>

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

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/3VNf9JJvbx7RiCWifBK12-20251127-025802.png" size="80" width="631" height="126" darkWidth="631" darkHeight="126" position="center" caption="Figure 11 Network Schematic Diagram Of The First Login Device" showCaption="true"}

3. Procedure

PC1 logs in to the switch via the switch serial port as described in [Serial Login](https://v1.docs.asternos.com/aidc/first-use#serial-login).

Configure the management port IP.

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

```none
sonic# hostname switchA
sonic# write
```

4. Verify the configuration.

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

```bash
➜ - 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:#
```

## <font color="#1d50a2">Familiarity with the Command Line</font>

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.

### <font color="#1d50a2">Common views</font>

<font color="#1d05a2">Table 4 Common views</font>

| **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&#x20;**&#x6F;r **end** | Perform global or other feature configurations.                             |

:::hint{type="success"}
**NOTE:**
Run **exit** will fall back to global configuration mode and **end** will fall back to privileged user mode.
:::

### <font color="#1d50a2">Commonly Used Keywords</font>

<font color="#1d05a2">Table 5 Commonly Used Keywords</font>

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

### <font color="#1d50a2">Edit Command Line</font>

CLI provides basic command line editing functionality.

:::hint{type="info"}
**NOTE:**
The command line keyword is case insensitive.
:::

### <font color="#1d50a2">Command Line Operation Tips</font>

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

### <font color="#1d50a2">Help on Using the Command Line</font>

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:

```plaintext
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
```

:::hint{type="warning"}
**NOTES:**

- An incorrect command is entered, or the command is not applicable to this view and a carriage return will not be allowed.
- If the command line is not entered in full, a prompt will be given.
- &#x20;means there are no keywords or parameters in this position, just type enter to execute.
:::

### <font color="#1d50a2">Display history of commands</font>

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.

<font color="#1d05a2">Table 6 Display History of Commands</font>

| **Purpose**                     | **Commands**     | **Description** |
| ------------------------------- | ---------------- | --------------- |
| Show history commands           | **show history** | -               |
| Access the last history command | `↑`              | -               |
| Access the next history command | `↓`              | -               |

## <font color="#1d50a2">Configuration File Management</font>

### <font color="#1d50a2">Definition</font>

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.

### <font color="#1d50a2">Format of the configuration file</font>

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.

### <font color="#1d50a2">Display configuration profile</font>

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.

### <font color="#1d50a2">Display current configuration</font>

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

<font color="#1d05a2">Table 7 Display current configuration</font>

| **Purpose**                   | **Commands**            | **Description** |
| ----------------------------- | ----------------------- | --------------- |
| Display current configuration | **show running-config** | -               |

### <font color="#1d50a2">Save the configuration</font>

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.

<font color="#1d05a2">Table 8 Save configuration</font>

| **Purpose**                 | **Commands**            | **Description** |
| --------------------------- | ----------------------- | --------------- |
| Save configuration          | **write**               | -               |
| Display saved configuration | **show startup-config** | -               |

### <font color="#1d50a2">Reload the configuration</font>

Table 9 Reload the configuration

| **Purpose**              | **Commands** | **Description** |
| ------------------------ | ------------ | --------------- |
| Reload the configuration | **reload**   | -               |

:::hint{type="danger"}
**NOTE:**
Please make sure that the current configuration has been saved if you need it to remain in effect after reload, or you will lose it.
:::

