Method and system for automatically configuring switch
By entering the network topology in the switch configuration and using client and server-side programs for automated configuration, the problems of complex and inefficient switch configuration are solved, and efficient and accurate switch configuration and network management are achieved.
Patent Information
- Application Number
- CN202510373887.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-03-27
AI Technical Summary
In the prior art, the switch configuration is complex, manual configuration is inefficient and error-prone, resulting in configuration errors that require querying a large number of configurations and taking a lot of time to troubleshoot faults.
By entering the entire network topology, the switch is automatically configured. The client provides graphical switch and server identifiers for network managers to perform graphical planning and configuration, and the server-side program handles configuration requests and executes configuration instructions.
Reduces repetitive operations such as switch login, query, and configuration, reduces the possibility of configuration errors, improves work efficiency, and ensures the smooth operation of the network.
Smart Images

Figure CN120017497A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of switch configuration, and in particular to a method and system for automatically configuring a switch. Background Art
[0002] Switches are core components in modern network architectures and are widely used to interconnect terminal devices to form local area networks. In large data centers, switches use a multi-level structure to meet the interconnection needs of large-scale devices. There are both isolation requirements and interoperability requirements across multiple switches, which makes switch configuration more complicated. Manual configuration of switches requires a large number of repetitive operations, which is inefficient and prone to errors due to the large amount of operations. When configuration errors occur, a large number of configurations need to be queried, which takes a long time to query the switch configuration for troubleshooting. Summary of the invention
[0003] The purpose of the present invention is to provide a method and system for automatically configuring a switch, by entering the entire network topology to manage the switch, the switch configuration management personnel can realize automatic configuration of the switch by setting the network topology, so as to solve the problems raised in the above background technology.
[0004] To achieve the above object, the present invention provides the following technical solution: a method for automatically configuring a switch, the method comprising the following steps:
[0005] a) Create a network topology in the client, use the built-in switch and server identifiers to add the corresponding number of switch identifiers according to the actual number of switches, select the switch brand and model, and configure the role type and general configuration of the switch in the network topology;
[0006] b) In the client, select the switch port configuration according to the planned use of the server, display the connection port number, and provide the function of viewing the port configuration details;
[0007] c) The client provides a submit button. After completing part or all of the configuration, click the submit button to submit the configuration request to the server.
[0008] d) The server-side program includes a switch login program and a database connection program, which sorts out client requests, allocates and sorts configuration requests, queries the corresponding instruction set stored in the database according to the switch brand and model information, converts the configuration request into the corresponding switch configuration instruction, and executes the configuration instruction;
[0009] e) The server-side program queries the switch login information stored in the database according to the basic information of the target switch carried in the request, logs in to the switch, and returns the configuration result to the client program.
[0010] Preferably, step a) further comprises:
[0011] When adding a switch ID, a dialog box for selecting the switch brand and model pops up, and the configuration manager selects the correct brand and model based on the actual situation;
[0012] The switch brands and models can be added, deleted and managed through the client to manage more switch types;
[0013] After completing the selection of the switch brand and model, continue to select the role type of the switch in the network topology, such as access switch, aggregation switch, or core switch;
[0014] The configuration personnel can choose to continue with the general configuration of the switch, such as the management port address configuration, management user account password configuration, and login protocol configuration;
[0015] When you select a switch icon, choose to view the configuration details of the switch.
[0016] Preferably, step d) further comprises:
[0017] The server program calculates the configuration request for the switch port interconnection to determine whether there is a loop. If there is a loop, it checks whether the spanning tree STP protocol exists. If not, it requires the switch configuration manager to complete the spanning tree STP protocol configuration on the client.
[0018] The server program sorts the configuration requests according to the traffic direction of access switch-aggregation switch-core switch.
[0019] Preferably, the method further comprises the following steps:
[0020] f) The server-side program processes the query request. According to the query request executed by the user in the client program, the server program finds the corresponding instruction set stored in the database according to the switch brand and model carried in the request information, converts the query request into the corresponding switch configuration instruction, queries the switch login information stored in the database, logs in to the switch, and returns the query result to the client program.
[0021] Preferably, the method further comprises the following steps:
[0022] g) The database processes read and write requests. Before the client plans the network topology, it enters the switch information in advance, such as the switch brand, model and corresponding instruction set, the login address, account number, password and login method corresponding to the switch serial number. The server calls the database connection program to store these contents in the corresponding database table;
[0023] h) When planning the network, the client fills in the basic information of the switch, such as the switch serial number, connection port, and the type of the switch in the network topology, and provides a save button to save the network topology. When the user clicks the save button, the client sends the content of the network topology planning to the server program, and the server calls the database connection program to store these contents in the corresponding database table;
[0024] i) The database responds to the data query requests of the server program, which are switch configuration and query requests initiated by the client.
[0025] A system for automatically configuring a switch, the system comprising: a client module for creating and editing a network topology, the network topology including the identifiers of the switch and the server, wherein the switch identifier includes the switch brand and model, as well as the functions of topology connection, port configuration selection, port detail display and switch full configuration display; the client module also has the ability to input, delete and save content, input switch information according to actual scenarios, and completely save the planned network topology to the client program, so that it can be directly opened for modification when the network plan changes.
[0026] Preferably, the client module further comprises:
[0027] Brand and model selection unit, used to pop up a switch brand and model selection dialog box when adding a switch ID for configuration management personnel to select;
[0028] A switch type selection unit is used to select the role type of the switch in the network topology, such as access switch, aggregation switch, or core switch, after completing the brand and model selection;
[0029] General configuration unit, used to configure the management port address, management user account password and login protocol;
[0030] The port configuration unit is used to pop up the port configuration selection items when the switch identifier is connected to the server identifier, including the configuration of the port mode, VLAN ID, gateway address, etc., and display the connected port number and port configuration details;
[0031] The network topology saving unit is used to save the planned network topology to the client program.
[0032] Preferably, the database module is used to store the network topology information entered by the client module, including the switch's connection port, peer device type, serial number, and the switch's own hardware information, login information, and configuration instructions corresponding to different models of switches.
[0033] Preferably, the system further comprises: a server module, comprising a switch login program and a database connection program, for processing configuration requests and query requests of the client module:
[0034] The configuration request processing unit organizes the client requests, distributes and sorts the configuration requests, queries the corresponding instruction set stored in the database according to the switch brand and model information, converts the configuration request into the switch configuration instruction, queries the login information according to the basic information of the target switch, logs in to the switch to execute the configuration instruction, and returns the configuration result to the client module;
[0035] The query request processing unit finds the corresponding instruction set stored in the database according to the query request of the client module, converts it into a switch query instruction, queries the switch login information stored in the database, logs in to the switch to execute the query instruction, and returns the query result to the client module.
[0036] Preferably, the server module further includes:
[0037] The loop detection and STP configuration unit, when processing the configuration request of the switch port interconnection, determines whether there is a loop based on the network topology calculation. If there is a loop, it checks whether the spanning tree STP protocol exists. If not, it requires the configuration management personnel to complete the STP protocol configuration on the client module to prevent loops.
[0038] The database read and write request processing unit responds to the data read and write requests of the client module and the server module, including storing switch information, network topology planning content and responding to data query requests.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] The method and system for automatically configuring switches proposed in the present invention provide graphical switch and server identifiers through a client, so that network administrators can graphically plan the entire network topology and perform intuitive option configuration in the graphical planning, thereby reducing repetitive operations such as switch login, query, and configuration, reducing configuration errors that may be caused by repetitive operations, improving work efficiency, and ensuring the smooth operation of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a diagram of the architecture of the method of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose and technical solution of the present invention clearly and completely described, and the advantages more clearly understood, the embodiments of the present invention are further described in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are part of the embodiments of the present invention, rather than all of the embodiments, and are only used to explain the embodiments of the present invention, and are not used to limit the embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] For example, see Figure 1 The present invention provides a technical solution: a method for automatically configuring a switch, the specific implementation process is as follows:
[0044] To achieve automatic configuration of switches, there must first be a client that can enter the network topology. The client contains the identifiers of the switch and server. The switch identifier needs to include the switch brand and model to support different configuration instructions. The switch identifier also needs to have the ability to connect topology, select port configuration, display port details, and display the entire switch configuration. The client needs to provide the ability to enter or delete information, and can enter switch information according to the actual situation in the actual scenario. The client also needs to provide content storage capabilities. The planned network topology must be able to be completely saved in the client program to ensure that the plan can be opened and modified directly when there are changes in the network plan.
[0045] Secondly, there must be a database responsible for storing the network topology information entered by the client, such as the switch's connection port, the type of peer device, serial number, etc. It is also necessary to store the switch's own hardware information, such as the switch brand and model, switch serial number, switch host name, and switch login information, such as the switch management address, switch login protocol, login account password, etc. It is also necessary to store the configuration instructions corresponding to different models of switches.
[0046] Thirdly, there should be a server program including a switch login program to analyze and organize the information entered by the client and convert it into corresponding configuration instructions to send to the corresponding switch for actual configuration, and return the switch instruction execution results to the client program. The server program also needs to include a database connection program, which is responsible for connecting to the database, storing the switch information and switch connection information submitted by the client program in the database, and processing the client's request to query the switch configuration information and other database read requests.
[0047] The main steps include:
[0048] (1) Create a network topology in the client: Use the built-in switch and server identifiers in the client to add the corresponding number of switch identifiers according to the actual number of switches. When adding switch identifiers, a dialog box for selecting the switch brand and model will pop up. Configuration managers need to select the correct brand and model based on the actual situation. Switch brands and models can be added, deleted, and managed through the client, so that more switch types can be managed. After completing the selection of switch brands and models, you need to continue to select the type of role the switch plays in the network topology, such as access switch, aggregation switch, core switch, etc. Configuration personnel can choose to continue general switch configuration, such as management port address configuration, management user account password configuration, login protocol configuration, etc. When the switch identifier is selected, you can choose to view the configuration details of the switch. When the switch identifier is connected to the server identifier, the configuration options for the switch port will pop up. The configuration personnel can select the specific configuration of the port based on the planned use of the server, such as port mode, vlanid, gateway address, etc. The switch identifier needs to display the connected port number. When the port displayed on the switch identifier is selected, you can choose to view the configuration details of the port. When two switches are interconnected, a dialog box pops up to select whether the interconnection mode of the switches is dual-machine load balancing or traffic aggregation, and the VLANID that needs to be opened on the interconnected port can be prompted based on the existing VLANIDs of the two interconnected switches. When more than two switches are interconnected, the STP configuration option pops up to select the STP type and root bridge to prevent loops. The client provides a submit button. After completing part or all of the configuration, click the submit button, and the client submits the configuration request to the server. The planned network topology must be fully saved in the client program to ensure that the plan can be opened and modified directly when there are changes in the network plan.
[0049] (2) The server-side program processes the configuration request: The server-side program includes a switch login program and a database connection program. The server program organizes the client requests, distributes the configuration requests according to the corresponding switches, and sorts the configuration requests according to the traffic direction of the access switch-aggregation switch-core switch. For the configuration request of the switch port interconnection, the server program needs to calculate based on the network topology sent by the client to determine whether there is a loop. If there is a loop, it is necessary to check whether the spanning tree STP protocol exists. If not, it is necessary to force the switch configuration manager to complete the spanning tree STP protocol configuration on the client. After that, the server program needs to query the corresponding instruction set stored in the database according to the switch brand and model information carried in the request information, and convert the switch configuration request into the corresponding switch configuration instruction. Then, the server program needs to query the switch login information stored in the database according to the basic information of the target switch carried in the request, such as the serial number, including the switch login address, login method, account, password and other information. The server program calls the switch login program to log in to the switch, executes the converted switch configuration instruction in the corresponding switch, and returns the configuration result to the client program.
[0050] (3) The server-side program processes the query request: The switch identifier provided in the client program needs to have the ability to query the switch port configuration and switch configuration. When the user executes the query request in the client program, the client request is sent to the server program. At this time, the server program needs to find the corresponding instruction set stored in the database based on the switch brand and model carried in the request information, and convert the query request into the corresponding switch configuration instruction. After that, the server program needs to query the switch login information stored in the database based on the basic information of the target switch carried in the request, such as the serial number information, including the login address, login method, account number, password and other information. The server program calls the switch login program to log in to the switch, configures the converted switch query instruction to the corresponding switch for execution, and returns the query result to the client program, which is displayed to the user by the client.
[0051] (4) Database processing read and write requests: Before planning the network topology, the client needs to enter the switch information in advance, such as the switch brand, model and corresponding instruction set, the login address, account number, password, login method, etc. corresponding to the switch serial number. After the user fills in this information on the client, it will be sent to the server, and the server will call the database connection program to store these contents in the corresponding database table. When planning the network, the client will fill in the basic information of the switch, such as the switch serial number, connection port, type of switch in the network topology, etc. The client needs to provide a save button to save the network topology. When the user clicks the save button, the client sends the content of the network topology planning to the server program, and the server calls the database connection program to store these contents in the corresponding database table. The database also needs to respond to the data query requests of the server program. These data query requests are switch configuration and query requests initiated by the client.
[0052] Embodiment 2, based on embodiment 1, proposes a system for automatically configuring a switch, the system comprising: a client module for creating and editing a network topology, the network topology comprising the identifiers of the switch and the server, wherein the switch identifier comprises the switch brand and model, as well as the functions of topology connection, port configuration selection, port details display and all switch configuration display; the client module also has the ability to input, delete and save information, input switch information according to the actual scenario, and save the planned network topology completely to the client program, so that it can be directly opened for modification when the network plan changes.
[0053] The client module further includes: a brand and model selection unit, which is used to pop up a switch brand and model selection dialog box when adding a switch identifier for configuration management personnel to select; a switch type selection unit, which is used to select the type of role of the switch in the network topology after completing the brand and model selection, such as access switch, aggregation switch, core switch; a general configuration unit, which is used to configure the management port address, management user account password and login protocol; a port configuration unit, which is used to pop up port configuration selection items when the switch identifier is connected to the server identifier, including port mode, VLAN ID, gateway address and other configurations, and display the connected port number and port configuration details; a network topology saving unit, which is used to save the planned network topology to the client program.
[0054] The system also includes: a database module for storing the network topology information entered by the client module, including the switch's connection port, the opposite device type, the serial number, the switch's own hardware information, login information, and configuration instructions corresponding to different models of switches.
[0055] The system also includes: a server module, which includes a switch login program and a database connection program, and is used to process configuration requests and query requests of the client module; a configuration request processing unit, which organizes client requests, distributes and sorts configuration requests, queries the corresponding instruction set stored in the database according to the switch brand and model information, converts the configuration request into a switch configuration instruction, queries the login information according to the basic information of the target switch, logs in to the switch to execute the configuration instruction, and returns the configuration result to the client module; a query request processing unit, which finds the corresponding instruction set stored in the database according to the query request of the client module, converts it into a switch query instruction, queries the switch login information stored in the database, logs in to the switch to execute the query instruction, and returns the query result to the client module.
[0056] The server module also includes: a loop detection and STP configuration unit, which, when processing the configuration request for the switch port interconnection, determines whether there is a loop based on the network topology calculation. If there is a loop, it checks whether there is a spanning tree STP protocol. If not, it requires the configuration management personnel to complete the STP protocol configuration in the client module to prevent the occurrence of a loop; a database read and write request processing unit, which responds to the data read and write requests of the client module and the server module, including storing switch information, network topology planning content, and responding to data query requests.
[0057] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for automatically configuring a switch, characterized in that: The method comprises the following steps: a) Create a network topology in the client, use the built-in switch and server identifiers to add the corresponding number of switch identifiers according to the actual number of switches, select the switch brand and model, and configure the role type and general configuration of the switch in the network topology; b) In the client, select the switch port configuration according to the planned use of the server, display the connection port number, and provide the function of viewing the port configuration details; c) The client provides a submit button. After completing part or all of the configuration, click the submit button to submit the configuration request to the server. d) The server-side program includes a switch login program and a database connection program, which sorts out client requests, allocates and sorts configuration requests, queries the corresponding instruction set stored in the database according to the switch brand and model information, converts the configuration request into the corresponding switch configuration instruction, and executes the configuration instruction; e) The server-side program queries the switch login information stored in the database according to the basic information of the target switch carried in the request, logs in to the switch, and returns the configuration result to the client program.
2. The method for automatically configuring a switch according to claim 1, characterized in that: Step a) also includes: When adding a switch ID, a dialog box for selecting the switch brand and model pops up, and the configuration manager selects the correct brand and model based on the actual situation; The switch brands and models can be added, deleted and managed through the client to manage more switch types; After completing the selection of the switch brand and model, continue to select the role type of the switch in the network topology, such as access switch, aggregation switch, or core switch; The configuration personnel can choose to continue with the general configuration of the switch, such as the management port address configuration, management user account password configuration, and login protocol configuration; When you select a switch icon, choose to view the configuration details of the switch.
3. The method for automatically configuring a switch according to claim 2, characterized in that: Step d) also includes: The server program calculates the configuration request for the switch port interconnection to determine whether there is a loop. If there is a loop, it checks whether the spanning tree STP protocol exists. If not, it requires the switch configuration manager to complete the spanning tree STP protocol configuration on the client. The server program sorts the configuration requests according to the traffic direction of access switch-aggregation switch-core switch.
4. The method for automatically configuring a switch according to claim 3, characterized in that: The method further comprises the following steps: f) The server-side program processes the query request. According to the query request executed by the user in the client program, the server program finds the corresponding instruction set stored in the database according to the switch brand and model carried in the request information, converts the query request into the corresponding switch configuration instruction, queries the switch login information stored in the database, logs in to the switch, and returns the query result to the client program.
5. The method for automatically configuring a switch according to claim 4, characterized in that: The method further comprises the following steps: g) The database processes read and write requests. Before the client plans the network topology, it enters the switch information in advance, such as the switch brand, model and corresponding instruction set, the login address, account number, password and login method corresponding to the switch serial number. The server calls the database connection program to store these contents in the corresponding database table; h) When planning the network, the client fills in the basic information of the switch, such as the switch serial number, connection port, and the type of the switch in the network topology, and provides a save button to save the network topology. When the user clicks the save button, the client sends the content of the network topology planning to the server program, and the server calls the database connection program to store these contents in the corresponding database table; i) The database responds to the data query requests of the server program, which are switch configuration and query requests initiated by the client.
6. A system according to claim 5, characterized in that: The system includes: a client module for creating and editing a network topology, which includes the identifiers of switches and servers, wherein the switch identifier includes the switch brand and model, as well as the functions of topology connection, port configuration selection, port details display and switch full configuration display; the client module also has the ability to enter, delete and save content, enter switch information according to actual scenarios, and save the planned network topology in its entirety to the client program so that it can be directly opened for modification when there are changes in the network plan.
7. A system for automatically configuring a switch according to claim 6, characterized in that: The client module further includes: Brand and model selection unit, used to pop up a switch brand and model selection dialog box when adding a switch ID for configuration management personnel to select; A switch type selection unit is used to select the role type of the switch in the network topology, such as access switch, aggregation switch, or core switch, after completing the brand and model selection; General configuration unit, used to configure the management port address, management user account password and login protocol; The port configuration unit is used to pop up the port configuration selection items when the switch identifier is connected to the server identifier, including the configuration of the port mode, VLAN ID, gateway address, etc., and display the connected port number and port configuration details; The network topology saving unit is used to save the planned network topology to the client program.
8. The system for automatically configuring a switch according to claim 6, characterized in that: The system also includes: a database module for storing the network topology information entered by the client module, including the switch's connection port, the opposite device type, the serial number, and the switch's own hardware information, login information, and configuration instructions corresponding to different models of switches.
9. The system for automatically configuring a switch according to claim 6, characterized in that: The system also includes: a server module, including a switch login program and a database connection program, for processing configuration requests and query requests of the client module: The configuration request processing unit organizes the client requests, distributes and sorts the configuration requests, queries the corresponding instruction set stored in the database according to the switch brand and model information, converts the configuration request into the switch configuration instruction, queries the login information according to the basic information of the target switch, logs in to the switch to execute the configuration instruction, and returns the configuration result to the client module; The query request processing unit finds the corresponding instruction set stored in the database according to the query request of the client module, converts it into a switch query instruction, queries the switch login information stored in the database, logs in to the switch to execute the query instruction, and returns the query result to the client module.
10. The system for automatically configuring a switch according to claim 6, characterized in that: The server module also includes: The loop detection and STP configuration unit, when processing the configuration request of the switch port interconnection, determines whether there is a loop based on the network topology calculation. If there is a loop, it checks whether the spanning tree STP protocol exists. If not, it requires the configuration management personnel to complete the STP protocol configuration on the client module to prevent loops. The database read and write request processing unit responds to the data read and write requests of the client module and the server module, including storing switch information, network topology planning content and responding to data query requests.
Citation Information
Patent Citations
Methods and apparatus for configuring a virtual network switch
CN102055667A
Ethernet switch configuration method and switch applying the same
CN104022972A
Network equipment configuration method and device
CN108259209A
Managing virtual port channel switch peers from software-defined network controller
CN109716717A
Methods and apparatus for configuring a virtual network switch
US20110103259A1