CN107979497B - Automatic configuration method and device - Google Patents

Automatic configuration method and device Download PDF

Info

Publication number
CN107979497B
CN107979497B CN201711431162.0A CN201711431162A CN107979497B CN 107979497 B CN107979497 B CN 107979497B CN 201711431162 A CN201711431162 A CN 201711431162A CN 107979497 B CN107979497 B CN 107979497B
Authority
CN
China
Prior art keywords
server
port
switch
configuration
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711431162.0A
Other languages
Chinese (zh)
Other versions
CN107979497A (en
Inventor
刘晓
章宇东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sohu New Media Information Technology Co Ltd
Original Assignee
Beijing Sohu New Media Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sohu New Media Information Technology Co Ltd filed Critical Beijing Sohu New Media Information Technology Co Ltd
Priority to CN201711431162.0A priority Critical patent/CN107979497B/en
Publication of CN107979497A publication Critical patent/CN107979497A/en
Application granted granted Critical
Publication of CN107979497B publication Critical patent/CN107979497B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration

Landscapes

  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses an automatic configuration method and a device, wherein the method comprises the steps of receiving server parameters of a server to be configured; the server parameters comprise a server IP, a rack position of the server and a server line number; acquiring configuration parameters corresponding to the server parameters; the configuration parameters corresponding to the server parameters comprise: a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server, and a switch port number corresponding to the server line number; performing network configuration based on the configuration parameters; the network configuration based on the configuration parameters includes: configuring the virtual local area network number on a target port of a target switch corresponding to the switch IP, wherein the target port is a port corresponding to the switch port number obtained by analysis; therefore, the invention can realize the automatic configuration of the network equipment based on the acquired server parameters, and improves the working efficiency.

Description

Automatic configuration method and device
Technical Field
The invention relates to the technical field of automatic configuration, in particular to an automatic configuration method and device.
Background
With the rapid development of the internet, the number of network devices managed by each company is increasing, and it is a trend that network devices are automatically configured.
At present, a network management system is used for realizing automatic configuration of network devices, and is mainly used for automatically executing repetitive configuration management tasks and configuring mass devices in batches. Specifically, the network management system is internally provided with rich parameter configuration templates, so that the network management system can be applied to dozens of or even hundreds of routers or switch equipment in batch; and parameter configuration of a large number of network devices can be completed in a short time, and network reconstruction, device upgrading and the like can be quickly executed.
However, for the network devices in daily operation and maintenance, because the network parameters are updated frequently, the network management system cannot know the network configuration parameters in advance, and thus cannot realize the automatic configuration of the network devices in daily operation and maintenance. At present, the manual configuration is mainly relied on, and the working efficiency is low.
Disclosure of Invention
In view of this, the present invention provides an automatic configuration method and apparatus, so as to implement automatic configuration of network devices in daily operation and maintenance, and improve work efficiency.
In order to achieve the purpose, the invention provides the following technical scheme:
an auto-configuration method, comprising:
receiving server parameters of a server to be configured; the server parameters comprise a server IP, a rack position of the server and a server line number;
acquiring configuration parameters corresponding to the server parameters; the configuration parameters corresponding to the server parameters comprise: a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server, and a switch port number corresponding to the server line number;
performing network configuration based on the configuration parameters; wherein the network configuration based on the configuration parameters includes:
and configuring the virtual local area network number on a target port of a target switch corresponding to the switch IP, wherein the target port is a port corresponding to the switch port number obtained by analysis.
Preferably, the configuration parameters further include: a port mode to be configured;
the network configuration based on the configuration parameters further comprises:
acquiring a current port mode of a target port of a target switch corresponding to the switch IP;
judging whether the port mode is the port mode needing to be configured or not;
if not, the port mode is switched to the port mode to be configured.
Preferably, the server parameter further includes a MAC address of the server; the method further comprises the following steps:
judging whether the IP of the server is PING communication or not;
if so, acquiring a port number and an MAC address obtained by learning aiming at the server IP in a target switch corresponding to the switch IP;
judging whether the port number obtained by learning is consistent with the port number of the switch obtained by analyzing, and judging whether the MAC address obtained by learning is consistent with the MAC address of the server;
and if the network configuration parameters are consistent, the step of carrying out network configuration based on the configuration parameters is carried out.
Preferably, the method further comprises the following steps:
when the PING of the server IP is not communicated, acquiring a flow value of a target port of a target switch corresponding to the switch IP;
judging whether the flow value is smaller than a threshold value;
and if so, entering the step of carrying out network configuration based on the configuration parameters.
Preferably, the method further comprises the following steps:
when the flow value is larger than the threshold value, acquiring the current port mode of the target port;
judging whether the port mode is a preset port mode or not;
and if so, entering the step of carrying out network configuration based on the configuration parameters.
Preferably, the method further comprises the following steps:
determining the number of the machine room where the server is located based on the server IP;
judging whether the machine room number where the server is located is an automatically configured machine room number;
and if so, entering the step of carrying out network configuration based on the configuration parameters.
An automatic configuration device, comprising:
the parameter receiving unit is used for receiving server parameters of the server to be configured; the server parameters comprise a server IP, a rack position of the server and a server line number;
the parameter acquiring unit is used for acquiring configuration parameters corresponding to the server parameters; the configuration parameters corresponding to the server parameters comprise: a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server, and a switch port number corresponding to the server line number;
the network configuration unit is used for carrying out network configuration based on the configuration parameters; the network configuration unit includes a first configuration module, configured to configure the virtual local area network number on a target port of a target switch corresponding to the switch IP, where the target port is a port corresponding to a switch port number obtained through analysis.
Preferably, the configuration parameters further include: a port mode to be configured;
the network configuration unit further comprises:
the first port module is used for acquiring the current port mode of a target port of a target switch corresponding to the switch IP;
the first judging module is used for judging whether the port mode is the port mode needing to be configured or not;
the first switching module is configured to switch the port mode to be configured when the port mode is not the port mode to be configured.
Preferably, the server parameter further includes a MAC address of the server; the device also includes:
the first judging unit is used for judging whether the IP of the server is PING communication or not;
a first obtaining unit, configured to obtain, when the PING of the server IP is turned on, a port number and an MAC address learned and obtained for the server IP in a target switch corresponding to the switch IP;
a second judging unit, configured to judge whether the port number obtained through learning is consistent with the port number of the switch obtained through analysis, and judge whether the MAC address obtained through learning is consistent with the MAC address of the server;
and the first triggering unit is used for triggering the network configuration unit when the network configuration unit is consistent with the first triggering unit.
Preferably, the method further comprises the following steps:
a second obtaining unit, configured to obtain a traffic value of a target port of a target switch corresponding to the switch IP when the PING of the server IP is not enabled;
the third judging unit is used for judging whether the flow value is smaller than a threshold value or not;
and the second triggering unit is used for triggering the network configuration unit when the flow value is smaller than the threshold value.
Preferably, the method further comprises the following steps:
a third obtaining unit, configured to obtain a current port mode of the target port when the flow value is greater than the threshold;
a fourth judging unit, configured to judge whether the port mode is a preset port mode;
and the third triggering unit is used for triggering the network configuration unit when the port mode is a preset port mode.
Preferably, the method further comprises the following steps:
a first determining unit, configured to determine, based on the server IP, a machine room number where the server is located;
a fifth judging unit, configured to judge whether the machine room number where the server is located is an automatically configured machine room number;
and the fourth triggering unit is used for triggering the network configuration unit when the machine room number where the server is located is the automatic configuration machine room number.
As can be seen from the above technical solutions, compared with the prior art, the embodiment of the present invention discloses an automatic configuration method, including: receiving a server parameter of a server to be configured, and acquiring a configuration parameter corresponding to the server parameter, wherein the configuration parameter corresponding to the server parameter comprises: a virtual local area network number corresponding to the server IP; a switch IP corresponding to a rack position of the server; the method comprises the steps of obtaining a server line number, a server IP and a target switch, configuring a switch port number corresponding to the server line number so as to perform network configuration based on configuration parameters, and specifically, configuring a virtual local area network number on a target port of the target switch corresponding to the switch IP, wherein the target port is a port corresponding to the switch port number obtained by analysis.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart illustrating an automatic configuration method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating an automatic configuration method according to another embodiment of the present invention;
FIG. 3 is a flow chart illustrating an automatic configuration method according to another embodiment of the present invention;
FIG. 4 is a flow chart illustrating an automatic configuration method according to another embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an automatic configuration apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a network configuration unit according to another embodiment of the disclosure;
FIG. 7 is a schematic structural diagram of an automatic configuration device according to another embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an automatic configuration device according to another embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An embodiment of the present invention discloses an automatic configuration method, as shown in fig. 1, including the following steps:
step 101: receiving server parameters of a server to be configured;
it should be noted that the automatic configuration method of the present invention may be applied to an automatic configuration system, and mainly aims at automatic configuration of network devices in daily operation and maintenance, and when a server connected to a switch in daily operation and maintenance is changed, a user may send server parameters of a server to be configured to the automatic configuration system.
The automatic configuration system may be configured to communicate with a resource management platform, which is a platform for managing various basic information parameters of the network devices, for example, basic information parameters such as IP, MAC address, rack location, line number, and the like of each network device. When the user has the automatic configuration requirement, the user can apply for a server configuration work order on the resource management platform, and the resource management platform can generate server parameters based on the server configuration work order and send the server parameters to the automatic configuration system.
The server parameters include a server IP, a rack position of the server, and a server line number.
Step 102: acquiring configuration parameters corresponding to the server parameters;
specifically, the configuration parameters corresponding to the server parameters include: the server comprises a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server and a switch port number corresponding to the server line number.
Wherein, each server IP corresponds to a virtual local area network number. And the rack position of the server refers to the real field position of the server in the computer room, and the rack wiring of the server and the switch in the computer room is regular. For example, if a rack manages 10 servers and a switch can connect 40 servers, then a switch can cover 4 racks, i.e., the switches corresponding to 4 racks are the same switch. Therefore, the switch IP that manages the server can be determined based on the rack position of the server, and the switch port number that is connected to the server can be determined based on the server line number. Specifically, the correspondence between the server parameter and the configuration parameter may be stored in advance, so that the configuration parameter corresponding to the server parameter is determined based on the server parameter.
Step 103: and carrying out network configuration based on the configuration parameters.
The method specifically comprises the following steps: and configuring the virtual local area network number on a target port of a target switch corresponding to the switch IP. And the target port corresponds to the port of the switch port number obtained by analysis.
It should be noted that, before performing network configuration based on the configuration parameters, in another embodiment of the present invention, the integrity of the configuration parameters may also be detected, that is, whether the configuration parameters include a virtual local area network number, a switch IP, and a switch port number (in subsequent embodiments, if other parameters are needed, it may also be determined here, such as a MAC address of a server), if the configuration parameters are complete, then the network configuration is performed based on the configuration parameters, and if the configuration parameters are incomplete, the automatic configuration cannot be performed, and manual processing may be performed.
Therefore, in this embodiment, by receiving a server parameter of a server to be configured, a configuration parameter corresponding to the server parameter is obtained, where the configuration parameter corresponding to the server parameter includes: a virtual local area network number corresponding to the server IP; a switch IP corresponding to a rack position of the server; the method comprises the steps of obtaining a server line number, a server IP and a target switch, configuring a switch port number corresponding to the server line number so as to perform network configuration based on configuration parameters, and specifically, configuring a virtual local area network number on a target port of the target switch corresponding to the switch IP, wherein the target port is a port corresponding to the switch port number obtained by analysis.
In another embodiment of the present invention, a configuration of a port mode of a switch may also be implemented, specifically, the server parameter may further include a port mode to be configured, and correspondingly, the configuration parameter also includes the port mode to be configured. As shown in fig. 2, an automatic configuration method includes the steps of:
step 201: receiving server parameters of a server to be configured;
the server parameters comprise a server IP, a rack position of the server, a server line number and a port mode to be configured.
Step 202: acquiring configuration parameters corresponding to the server parameters;
the configuration parameters corresponding to the server parameters comprise: the virtual local area network number corresponding to the server IP, the switch IP corresponding to the rack position of the server, and the switch port number corresponding to the server line number may directly obtain the port mode to be configured from the server parameter, so that the port mode to be configured in the server parameter may be directly determined as the configuration parameter.
Step 203: acquiring a current port mode of a target port of a target switch corresponding to the switch IP;
and the target port corresponds to the port of the switch port number obtained by analysis.
The port mode of the switch generally includes two types of modes, one is a mode that only allows one virtual local area network to pass through, i.e. only allows IP of one network segment to pass through, and this port mode is called a first type port mode (also called an access port mode). The other is a mode allowing multiple virtual local area networks to pass through, that is, a mode allowing multiple different network segments to pass through IP, and this port mode may be referred to as a second type port mode (also referred to as trunk port mode).
Since the target port of the target switch has a previously configured port mode or a default port mode, the current port mode of the target port needs to be acquired. For example, the obtained current port mode on the target port is the first type port mode.
Step 204: judging whether the port mode is the port mode to be configured, if not, entering a step 205, and if so, entering a step 206;
step 205: switching the port mode to be configured;
when the current port mode of the target port is not consistent with the port mode to be configured, the current port mode of the target port needs to be switched, and if the port mode to be configured is the second type port mode, the current first type port mode of the target port needs to be switched to the second type port mode. The port mode is switched and the process proceeds to step 206.
Step 206: and configuring the virtual local area network number on a target port of a target switch corresponding to the switch IP.
If the current port mode of the target port is switched, a virtual local area network number is configured on the target port of the target switch after the port mode is switched, and if the current port mode of the target port is not switched, the virtual local area network number is directly configured on the target port of the target switch.
It should be noted that, the step 203-206 is a specific implementation of network configuration based on the configuration parameters.
Therefore, the invention can realize the automatic configuration of the network equipment based on the acquired server parameters, and improves the working efficiency.
In order to ensure the accuracy of the automatic configuration, the accuracy of the acquired parameters needs to be judged before the network configuration is performed based on the configuration parameters, and another embodiment of the present invention discloses an automatic configuration method, as shown in fig. 3, the method includes the following steps:
step 301: receiving server parameters of a server to be configured;
the server parameters include a server IP, a rack location of the server, a server line number, and a MAC address of the server.
Step 302: acquiring configuration parameters corresponding to the server parameters;
the configuration parameters corresponding to the server parameters comprise: the server comprises a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server and a switch port number corresponding to the server line number.
Step 303: judging whether the server IP is PING-on or not, if so, entering a step 304, and if not, entering a step 306;
wherein, the PING tool can be used to judge whether the server IP is PING-on.
Step 304: acquiring a port number and an MAC address which are obtained by learning aiming at the server IP in a target switch corresponding to the switch IP;
specifically, the port number and the MAC address obtained by the IP learning for the server may be captured on the target switch through a naming query or through an SNMP protocol.
Step 305: judging whether the port number obtained by learning is consistent with the port number of the switch obtained by analysis, judging whether the MAC address obtained by learning is consistent with the MAC address of the server, and if so, entering step 310; if not, go to step 311;
when the learned port number is not consistent with the analyzed switch port number, or the learned MAC address is not consistent with the MAC address of the server, the process proceeds to step 311.
Step 306: acquiring a flow value of a target port of a target switch corresponding to the switch IP;
when the PING of the IP of the server is not enabled, it indicates that the network under the IP of the server is not enabled, and in this case, it needs to determine whether the traffic value under the target port of the target switch is small, and specifically, the traffic value of the target port of the target switch can be captured through the SNMP protocol.
Step 307: judging whether the flow value is smaller than a threshold value, if not, entering a step 308; if yes, go to step 310;
the threshold value is a preset flow rate value, and a relatively small value can be set. Whether a port analyzed based on a server signal is correct is determined by judging whether a traffic value is smaller than a threshold, and if the traffic value is smaller than the threshold, the port mode of the target port is a mode which only allows one virtual local area network to pass through, that is, a mode which only allows the IP of one network segment to pass through, and the port mode is called a first type port mode (also called an access port mode). Then an automatic configuration process may proceed to step 310.
Step 308: acquiring the current port mode of the target port;
and when the flow value is larger than the threshold value, the current port mode of the target port needs to be acquired.
Step 309: judging whether the port mode is a preset port mode, if so, entering a step 310, and if not, entering a step 311;
the preset port mode is a second type port mode, wherein the second type port mode may also be referred to as a trunk port mode, and is a mode allowing multiple virtual local area networks to pass through, that is, a mode allowing multiple different network segments to pass through IP. In this mode, although the PINGs of the server IP to be configured are not on, the PINGs of the other server IPs are on, and therefore the common port traffic is large and exceeds the threshold. That is, when the flow value of the target port is greater than the threshold, if the current port mode of the target port is the second type port mode, the automatic configuration process may also be performed, i.e., step 310 is entered.
If the flow value of the target port is greater than the threshold value but the current port mode of the target port is not the preset port mode, it indicates that the port number parsed from the line number is incorrect, and in this case, step 311 is performed.
Step 310: performing network configuration based on the configuration parameters;
specifically, the virtual local area network number is configured on a target port of a target switch corresponding to the switch IP, where the target port is a port corresponding to the switch port number obtained by the analysis.
Step 311: the auto-configuration process is stopped.
The automatic configuration process may be stopped before manual processing.
Note that, in the present embodiment, various types of judgment mashups for information accuracy are described together, which do not constitute a limitation on automatic configuration, that is, judgment of only partial information may be included.
Therefore, the invention can realize the automatic configuration of the network equipment based on the acquired server parameters, and improves the working efficiency. And before network configuration is carried out based on the configuration parameters, the judgment of information accuracy is carried out, so that the accuracy of automatic configuration is improved.
Another embodiment of the present invention discloses an automatic configuration method, as shown in fig. 4, the method includes the following steps:
step 401: receiving server parameters of a server to be configured;
the server parameters include server IP, rack location of the server, and server line number.
Step 402: acquiring configuration parameters corresponding to the server parameters;
the configuration parameters corresponding to the server parameters comprise: the server comprises a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server and a switch port number corresponding to the server line number.
Step 403: determining the number of the machine room where the server is located based on the server IP;
the server IP comprises the number of the machine room where the server is located, so that the number of the machine room where the server is located can be obtained by analyzing the server IP.
Step 404: judging whether the machine room number where the server is located is an automatic configuration machine room number, if so, entering a step 405, and if not, entering a step 406;
some machine rooms do not have the automatic configuration condition, and the machine rooms with the automatic configuration condition can be set as the automatic configuration machine room numbers, so that whether the machine room number where the server is located is the automatic configuration machine room number or not is judged.
Step 405: performing network configuration based on the configuration parameters;
specifically, the virtual local area network number is configured on a target port of a target switch corresponding to the switch IP, where the target port is a port corresponding to the switch port number obtained by the analysis.
Step 406: the current auto-configuration is stopped.
The automatic configuration process may be stopped before manual processing.
Therefore, the invention can realize the automatic configuration of the network equipment based on the acquired server parameters, and improves the working efficiency. And before network configuration is carried out based on the configuration parameters, whether the machine room number where the server is located is the automatic configuration machine room number is judged, and when the machine room number where the server is located is determined to be the automatic configuration machine room number, network configuration is carried out based on the configuration parameters, so that the accuracy of automatic configuration is improved.
In another embodiment of the present invention, after the automatic configuration is completed, whether the network configuration is successful or not can be detected, specifically, whether the server IP is PING-enabled or not can be detected, and if the PING is PING-enabled, the automatic configuration is successful.
Corresponding to the above automatic configuration method, the present invention also discloses an automatic configuration device, which is described in detail below by several embodiments.
An embodiment of the present invention discloses an automatic configuration device, as shown in fig. 5, the device includes: a parameter receiving unit 501, a parameter acquiring unit 502 and a network configuration unit 503; wherein:
a parameter receiving unit 501, configured to receive server parameters of a server to be configured; the server parameters comprise a server IP, a rack position of the server and a server line number;
it should be noted that the automatic configuration apparatus of the present invention may be applied to an automatic configuration system, and mainly aims at automatic configuration of network devices in daily operation and maintenance, and when a server connected to a switch in daily operation and maintenance is changed, a user may send server parameters of a server to be configured to the automatic configuration system.
The automatic configuration system may be configured to communicate with a resource management platform, which is a platform for managing various basic information parameters of the network devices, for example, basic information parameters such as IP, MAC address, rack location, line number, and the like of each network device. When the user has the automatic configuration requirement, the user can apply for a server configuration work order on the resource management platform, and the resource management platform can generate server parameters based on the server configuration work order and send the server parameters to the automatic configuration system.
The server parameters include a server IP, a rack position of the server, and a server line number.
An obtaining parameter unit 502, configured to obtain a configuration parameter corresponding to the server parameter;
wherein the configuration parameters corresponding to the server parameters include: the server comprises a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server and a switch port number corresponding to the server line number.
Wherein, each server IP corresponds to a virtual local area network number. And the rack position of the server refers to the real field position of the server in the computer room, and the rack wiring of the server and the switch in the computer room is regular. For example, if a rack manages 10 servers and a switch can connect 40 servers, then a switch can cover 4 racks, i.e., the switches corresponding to 4 racks are the same switch. Therefore, the switch IP that manages the server can be determined based on the rack position of the server, and the switch port number that is connected to the server can be determined based on the server line number. Specifically, the correspondence between the server parameter and the configuration parameter may be stored in advance, so that the configuration parameter corresponding to the server parameter is determined based on the server parameter.
A network configuration unit 503, configured to perform network configuration based on the configuration parameters;
the network configuration unit 503 includes a first configuration module, configured to configure the virtual local area network number on a target port of a target switch corresponding to the switch IP. The target port is the port corresponding to the port number of the switch obtained by analysis.
It should be noted that, before performing network configuration based on the configuration parameters, in another embodiment of the present invention, the method may further include: the first detecting unit is configured to detect integrity of the configuration parameter, that is, to detect whether the configuration parameter includes a virtual local area network number, a switch IP, and a switch port number (in subsequent embodiments, if other parameters need to be used, it may also be determined here, for example, an MAC address of a server).
Therefore, the invention can realize the automatic configuration of the network equipment based on the acquired server parameters, and improves the working efficiency.
In another embodiment of the present invention, the configuration parameters further include a port mode to be configured. Specifically, as shown in fig. 6, the network configuration unit 603 includes: a first end port module 6031, a first judgment module 6032, a first switching module 6033 and a first configuration module 6034; wherein:
a first port module 6031, configured to obtain a current port mode of a target port of a target switch corresponding to the switch IP;
and the target port corresponds to the port of the switch port number obtained by analysis.
The port mode of the switch generally includes two types of modes, one is a mode that only allows one virtual local area network to pass through, i.e. only allows IP of one network segment to pass through, and this port mode is called a first type port mode (also called an access port mode). The other is a mode allowing multiple virtual local area networks to pass through, that is, a mode allowing multiple different network segments to pass through IP, and this port mode may be referred to as a second type port mode (also referred to as trunk port mode).
Since the target port of the target switch has a previously configured port mode or a default port mode, the current port mode of the target port needs to be acquired. For example, the obtained current port mode on the target port is the first type port mode.
A first determining module 6032, configured to determine whether the port mode is the port mode to be configured;
a first switching module 6033, configured to switch the port mode to be configured when the port mode is not the port mode to be configured;
a first configuring module 6034, configured to configure the virtual local area network number on a target port of a target switch corresponding to the switch IP.
When the first switching module switches the current port mode of the target port, the first configuration module is used for configuring a virtual local area network number on the target port of the target switch after the first switching module switches the port mode; when the first switching module does not switch the current port mode of the target port, the first configuration module is directly used for configuring the virtual local area network number on the target port of the target switch.
Therefore, the invention can realize the automatic configuration of the network equipment based on the acquired server parameters, and improves the working efficiency.
Another embodiment of the present invention discloses an automatic configuration apparatus, as shown in fig. 7, the apparatus including: a parameter receiving unit 701, a parameter acquiring unit 702, a first judging unit 703, a first acquiring unit 704, a second judging unit 705, a first triggering unit 706, and a network configuring unit 707; wherein:
a parameter receiving unit 701, configured to receive a server parameter of a server to be configured;
the server parameters include server IP, rack position of the server, server line number and server MAC address.
An obtaining parameter unit 702, configured to obtain a configuration parameter corresponding to the server parameter;
the configuration parameters corresponding to the server parameters comprise: the server comprises a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server and a switch port number corresponding to the server line number.
A first determining unit 703, configured to determine whether the server IP is PING;
the first determining unit 703 may be configured to determine whether the server IP is PING-on using a PING tool.
A first obtaining unit 704, configured to obtain, when the PING of the server IP is turned on, a port number and an MAC address learned and obtained for the server IP in a target switch corresponding to the switch IP;
a second determining unit 705, configured to determine whether the port number obtained by learning is consistent with the port number of the switch obtained by analyzing, and determine whether the MAC address obtained by learning is consistent with the MAC address of the server;
specifically, the second determining unit 705 may be configured to capture, on the target switch, the port number and the MAC address obtained by the IP learning for the server through a naming query or through an SNMP protocol.
A first triggering unit 706 configured to trigger the network configuring unit 707 when the two are consistent;
a network configuration unit 707 configured to perform network configuration based on the configuration parameters;
the network configuration unit 707 includes a first configuration module, configured to configure the virtual local area network number on a target port of a target switch corresponding to the switch IP.
And the target port corresponds to the port of the switch port number obtained by analysis.
In another embodiment of the present invention, with continued reference to fig. 7, the apparatus further comprises: a second obtaining unit 708, a third determining unit 709, and a second triggering unit 710; wherein:
a second obtaining unit 708, configured to obtain, when the PING of the server IP is not enabled, a traffic value of a target port of a target switch corresponding to the switch IP;
in a case that the PING of the IP of the server is not enabled, it is determined that the network under the IP of the server is not enabled, and in this case, it is required to determine whether the traffic value under the target port of the target switch is small, and specifically, the second obtaining unit 708 may be configured to capture the traffic value of the target port of the target switch through an SNMP protocol.
A third determining unit 709, configured to determine whether the flow value is smaller than a threshold;
the threshold value is a preset flow rate value, and a relatively small value can be set. Whether a port analyzed based on a server signal is correct is determined by judging whether a traffic value is smaller than a threshold, and if the traffic value is smaller than the threshold, the port mode of the target port is a mode which only allows one virtual local area network to pass through, that is, a mode which only allows the IP of one network segment to pass through, and the port mode is called a first type port mode (also called an access port mode).
A second triggering unit 710, configured to trigger the network configuration unit when the flow value is smaller than the threshold.
In another embodiment of the present invention, with continued reference to fig. 7, further comprising: a third acquiring unit 711, a fourth determining unit 712, and a third triggering unit 713; wherein:
a third obtaining unit 711, configured to obtain a current port mode of the target port when the flow value is greater than the threshold;
a fourth determining unit 712, configured to determine whether the port mode is a preset port mode;
the preset port mode is a second type port mode, wherein the second type port mode may also be referred to as a trunk port mode, and is a mode allowing multiple virtual local area networks to pass through, that is, a mode allowing multiple different network segments to pass through IP. In this mode, although the PINGs of the server IP to be configured are not on, the PINGs of the other server IPs are on, and therefore the common port traffic is large and exceeds the threshold. That is, when the flow value of the target port is greater than the threshold value, if the current port mode of the target port is the second type port mode, the automatic configuration process may also be performed.
A third triggering unit 713, configured to trigger the network configuration unit when the port mode is a preset port mode.
In another embodiment of the present invention, the apparatus may further include: the configuration unit is stopped.
A configuration stopping unit, configured to stop the automatic configuration process when the learned port number is inconsistent with the analyzed switch port number or the learned MAC address is inconsistent with the MAC address of the server; and the automatic configuration device is also used for stopping the automatic configuration process when the current port mode of the target port is not the preset port mode.
Another embodiment of the present invention discloses an automatic configuration apparatus, as shown in fig. 8, the apparatus includes: a parameter receiving unit 801, a parameter acquiring unit 802, a first determining unit 803, a fifth judging unit 804, a fourth triggering unit 805, and a network configuring unit 806; wherein:
a parameter receiving unit 801, configured to receive server parameters of a server to be configured;
the server parameters include server IP, rack location of the server, and server line number.
An obtaining parameter unit 802, configured to obtain a configuration parameter corresponding to the server parameter;
wherein the configuration parameters corresponding to the server parameters include: the server comprises a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server and a switch port number corresponding to the server line number.
A first determining unit 803, configured to determine, based on the server IP, a machine room number where the server is located;
the server IP comprises the number of the machine room where the server is located, so that the number of the machine room where the server is located can be obtained by analyzing the server IP.
A fifth judging unit 804, configured to judge whether the machine room number where the server is located is an auto-configuration machine room number;
some machine rooms do not have the automatic configuration condition, and the machine rooms with the automatic configuration condition can be set as the automatic configuration machine room numbers, so that whether the machine room number where the server is located is the automatic configuration machine room number or not is judged.
A fourth triggering unit 805, configured to trigger the network configuration unit when the machine room number where the server is located is an auto-configuration machine room number;
a network configuration unit 806, configured the network based on the configuration parameters.
The network configuration unit 806 includes a first configuration module, configured to configure the virtual local area network number on a target port of a target switch corresponding to the switch IP. The target port is the port corresponding to the port number of the switch obtained by analysis.
In another embodiment of the present invention, the automatic configuration apparatus further comprises: and the configuration stopping unit is used for stopping the current automatic configuration when the machine room number where the server is located is not the automatic configuration machine room number.
In another embodiment of the present invention, the automatic configuration apparatus further comprises: the detection configuration unit is used for detecting whether the network configuration is successful, specifically, whether the server IP is PING-enabled or not can be detected, and if the PING is enabled, the automatic configuration is successful.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An auto-configuration method, comprising:
receiving server parameters of a server to be configured; the server parameters comprise a server IP, a rack position of the server and a server line number; wherein the receiving the server parameter of the server to be configured includes: receiving server parameters generated and sent by a resource management platform based on a server configuration work order applied by a user;
acquiring configuration parameters corresponding to the server parameters; the configuration parameters corresponding to the server parameters comprise: a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server, a switch port number corresponding to the server line number, and a port mode to be configured;
detecting the integrity of the configuration parameters;
if the network configuration is complete, performing network configuration based on the configuration parameters; wherein the network configuration based on the configuration parameters includes: acquiring a current port mode of a target port of a target switch corresponding to the switch IP; judging whether the port mode is the port mode needing to be configured or not; if not, switching the port mode to be configured; configuring the virtual local area network number on a target port of a target switch corresponding to the switch IP, wherein the target port is a port corresponding to a switch port number obtained by analysis;
if not, the manual treatment is switched.
2. The method of claim 1, wherein the server parameters further include a MAC address of the server; the method further comprises the following steps:
judging whether the IP of the server is PING communication or not;
if so, acquiring a port number and an MAC address obtained by learning aiming at the server IP in a target switch corresponding to the switch IP;
judging whether the port number obtained by learning is consistent with the port number of the switch obtained by analyzing, and judging whether the MAC address obtained by learning is consistent with the MAC address of the server;
and if the network configuration parameters are consistent, the step of carrying out network configuration based on the configuration parameters is carried out.
3. The method of claim 2, further comprising:
when the PING of the server IP is not communicated, acquiring a flow value of a target port of a target switch corresponding to the switch IP;
judging whether the flow value is smaller than a threshold value;
and if so, entering the step of carrying out network configuration based on the configuration parameters.
4. The method of claim 3, further comprising:
when the flow value is larger than the threshold value, acquiring the current port mode of the target port;
judging whether the port mode is a preset port mode or not;
and if so, entering the step of carrying out network configuration based on the configuration parameters.
5. The method of claim 1, further comprising:
determining the number of the machine room where the server is located based on the server IP;
judging whether the machine room number where the server is located is an automatically configured machine room number;
and if so, entering the step of carrying out network configuration based on the configuration parameters.
6. An automatic configuration device, comprising:
the parameter receiving unit is used for receiving server parameters of the server to be configured; the server parameters comprise a server IP, a rack position of the server and a server line number; wherein the receiving the server parameter of the server to be configured includes: receiving server parameters generated and sent by a resource management platform based on a server configuration work order applied by a user;
the parameter acquiring unit is used for acquiring configuration parameters corresponding to the server parameters; the configuration parameters corresponding to the server parameters comprise: a virtual local area network number corresponding to the server IP, a switch IP corresponding to the rack position of the server, a switch port number corresponding to the server line number, and a port mode to be configured;
the first detection unit is used for detecting the integrity of the configuration parameters; if the configuration parameters are complete, triggering a network configuration unit to perform network configuration based on the configuration parameters; if not, manual treatment is carried out;
the network configuration unit is used for carrying out network configuration based on the configuration parameters; the network configuration unit comprises a first configuration module, configured to configure the virtual local area network number on a target port of a target switch corresponding to the switch IP, where the target port is a port corresponding to a switch port number obtained through analysis;
the network configuration unit further comprises:
the first port module is used for acquiring the current port mode of a target port of a target switch corresponding to the switch IP;
the first judging module is used for judging whether the port mode is the port mode needing to be configured or not;
the first switching module is configured to switch the port mode to be configured when the port mode is not the port mode to be configured.
7. The apparatus of claim 6, wherein the server parameters further comprise a MAC address of the server; further comprising:
the first judging unit is used for judging whether the IP of the server is PING communication or not;
a first obtaining unit, configured to obtain, when the PING of the server IP is turned on, a port number and an MAC address learned and obtained for the server IP in a target switch corresponding to the switch IP;
a second judging unit, configured to judge whether the port number obtained through learning is consistent with the port number of the switch obtained through analysis, and judge whether the MAC address obtained through learning is consistent with the MAC address of the server;
and the first triggering unit is used for triggering the network configuration unit when the network configuration unit is consistent with the first triggering unit.
8. The apparatus of claim 7, further comprising:
a second obtaining unit, configured to obtain a traffic value of a target port of a target switch corresponding to the switch IP when the PING of the server IP is not enabled;
the third judging unit is used for judging whether the flow value is smaller than a threshold value or not;
and the second triggering unit is used for triggering the network configuration unit when the flow value is smaller than the threshold value.
9. The apparatus of claim 8, further comprising:
a third obtaining unit, configured to obtain a current port mode of the target port when the flow value is greater than the threshold;
a fourth judging unit, configured to judge whether the port mode is a preset port mode;
and the third triggering unit is used for triggering the network configuration unit when the port mode is a preset port mode.
10. The apparatus of claim 6, further comprising:
a first determining unit, configured to determine, based on the server IP, a machine room number where the server is located;
a fifth judging unit, configured to judge whether the machine room number where the server is located is an automatically configured machine room number;
and the fourth triggering unit is used for triggering the network configuration unit when the machine room number where the server is located is the automatic configuration machine room number.
CN201711431162.0A 2017-12-26 2017-12-26 Automatic configuration method and device Active CN107979497B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711431162.0A CN107979497B (en) 2017-12-26 2017-12-26 Automatic configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711431162.0A CN107979497B (en) 2017-12-26 2017-12-26 Automatic configuration method and device

Publications (2)

Publication Number Publication Date
CN107979497A CN107979497A (en) 2018-05-01
CN107979497B true CN107979497B (en) 2021-08-13

Family

ID=62007573

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711431162.0A Active CN107979497B (en) 2017-12-26 2017-12-26 Automatic configuration method and device

Country Status (1)

Country Link
CN (1) CN107979497B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109309633B (en) * 2018-09-21 2021-06-15 郑州云海信息技术有限公司 Whole cabinet server node management method and device based on management switch
CN109257226B (en) * 2018-10-23 2021-08-27 网宿科技股份有限公司 Port configuration method and device of virtual IP
CN110113218A (en) * 2019-05-24 2019-08-09 深圳云里物里科技股份有限公司 A kind of gateway configuration method, system, computer storage medium and electronic equipment
CN113347046B (en) * 2021-07-08 2023-08-25 中国建设银行股份有限公司 Network access method and device
CN114095350A (en) * 2021-11-22 2022-02-25 中国电信股份有限公司 Equipment configuration method, service configuration method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242305A (en) * 2008-02-25 2008-08-13 中兴通讯股份有限公司 Parameter configuration method and device for network device
CN104202192A (en) * 2014-09-05 2014-12-10 上海斐讯数据通信技术有限公司 Method for configuring exchangers in batches
CN105071948A (en) * 2015-07-06 2015-11-18 李雅妮 Automatic deployment method and device for access switcher

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102624557A (en) * 2012-03-09 2012-08-01 浪潮通信信息系统有限公司 Method for automatic check, configuration and backup for client-side equipment configuration
CN104065758A (en) * 2013-03-18 2014-09-24 杭州华三通信技术有限公司 Active device automatic deployment method, device and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242305A (en) * 2008-02-25 2008-08-13 中兴通讯股份有限公司 Parameter configuration method and device for network device
CN104202192A (en) * 2014-09-05 2014-12-10 上海斐讯数据通信技术有限公司 Method for configuring exchangers in batches
CN105071948A (en) * 2015-07-06 2015-11-18 李雅妮 Automatic deployment method and device for access switcher

Also Published As

Publication number Publication date
CN107979497A (en) 2018-05-01

Similar Documents

Publication Publication Date Title
CN107979497B (en) Automatic configuration method and device
CN110661669B (en) Network topology automatic discovery method of network equipment based on ICMP, TCP and UDP protocols
CN111147513A (en) Transverse moving attack path determination method in honey net based on attack behavior analysis
US10193747B2 (en) Fault detection method and device
CN112367223A (en) Ethernet test method, device, equipment and medium for gateway controller
CN112291075B (en) Network fault positioning method and device, computer equipment and storage medium
CN113825129A (en) Industrial internet asset mapping method under 5G network environment
CN111224815B (en) Data center equipment access method, device and related components
KR101341596B1 (en) Apparatus and method for monitoring of wep application telecommunication data by user
CN109471763B (en) Method, device, equipment and system for grabbing trace of NVME (network video management entity) hard disk
CN107040666B (en) Dial testing method, device, terminal and system for gigabit passive optical network bearer service
CN106713038B (en) remote transmission line quality detection method and system
CN106598793B (en) Test system and test method based on BIOS serial port log data
CN106130787B (en) Service processing system based on software defined network
CN112995042A (en) Method, device and equipment for generating service topological graph and storage medium
CN111124828A (en) Data processing method, device, equipment and storage medium
CN113992507B (en) Method, device, server and storage medium for determining default parameter values
CN111064794B (en) Fault detection method, device, equipment and storage medium of terminal equipment
CN113824721B (en) Information processing method based on network and electronic equipment
CN115499333A (en) Method, system, storage medium and electronic device for determining association relationship
CN113709210A (en) Device discovery method, device, system, electronic device and storage medium
CN114500247A (en) Industrial control network fault diagnosis method and device, electronic equipment and readable storage medium
CN113918459A (en) Self-detection method for script performance test
CN106534402B (en) Method and system for identifying train network equipment
CN109286947B (en) Detection method and device of wireless access equipment and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant