CN-121984865-A - Configuration issuing method and device based on configuration template
Abstract
The application relates to a configuration issuing method and device based on a configuration template. The method comprises the steps of obtaining equipment information of target network equipment to be configured, determining a target configuration template from a configuration template library according to the equipment information, analyzing the target configuration template to obtain a configuration command and an interaction rule corresponding to the configuration command, establishing remote connection with the target network equipment, and performing configuration issuing based on the interaction rule and the configuration command through the remote connection. The configuration issuing method and device based on the configuration template can realize the configuration issuing of the equipment of each manufacturer in the network management platform in a simple mode, does not need a network manager to link to the equipment command line one by one for configuration issuing, and improves the speed and efficiency of configuration issuing.
Inventors
- LI LUPING
- ZHANG WENNAN
Assignees
- 杭州迪普科技股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260129
Claims (10)
- 1. A configuration issuing method based on a configuration template, comprising: Acquiring equipment information of target network equipment to be configured; determining a target configuration template from a configuration template library according to the equipment information; Analyzing the target configuration template to obtain a configuration command and an interaction rule corresponding to the configuration command; establishing a remote connection with the target network device; And performing configuration issuing based on the interaction rule and the configuration command through the remote connection.
- 2. The method as recited in claim 1, further comprising: and generating a configuration template library based on the configuration templates corresponding to different equipment manufacturers and different equipment models.
- 3. The method of claim 2, wherein the configuration template is defined in extensible markup language, XML, format and comprises at least one custom tag for encapsulating the configuration command and defining its interaction rules.
- 4. The method of claim 1, wherein obtaining device information for a target network device to be configured comprises: And acquiring equipment manufacturer information and/or equipment model information of the target network equipment to be configured.
- 5. The method of claim 1, wherein determining a target configuration template from a library of configuration templates based on the device information comprises: matching is carried out in the configuration template library based on the equipment manufacturer information and/or the equipment model information; And determining a target configuration template corresponding to the target network equipment from the matched configuration templates.
- 6. The method of claim 1, wherein parsing the target configuration template to obtain a configuration command and an interaction rule corresponding to the configuration command comprises: analyzing command nodes contained in the target configuration template to obtain a configuration command to be executed; Analyzing prompt matching rules, response rules and ending judgment rules associated with the configuration commands, and generating corresponding interaction rules.
- 7. The method of claim 1, wherein establishing a remote connection with the target network device comprises: And establishing remote connection with the target network equipment based on the authentication information of the target network equipment.
- 8. The method of claim 1, wherein configuring the issuing based on the interaction rules and the configuration commands over the remote connection comprises: sequentially issuing the configuration command to the target network equipment based on the interaction rule through the remote connection; automatically completing corresponding interactive operation according to the prompt information returned by the target network equipment; And after the preset command ending condition is met, completing configuration issuing of the target network equipment.
- 9. The method of claim 1, wherein completing the configuration delivery to the target network device after a preset command end condition is satisfied comprises: And when receiving the return information matched with the command ending judgment attribute or exceeding the time length defined by the timeout attribute, completing the configuration issuing of the target network equipment.
- 10. A configuration issuing apparatus based on a configuration template, comprising: the information module is used for acquiring equipment information of target network equipment to be configured; The template module is used for determining a target configuration template from a configuration template library according to the equipment information; the analysis module is used for analyzing the target configuration template to obtain a configuration command and an interaction rule corresponding to the configuration command; The connection module is used for establishing remote connection with the target network equipment; And the issuing module is used for performing configuration issuing based on the interaction rule and the configuration command through the remote connection.
Description
Configuration issuing method and device based on configuration template Technical Field The application relates to the field of computer information processing, in particular to a configuration issuing method and device based on a configuration template. Background In network operation and maintenance, operations such as configuration adding, modification, deletion, inquiry and the like are performed on network equipment by using Shell script through SSH protocol or Telnet protocol, which is a common mode. For example, cisco devices may obtain the current device operational configuration by executing a show running-configuration command, may configure interface IP addresses by executing IP ADDRESS A.B.C.B/Mask, etc., may obtain the current device operational configuration by executing a display current-configuration, may configure default routing by executing iproute-static 0.0.0.0 0.0.0.0 Vlanif 1, etc. Therefore, the network management platform can realize the configuration issuing of a plurality of functions of the multi-manufacturer equipment based on Shell script. In practical situations, a network administrator can perform authentication connection on each device through a network management platform according to own requirements, and perform different command configuration according to different devices. In the prior art, when an application program executes a plurality of Shell commands by using an SSH or Telnet mode to perform configuration issuing, whether the previous command is executed is judged according to the Shell prompt, and the next command can be executed after the previous command is executed. However, shell prompts for different vendor devices are different, for example, the prompt for Cisco device is hostname#, and the Shell prompt for Hua device is: [ hostname ]. After the Shell command of some manufacturer devices is executed, some follow-up actions need to be executed to complete the execution of the command. For example, when Cisco equipment enters a privilege mode, the Cisco equipment needs to execute an enable command, after the command is executed, the equipment prompts an administrator to input a privilege password, when Cisco equipment performs configuration preservation, the Cisco equipment needs to execute a save command, after the command is executed, the Cisco equipment prompts the administrator to input Y or N for confirmation. The existence of the two conditions causes that the network management platform is difficult to realize the compatibility and flexible expansion of the configuration commands of multiple manufacturers when the Shell command is used for automatically issuing the command line fragments to the equipment. Therefore, a new configuration issuing method and device based on a configuration template are needed. The above information disclosed in the background section is only for enhancement of understanding of the background of the application and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Disclosure of Invention In view of this, the present application provides a configuration issuing method and apparatus based on a configuration template, which can implement configuration issuing of each vendor device in a network management platform in a simple manner, without requiring a network administrator to link to device command lines one by one for configuration issuing, thereby improving the speed and efficiency of configuration issuing. Other features and advantages of the application will be apparent from the following detailed description, or may be learned by the practice of the application. According to one aspect of the application, a configuration issuing method based on a configuration template is provided, and the configuration issuing method comprises the steps of obtaining equipment information of target network equipment to be configured, determining a target configuration template from a configuration template library according to the equipment information, analyzing the target configuration template to obtain a configuration command and an interaction rule corresponding to the configuration command, establishing remote connection with the target network equipment, and performing configuration issuing based on the interaction rule and the configuration command through the remote connection. In an exemplary embodiment of the application, the method further comprises the step of generating a configuration template library based on the configuration templates corresponding to different equipment manufacturers and different equipment models. In an exemplary embodiment of the present application, the configuration template is defined in an extensible markup language XML format and includes at least one custom tag for encapsulating the configuration command and defining its interaction rules. In one exemplary embodiment of the application, acquiring the device inf