Configuration Guide
Basic Configuration
31 min
login device login device by default, asternos devices support login through both the serial console and ssh (secure shell) when initially logging into the switch, you will need to use the console port (referred to as the serial port below) to establish a connection after configuring the management interface's ip address, you can then use ssh to log into the switch local login via the serial console is the fundamental method for accessing the device, and it forms the basis for configuring other login methods the specific steps are as follows connect the lines connect the lines this series of switches utilize rj 45 connectors for serial console connections the distribution of serial console ports varies among different models generally, they can be found on the front panel of the device, while some might be located on the rear panel, often marked with the label "con " after the device is powered on, connect the switch's serial console port to a server or pc it's important to ensure that the communication parameter settings of the user terminal match the default configuration of the switch's serial console to establish communication the default values for each parameter are as shown in the table below parameter default value baud rate 115200 data bits 8 stop bits 1 parity none serial port login device serial port login device initial login via console port connect to the device through the console port after pressing enter, a login prompt will appear welcome to minicom 2 7 options i18n compiled on nov 15 2018, 20 18 47 port /dev/ttyusb1, 11 24 17 press ctrl a z for help on special keys debian gnu/linux 9 sonic ttys0 sonic login logging into the device with default credentials username admin password asteros sonic login admin password last login thu nov 3 17 17 59 utc 2016 from 192 168 0 79 on pts/0 linux sonic 5 10 34 asternos #5 smp preempt thu jul 14 08 20 14 edt 2022 aarch64 / \ | | | \ | | / \ / | / \ / | | | / \\| ' || \\| || | | |\\ \\ / \ \\ \ | | | / | | | |\ || | | | ) | / / \\ \\| / \\ | \\ | | | | | \\ | \\ / | / \ asterfusion network operating system help http //www asterfusion com/ last login wed jun 23 06 44 22 2021 from 192 168 10 198 entering cli view, please wait sonic# configuring the management interface ip address sonic# configure sonic(config)# interface mgmt 0 sonic(config mgmt 0)# ip address 30 1 1 2/24 30 1 1 1 sonic(config mgmt 0)# vrf mgmt saving the configuration sonic# write save running config existing files will be overwritten, continue? \[y/n] y running command /usr/local/bin/sonic cfggen d print data > /etc/sonic/config db json getting familiar with using cisco like command line getting familiar with using cisco like command line how to enter the command line view how to enter the command line view operation command description enter the cli view sudo sonic cli by default, upon logging into the device, you will automatically enter the command line view exit the cli view system bash use the 'exit' command to return to the command line configuration interface commond keywords commond keywords keywords description no cancel or disable a specific setting show this display the current configuration of the current view configure terminal enter the system configuration mode delete delete a configuration file reboot reboot the device write save the current configuration shutdown disable or turn off a port exit exit to the previous level or log out command line usage assistance command line usage assistance when entering an incomplete keyword, pressing the tab or space key will automatically complete the keyword if you encounter issues while using the command line, you can utilize the help function to get assistance, eliminating the need to memorize extensive and intricate commands while entering a command, pressing the tab key will display a list of matching keywords entering "?" will provide hints for relevant keywords or explanations of parameters 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 configuration file management configuration file management the configuration files for this series of switches are in json (javascript object notation) format json is a lightweight data interchange format, and its file extension is typically json viewing configuration file viewing configuration file by default, the system configuration files are stored in the /etc/sonic directory the default system configuration file is named config db json when performing configuration saving or restoration operations, it's this file that gets modified, determining the initial configuration upon the device's next startup additionally, this directory also contains backups of configuration files, labeled with timestamps, which facilitates configuration recovery for users every time the "write" command is executed, a new config db json file is generated to save the current configuration, and the original file's name is modified to the format config bd +timestamp configuration saving configuration saving after a user logs into the device, configurations made through command line operations or other means are temporary if you require persistent configurations, you should manually save the modified settings this involves updating the current configuration to the default configuration file, config db json if you don't save the configurations, the device's settings will revert to their state before modifications after a reboot operationmaintenance interface command description save configuration write display startup configuration show startup config device upgrade device upgrade the device supports multiple methods to copy version images onto the target device for upgrading copying images using copying images using in this scenario, the device and a file server establish communication the device functions as a tftp client, while the file server operates as a tftp server the objective is to download the version image stored on the server to the device, thereby accomplishing the software version upgrade configure the ip address of the file server, ensuring that the file server and the device are routable start the tftp server on the device to initiate the download of the version image admin\@sonic $ tftp tftp> help tftp> connect (to) 150 1 0 1 tftp> get asternos v5 2r001 bin received 17437 bytes in 0 0 seconds tftp> quit admin\@sonic $ ls asternos v5 2r001 bin copying images using scp copying images using scp configure the ip address of the file server to ensure that the file server and the device are reachable via routing on the device, use the scp command to complete the download of the version image admin\@sonic $ sudo scp server\@192 168 0 100 /share/ asternos v5 2r001 bin admin\@sonic $ ls asternos v5 2r001 bin copying images using a usb drive copying images using a usb drive this method is suitable when there is no network environment available, and you need to copy the version image to the device typically, the usb port of the device is located on the front panel insert the usb drive containing the system image into the device's usb port execute a command to view the disk name corresponding to the usb drive admin\@sonic $ sudo /sbin/fdisk l create a directory for mounting the usb drive admin\@sonic $ sudo mkdir /mnt/usb/ mount the usb drive take the example of /dev/sdb4 as the path for the usb drive, but please adjust according to the actual situation admin\@sonic $ sudo mount /dev/sdb4 /mnt/usb navigate to the directory of the mounted disk and copy files from the disk to the device admin\@sonic $ cd /mnt/usb admin\@sonic /mnt/usb/$ sudo cp asternos v5 2r001 bin /home/admin admin\@sonic $ ls asternos v5 2r001 bin executing the upgrade command executing the upgrade command operation command description execute the upgrade command image update image name if a configuration upgrade is required, please execute the "write" command to save the configuration before proceeding with the upgrade once the upgrade is completed without any errors, you'll need to manually restart the device to switch to the new version display the version show version ztp configuration ztp configuration introduction introduction zero touch provisioning (ztp) refers to the automatic loading of initialization files (configuration files, upgrade files) on newly manufactured or blank devices when they are powered on this functionality enables devices to be deployed and configured without requiring on site manual configuration as a result, ztp reduces labor costs and enhances deployment efficiency principle explanation principle explanation as illustrated in the diagram, a device awaiting configuration is connected to a dhcp relay device via its service port or management port upon powering on, the device checks whether a ztp initialization process has been carried out if yes, it loads the system configuration files and starts the device if not, the device enters the ztp initialization process through dhcp during this process, the device operates as a dhcp client and sends dhcp request packets to the dhcp server to obtain an ip address and the path to the required upgrade files based on the configuration information carried in the received dhcp response packet, the device automatically retrieves version and configuration files from the specified file server it then proceeds to execute the upgrade command and reboot the device upon completion of the device reboot, automatic loading of both the version and configuration is achieved dhcp server used to assign temporary management ip addresses to devices and provide the file server address tftp/ftp server stores the configuration files, version images required for ztp initialization, and user logs after upgrades are completed dhcp relay when the device to be upgraded and the dhcp server are in different network segments, a relay device is needed to forward dhcp packets devices can carry their hardware model and serial number in the packets tftp/ftp servers can name version files based on hardware models and name configuration files based on serial numbers, enabling provision of different versions and independent configuration files for devices of various models and serial numbers the workflow of ztp is illustrated in the diagram below configuring the dhcp server configuring the dhcp server the dhcp server passes network configuration parameters to the device through the option field when the device to be configured is not on the same subnet as the dhcp server, a dhcp relay needs to be configured to forward dhcp interaction messages when the device enters the ztp process, both the management port and service port of the device will send dhcpv4 discover messages, carrying option 67 to request the path to the intermediate file required for provisioning dhcp option parameters description option number function option 1 sets the subnet mask for the ip address option 3 sets the gateway for the dhcp client option 6 sets the ip address of the dns server option 67 sets the path to the intermediate file such as ftp\ //ftpserver\ test\@192 168 0 10/ztp json configuring the file server configuring the file server the file server is used to store the files that need to be transferred during the ztp process, including intermediate files, image files, configuration files, and logs generally, a third party server is used as the file server, and during deployment, the network connectivity between the file server and the device must be ensured the file server supports tftp and ftp servers place the intermediate file and other provisioning files in the working directory of the file server and rename the files as specified image file the name should be the device type followed by bin for example, if the device type is cx204y 48gt m swp4, the image file name should be cx204y 48gt m swp4 bin configuration file the name should be the device serial number (sn) followed by bin for example, if the device sn is f020000a055, the configuration file name should be f020000a055 bin intermediate file the file must be named exactly ztp json logs logs generated by the device during the ztp process will be uploaded to the file server after the ztp process is completed or if it fails for some reason, to facilitate troubleshooting note the naming convention for image files and configuration files above is applicable when different types of devices have different version images and different devices load different configuration files if the devices undergoing ztp provisioning need to pull identical image and configuration files, you can also specify the same name as in the intermediate file preparing the configuration file preparing the configuration file ztp provisioning requires the pre preparation of provisioning files, including the configuration file and the intermediate file the configuration file is in json format, which the device loads to generate the configuration after startup the configuration file can be manually written or copied from another device to save the configuration file, execute the write command on the device the configuration file is saved in the /etc/sonic/ directory of the device, named in the format config db json then, export the configuration file using scp or other methods it is important to note that the configuration file must be written strictly in json format and comply with the device's requirements for the configuration file content it is recommended that users export the configuration file and modify it as needed, rather than writing the configuration file directly preparing the intermediate file preparing the intermediate file the intermediate file is used to inform the device about the paths of the version image and configuration file to be fetched, as well as the path where the log files generated during the ztp process need to be uploaded the file must be named ztp json { "ztp" { "configdb json" { "dynamic url" { "source" { "prefix" "ftp\ //ftpserver\ test\@192 168 0 10/ztp cfg/", "identifier" "serial number", "suffix" " json" }, "destination" "/etc/sonic/config db json" } }, "firmware" { "install" { "dynamic url" { "source" { "prefix" "ftp\ //ftpserver\ test\@192 168 0 10/ztp image/", "identifier" "product name", "suffix" " bin" } }, "set default" true } }, "upload log" { "dynamic upload url" { "destination" { "prefix" "ftp\ //ftpserver\ test\@192 168 0 10/ztp log/", "identifier" " serial number", "suffix" " log" } }, "reboot on success" true } } } field meanings field meaning configdb json prefix the absolute path of the configuration file identifier the configuration file name when the field content is serial number, it indicates that the field will be automatically filled with the device's sn code if there is no need to distinguish between different devices, a fixed configuration file name can be used suffix the file format, which must be json for configuration files firmware prefix the absolute path of the image file identifier the image file name when the field content is product name, it indicates that the field will be automatically filled with the device type if there is no need to distinguish between device types, a fixed name can be used suffix the file format, which must be bin for image files upload log prefix the specified path for uploading logs to the file server identifier the log file name suffix the log file format set default set the image as the default to be loaded at startup reboot on success automatically reboot the device after the ztp process is completed successfully configuration example configuration example network requirements network requirements a certain company has multiple switches that need to be deployed in bulk, upgraded, and configured to save on human resources and streamline the process, they plan to use zero touch provisioning for deployment procedure procedure configure the dhcp server and add an option field to configure the ftp server address option bootfile name ”ftp\ //ftpserver\ test\@192 168 0 10/ztp json create a ztp file in the /ftpboot directory of the ftp server, and provide directory information for the required files during the ztp process { "ztp" { "configdb json" { "dynamic url" { "source" { "prefix" "ftp\ //ftpserver\ test\@192 168 0 10/ztp cfg/", "identifier" "serial number", "suffix" " json" }, "destination" "/etc/sonic/config db json" } }, "firmware" { "install" { "dynamic url" { "source" { "prefix" "ftp\ //ftpserver\ test\@192 168 0 10/ztp image/", "identifier" "product name", "suffix" " bin" } }, "set default" true } }, "upload log" { "dynamic upload url" { "destination" { "prefix" "ftp\ //ftpserver\ test\@192 168 0 10/ztp log/", "identifier" " serial number", "suffix" " log" } }, "reboot on success" true } } } upload the required files to the directory specified in the ztp json file on the ftp server verify configuration verify configuration after device reboot, view device version and configuration sonic# show version sonic# show running config
