Configuration Guide
First Use
26 min
first login to the switch 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 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 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 serial login windows 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 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 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 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 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 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 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 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 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 docid 2t4g03ihi4rygxo0vk9eq configure the management port ip 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 sonic# hostname switcha sonic# 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 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 # familiarity with the command line 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 common views table 4 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 note run exit will fall back to global configuration mode and end will fall back to privileged user mode commonly used keywords commonly used keywords table 5 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 edit command line cli provides basic command line editing functionality note the command line keyword is case insensitive command line operation tips 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 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 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 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 means there are no keywords or parameters in this position, just type enter to execute display history of commands 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 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 configuration file management definition 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 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 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 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 table 7 display current configuration purpose commands description display current configuration show running config save the configuration 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 table 8 save configuration purpose commands description save configuration write display saved configuration show startup config reload the configuration reload the configuration table 9 reload the configuration purpose commands description reload the configuration reload 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
