Hello, all!
Today I will share you how to configure S5452 switch on FusionCompute.
Configure the S5352 switches in stacking mode using a script.
For a switch stack, the lower switch is numbered 1 and the upper switch is numbered 2. In this case, you need to configure only switch 1, and power on switch 2. The configuration specified in the script takes effect for switch 2 after it is powered on.
Procedure
Power off switch 2.
1. Press the power button of switch 2 to power off the switch.
For a switch stack, the lower switch is numbered 1 and the upper switch is numbered 2.
Log in to switch 1 through the Console port.
2. Run the emulation program on the local computer to create a connection between the local computer and the switch.
Key parameters are as follows:
Position of the switch port: CONSOLE port on the right of the front panel
Bits per second: 9600
Terminal emulation: VT100
For details, see Logging In to Devices Using Serial Port Tools.
Configure the management IP address of switch 1.
3. Run the following command to switch to the system view:
<Quidway> system-view
4. Run the following command to switch to the VLANIF1 interface view:
[Quidway] interface vlanif 1
The initial switch only has VLAN 1. The management IP address and FTP information configured in this section are temporary data and only used for uploading the switch configuration scripts. Such data will be overwritten after the configuration scripts take effect.
5. Run the following command to configure the IP address and the subnet mask of the switch:
[Quidway-Vlanif1] ip address Management IP address of the switch Subnet mask
For example, to set the management IP address of the switch to 10.85.199.48 and subnet mask to 255.255.255.0, run the following command:
[Quidway-Vlanif1] ip address 10.85.199.48 24
6. Run the following command to view the configuration result:
[Quidway-Vlanif1] display ip interface brief vlanif 1
The command is successfully executed if information similar to the following is displayed:
*down: administratively down (l): loopback (s): spoofing Interface IP Address/Mask Physical Protocol Vlanif1 10.85.199.48/24 up up
7. Run the following command to switch back to the system view:
[Quidway-Vlanif1] quit
Configure the FTP service.
8. Run the following command to start the FTP service:
[Quidway] ftp server enable
The command is successfully executed if information similar to the following is displayed:
Info: Succeeded in starting the FTP server.
9. Run the following command to switch to the AAA view:
[Quidway] aaa
10. Run the following command to configure the FTP username and password:
[Quidway-aaa] local-user FTP username password simple FTP password
For example, to set the FTP username to ftp and password to Huawei123, run the following command:
[Quidway-aaa] local-user ftp password simple Huawei123
The command is successfully executed if information similar to the following is displayed:
info: A new user added
11. Run the following command to configure the user access type:
[Quidway-aaa] local-user FTP username service-type ftp
For example, to configure the access type for the ftp user to ftp, run the following command:
[Quidway-aaa] local-user ftp service-type ftp
12. Run the following command to configure the user FTP directory:
[Quidway-aaa] local-user FTP username ftp-directory flash:/
For example, to configure the FTP directory for the ftp user, run the following command:
[Quidway-aaa] local-user ftp ftp-directory flash:/
13. Run the following command to switch back to the system view:
[Quidway-aaa] quit
Configure the data for switch 1.
14. Connect the local computer to a switch by a network cable, and assign the IP address of the local computer and management IP address of the switch to the same network segment.
The port used to connect the local computer must be idle. If the port has been disabled, perform the operations provided in Configuring VLANs That Are Allowed to Pass Through the Port.
15. Choose Start > Run on the local computer.
The Run dialog box is displayed.
16. Enter cmd and press Enter.
The command-line interface (CLI) is displayed.
17. Run the following command to establish an FTP connection with the switch on the CLI:
C:\Documents and Settings\Administrator> ftp Management IP address of the switch
For example, if the management IP address of the switch is 10.85.199.47, run the following command:
C:\Documents and Settings\Administrator> ftp 10.85.199.47
18. Enter the FTP username and password as prompted.
The FTP view is displayed.
19. Run the following command to set the FTP transfer mode to binary:
ftp> binary
20. Run the following command to configure the path in which the script is stored on the local computer:
ftp> lcd Path in which the script is stored on the local computer
For example, if the script file is saved in E:\A01_LSW01_S5300 on the local computer, run the following command:
ftp> lcd E:\A01_LSW01_S5300 Local directory now E:\A01_LSW01_S5300.
21. Run the following command to upload the script to the switch:
ftp> put Local file name FTP file name
For example, to upload the vrpcfg.cfg file to the switch and save it as vrpcfg.cfg, run the following command:
ftp> put vrpcfg.cfg vrpcfg.cfg
The command is successfully executed if information similar to the following is displayed:
200 Port command okay. 150 Opening BINARY mode data connection for vrpcfg.cfg. 226 Transfer complete.
22. Run the following command to return to the CLI:
ftp> quit
Check the slot ID of switch 1.
23. Run the following command in the switch system view to check whether the slot ID is 0:
[Quidway] display stack
The command is successfully executed if information similar to the following is displayed:
slot# Role Mac address Priority Device type ------ ---- -------------- ------ ------- 0 Master 0018-82b1-6eb4 100 S5752C-EI
slot# in the command output indicates the switch slot number.
The slot number of switch 1 in a stacking system must be 0. If the slot number is not 0, change it manually.
24. Run the following command to change the slot number of switch 1 to 0:
[Quidway] stack slot 1 renumber 0
Restart switch 1.
25. Run the following command to switch back to the user view:
[Quidway] quit
26. Run the following command to set the script as the default configuration file:
<Quidway> startup saved-configuration vrpcfg.cfg
The command is successfully executed if information similar to the following is displayed:
Info: Succeeded in setting the configuration for booting system.
27. Run the following command to restart switch 1:
<Quidway> reboot
The command is successfully executed if information similar to the following is displayed:
Info: The system is now comparing the configuration, please wait. Warning: All the configuration will be saved to the configuration file for the n ext startup:flash:/vrpcfg.cfg, Continue?[Y/N]:
28. Enter N and press Enter.
Do not save the current configuration to the script, because this will overwrite the original script and leads to incorrect configuration of the switch.
The following information is displayed:
System will reboot! Continue?[Y/N]:
29. Enter Y to confirm the restart.
The restart is successful if commands, such as system-view, can be run through the serial port.
Power on switch 2.
30. After switch 1 is restarted, manually power on switch 2
In the switch system view, if information similar to the following is displayed after you run display stack, switch 2 is powered on:
Stack topology type : Link Stack systern MAC: 0018-82b1-6eb4 MAC switch delay time: 2 min slot# role Mac address Priority Device type ------ ---- -------------- ------ ------- 0 Master 0018-82b1-6eb4 100 S5752C-EI 1 Standby 0018-82b1-6eba 100 S5752C-EI
Enable the SSH function for switches.
31. Run the following command to switch to the system view after switch 2 is powered on:
<Quidway> system-view
32. Run the following command to create a local Rivest Shamir Adleman (RSA) key pair:
[Quidway] rsa local-key-pair create
Information similar to the following is displayed:
... Input the bits in the modulus[default = 512]:
33. Enter 1024 and press Enter.
The key pair creation starts. It is created successfully if the system view is displayed again.
34. Run the following command to set the maximum number of logins supported by SSH:
[Quidway] user-interface maximum-vty 15
35. Run the following command to switch to SSH user view:
[Quidway] user-interface vty 0 14
36. Run the following command to set the authentication mode to aaa:
[Quidway-ui-vty-0-14] authentication-mode aaa
37. Run the following command to set the access protocol:
[Quidway-ui-vty-0-14] protocol inbound all
38. Run the following command to switch back to the system view:
[Quidway-ui-vty-0-14] quit
39. Run the following command to set the authentication type to default password:
[Quidway] ssh authentication-type default password
40. Run the following command to switch to the AAA view:
[Quidway] aaa
41. Run the following command to set the password of the root user:
[Quidway-aaa] local-user root password cipher Password of the root user
The password length cannot exceed 24 characters.
The password is set successfully if information similar to the following is displayed:
info: A new user added
42. Run the following command to set rights for the root user:
[Quidway-aaa] local-user root privilege level 3
43. Run the following command to set the type of the available services for the root user to SSH:
[Quidway-aaa] local-user root service-type ssh telnet
44. Run the following command to switch back to the system view:
[Quidway-aaa] quit
45. Run the following command to enable the Stelnet service:
[Quidway] stelnet server enable
The service is enabled successfully if information similar to the following is displayed:
Info: Succeeded in starting the Stelnet server.
46. Run the following command to switch back to the user view:
[Quidway] quit
Save the configuration.
47. Run the following command to save the switch configuration:
<Quidway> save
The command is successfully executed if information similar to the following is displayed:
The current configuration will be written to the device. Are you sure to continue?[Y/N]
48. Enter Y and press Enter.
After the configuration information is saved, information similar to the following is displayed:
Info: Save the configuration successfully.
That's all, thanks!