Network address configuration method, network address configuration device, and storage medium

By receiving a set of IP addresses, selecting the target IP address and network card, determining the target mode and storing it in the connectivity file, and using an automated configuration script to update the IP address, the problem of low IP address verification efficiency in the multi-NIC binding mode is solved, and automated IP address configuration and verification are realized.

CN116896542BActive Publication Date: 2026-04-28CHINA MERCHANTS BANK
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MERCHANTS BANK
Filing Date
2023-08-25
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, semi-automatic IP address configuration modes cannot automatically configure IP addresses in multi-NIC binding modes, resulting in low IP address verification efficiency and requiring manual intervention.

Method used

By receiving a set of IP addresses, selecting the target IP address and network card, determining the target mode, and storing them in the connectivity file, the network card IP address information is updated using an automated configuration script, avoiding manual intervention.

Benefits of technology

It enables automatic IP address configuration in unknown scenarios, improving IP address verification efficiency and reducing the need for manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116896542B_ABST
    Figure CN116896542B_ABST
Patent Text Reader

Abstract

The application discloses a network address configuration method, a network address configuration device and a storage medium. The method comprises the following steps: after receiving an IP address set to be configured, selecting a target IP address in the IP address set and selecting a target network card to be configured; determining a target mode corresponding to the target IP address in the target network card to be configured, wherein the target network card to be configured can access a network based on the target IP address in the target mode; storing the target IP address and the target mode in a connectivity file; and updating IP address information of the network card to be configured based on the connectivity file. The application can improve the verification efficiency of the IP address by using the IP connectivity of the target IP address in the IP address set to be configured in multiple target modes of the network card to be configured, and then selecting the IP address corresponding to each network port of the network card to be configured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network communication technology, and in particular to a method for configuring network addresses, a device for configuring network addresses, and a storage medium. Background Technology

[0002] Configuring a server's Internet Protocol (IP) address is a crucial step in ensuring network connectivity at the server's IP layer. In existing static IP address configuration schemes, the manual static configuration of IP addresses has gradually evolved into a semi-automated IP address configuration mode that uses scripting languages ​​to simulate manual configuration. However, current semi-automated IP address configuration modes are based on the association between the IP address and a single network interface card (NIC) within the program, making it impossible to configure other IP addresses for that NIC. In other words, it is only suitable for single NIC, single IP address scenarios. In complex scenarios such as bonded modes (binding multiple NICs), manual configuration and verification of the corresponding network interface IP address are still required, resulting in low IP address verification efficiency.

[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this invention is to provide a method, apparatus and storage medium for configuring network addresses, thereby solving the problem of low efficiency in IP address verification in the prior art.

[0005] To achieve the above objectives, the present invention provides a method for configuring network addresses, the method comprising the following steps:

[0006] After receiving the set of IP addresses to be configured, select the target IP address and the target network interface card to be configured from the set of IP addresses;

[0007] Determine the target mode corresponding to the target IP address among the target network interface cards to be configured, wherein, under the target mode, the target network interface card to be configured can access the network based on the target IP address;

[0008] The target IP address and the target pattern are associated and stored in a connectivity file;

[0009] The IP address information of the network interface card to be configured is updated based on the connectivity file.

[0010] Optionally, the step of updating the IP address information of the target network interface card to be configured based on the connectivity file includes:

[0011] Obtain the fill information of the connected file, and update the configuration parameters of the automated configuration script based on the fill information;

[0012] The automated configuration script is started, and an IP address is configured for the target network interface card based on the configuration parameters.

[0013] Optionally, before the step of updating the IP address information of the target network interface card to be configured based on the connectivity file, the method further includes:

[0014] Obtain the network status detection information of each IP address in the set of IP addresses under multiple target modes of the target network card to be configured;

[0015] When the network status detection information of all the IP addresses is detected, the step of updating the IP address information of the target network card to be configured based on the connectivity file is executed.

[0016] Optionally, the steps of selecting a target IP address from the set of IP addresses to be configured and selecting a target network interface card to be configured after receiving the set of IP addresses to be configured include:

[0017] Upon receiving the set of IP addresses to be configured, the network configuration status of each IP address is determined;

[0018] If any of the IP addresses are in a configured state, delete the IP addresses in the configured state from the set of IP addresses.

[0019] The IP address with the smallest number in the IP address set is selected as the target IP address based on the order of IP address numbers. At the same time, the target network card to be configured is selected based on the arrangement information of multiple network cards to be configured, or the preset network card number information.

[0020] Optionally, the step of determining the target mode corresponding to the target IP address among the target network interface cards to be configured, wherein the target network interface card to be configured can access the network based on the target IP address under the target mode, includes:

[0021] Determine the configuration priority of multiple target modes for the target network interface card to be configured;

[0022] The test mode is determined based on the configuration priority, and the network status of the target IP address in the test mode is obtained;

[0023] When the target IP address is in a connected state, the mode to be tested is determined to be the target mode; or

[0024] When the target IP address is not in a connected state, the priority of the target mode is reduced, and the process jumps to the step of determining the test mode based on the configuration priority and obtaining the network status of the target IP address in the test mode.

[0025] Optionally, after determining the target mode corresponding to the target IP address in the target network interface card to be configured, wherein the target network interface card to be configured can access the network based on the target IP address in the target mode, the method further includes:

[0026] When the target pattern does not exist, the target IP address that is in a disconnected state is marked as a blank IP address, and the blank IP address is deleted from the IP address set;

[0027] When the network status detection information for all the IP addresses is detected, if the fill information of the connectivity file is empty, output a prompt message indicating that the network configuration has not been issued.

[0028] Optionally, after the step of associating and storing the target IP address and the target pattern in the connectivity file, the method further includes:

[0029] Delete the target IP address from the set of IP addresses;

[0030] When the IP address set is not empty, proceed to the steps of selecting the target IP address from the IP address set and selecting the target network interface card to be configured; or

[0031] When the IP address set is empty and the connectivity file is not empty, the step of updating the IP address information of the target network interface card to be configured based on the connectivity file is executed.

[0032] Optionally, after the step of updating the IP address information of the target network interface card to be configured based on the connectivity file, the method further includes:

[0033] Perform IP address connectivity checks on all network cards to be configured;

[0034] If the IP address connectivity test result for the target network interface card to be configured is unsuccessful, output the IP address configuration failure message for the target network interface card;

[0035] When the IP address connectivity test results for all the network interfaces to be configured are successful, output a message indicating that all the network interfaces to be configured have been successfully configured.

[0036] In addition, to achieve the above objectives, the present invention also provides a network address configuration apparatus, the apparatus including a memory, a processor, and a network address configuration program stored in the memory and executable on the processor, wherein when the network address configuration program is executed by the processor, it implements the steps of the network address configuration method as described above.

[0037] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a network address configuration program, which, when executed by a processor, implements the steps of the network address configuration method described above.

[0038] This invention provides a network address configuration method, a network address configuration device, and a storage medium. After receiving a set of IP addresses to be configured, a target IP address is selected from the set of IP addresses, and a target network interface card (NIC) to be configured is selected from multiple NICs to be configured. The selected target IP address in the target NIC enables the NIC to access the network in a target mode. The target mode and the target IP address are then associated and stored in a connectivity file. The IP address information of the NIC to be configured can be updated based on the content of the connectivity file. Based on this, it is possible to configure and verify network interface IP addresses without manual intervention in unknown scenarios, thereby improving the efficiency of IP address verification. Attached Figure Description

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present invention and, together with the description, serve to explain the principles of the invention. To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0040] Figure 1 This is a flowchart illustrating the first embodiment of the network address configuration method of the present invention;

[0041] Figure 2 This is a schematic diagram of the configuration process of the network address configuration method of the present invention;

[0042] Figure 3 This is a flowchart illustrating a second embodiment of the network address configuration method of the present invention.

[0043] Figure 4 This is another schematic diagram of the configuration process of the network address configuration method of the present invention;

[0044] Figure 5These are schematic diagrams of the terminal hardware structure of various embodiments of the network address configuration method of the present invention.

[0045] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0046] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0047] In related technologies, the current semi-automated IP address configuration mode is based on the association between IP addresses and individual network interface cards (NICs) in the program. It cannot configure other IP addresses for the same NIC, meaning it can only be used for IP address configuration in a single NIC, single IP scenario. In unknown and complex scenarios such as bond mode (binding mode for multiple NICs), manual configuration and verification of the corresponding network interface IP addresses are required, resulting in low IP address verification efficiency.

[0048] To address the aforementioned shortcomings, this invention proposes a method for configuring network addresses, the main solution of which includes the following steps:

[0049] After receiving the set of IP addresses to be configured, select the target IP address and the target network interface card to be configured from the set of IP addresses;

[0050] Determine the target mode corresponding to the target IP address among the target network interface cards to be configured, wherein, under the target mode, the target network interface card to be configured can access the network based on the target IP address;

[0051] The target IP address and the target pattern are associated and stored in a connectivity file;

[0052] The IP address information of the network interface card to be configured is updated based on the connectivity file.

[0053] This invention enables the configuration and verification of network interface IP addresses without manual intervention in unknown scenarios, thereby improving the efficiency of IP address verification.

[0054] To better understand the above technical solutions, exemplary embodiments of this disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of this disclosure to those skilled in the art.

[0055] First Embodiment

[0056] Please refer to Figure 1 The specific steps of the network address configuration method of the present invention include:

[0057] Step S10: After receiving the set of IP addresses to be configured, select the target IP address and the target network interface card to be configured from the set of IP addresses;

[0058] In this embodiment, the set of IP addresses to be configured refers to a batch of IP addresses used for network connection generated by the IP configuration information generation module. Since the set of IP addresses to be configured may contain duplicate IP addresses—that is, IP addresses already used in other network interface cards (NICs)—after receiving the IP addresses to be configured, the IP address pre-check module needs to perform status checks on each IP address in the set, i.e., determine the network configuration status of each IP address. When an IP address is already configured, meaning that a certain IP address cannot be used in the NIC to be configured, in order to avoid IP conflicts, the IP addresses in the already configured state need to be deleted. Based on this, to avoid potential IP conflicts caused by duplicate IP addresses, one IP address needs to be selected as the target IP address based on the IP address numbering order in the set. For example, if the IP address set includes addresses such as "192.168.20.111, 192.199.11.110, 192.209.20.111", etc., the IP addresses are usually sorted from smallest to largest based on their numerical value. Therefore, "192.168.20.111" can be selected as the target IP address. Alternatively, depending on the specific scenario, the IP address with the largest numerical value can be selected as the target IP address.

[0059] In this embodiment, at least two network interface cards (NICs) are to be configured. Therefore, after obtaining the set of IP addresses to be configured and selecting a target IP address from the set, it is necessary to select one NIC from the multiple NICs to be configured as the target NIC. This allows the network address configuration system to sequentially traverse the target IP addresses of the NICs to be configured, thereby determining the IP configuration mode corresponding to the NIC. Specifically, while selecting the IP address with the smallest number from the IP address set as the target IP address according to the IP address numbering order, the target NIC can also be selected based on a preset arrangement of the multiple NICs to be configured. For example, in the network address configuration system, there are three NICs to be configured, A, B, and C, and their corresponding arrangement order in the same display interface is ABC. In this case, NIC A can be selected as the target NIC. Optionally, the target NIC can also be selected based on the numbering order of the NICs to be configured. For example, among NICs A, B, and C, their corresponding numbers are 2, 1, and 3, respectively. In this case, NIC B with the smallest number can be selected as the target NIC. The principle is the same in other cases, so I will not go into too much detail here.

[0060] Step S20: Determine the target mode corresponding to the target IP address in the target network interface card to be configured, wherein, in the target mode, the target network interface card to be configured can access the network based on the target IP address;

[0061] In this embodiment, the target modes include VLAN ID mode, Bond1 mode, Bond4 mode, VLAN ID+Bond1 mode, and VLAN ID+Bond4 mode. The target mode corresponding to the target IP address is determined by using the network interface card (NIC) loop detection module of the network address configuration system to detect the network connectivity status of the target IP address in each IP configuration mode of the target NIC. When the target IP address is in a network connectivity state under a certain corresponding IP configuration mode, that configuration mode is considered the target mode corresponding to the target IP address.

[0062] For example, the target network interface card (NIC) to be configured is NIC A, and the target IP address is "192.168.10.100". In this case, the target mode of NIC A is changed to VLAN ID mode, and the target IP address is used as the configuration IP address for one of the network ports of the target NIC. Then, the ping command (using Packet Internet Groper) is automatically executed on the target IP address to check the network connectivity of the target IP address in VLAN ID mode. If the ping fails in VLAN ID mode, the target mode of NIC A is then switched to bond1 mode, and the same ping command is executed. In other words, when the target NIC cannot access the network using the target IP address in the current target mode, the target mode needs to be switched.

[0063] Optionally, the filtering order of target IP addresses can be selected according to the priority of the target modes, that is, the configuration priority of multiple target modes of the target network interface card to be configured can be determined, and the test mode can be determined based on the configuration priority. Then, the network status of the target IP address in the test mode can be obtained. For example, if the priority of the test modes is vlanid-bond1-bond1+vlanid-bond4-bond4+vlanid, then the vlanid mode is selected as the test mode first. Then, the target network interface card to be configured configures the target IP address in the vlanid mode and executes the ping command. When the ping command result indicates a successful connection, that is, when the target IP address is in a connected state, the mode corresponding to the connected state is determined as the target mode. When the target IP address is not in a connected state, it is necessary to switch to the next test mode for configuration processing. At this time, the priority of the test mode (the currently configured mode) can be reduced, and then the action of determining the test mode based on the configuration priority and obtaining the network status of the target IP address in the test mode is re-executed. The connected state means that the target IP address can access the Internet.

[0064] For example, the priority of the mode under test is vlanid-bond1-bond1+vlanid-bond4-bond4+vlanid. Please refer to [the relevant documentation / reference]. Figure 2After receiving the IP address set and selecting the target IP address, if all IP addresses in the set have not been tested, the VLAN ID mode of the target network interface card (NIC) with an undetermined IP configuration mode is monitored based on the target IP address. If the target IP address is not in a connectivity state under VLAN ID mode, its priority is lowered to the lowest. Then, the bond1 mode is selected as the test mode, and the testing continues. This process is repeated. If the target NIC can access the network using the target IP address under bond1 mode, it indicates that bond1 mode is the target mode corresponding to the target IP address. In this case, no further testing is needed, and the target IP address and its corresponding target mode are recorded in the connectivity file. If the current target IP address is in one of the target NIC's IP configuration modes, and the NIC gateway connectivity is still not connected, the next target NIC will be selected for the same testing process.

[0065] It should be noted that during this process, if the target network interface card (NIC) can access the network based on the target IP address, the corresponding test mode will be used as the target mode. If the NIC cannot access the network under any test mode, it indicates that the current target IP address is not compatible with the NIC. In this case, a new target IP address needs to be selected from the IP address set for network access testing. This process is automatically executed by the NIC loop detection module. The parameters mentioned above are for illustrative purposes only and are not intended to limit the scope of this invention.

[0066] Step S30: Associate and store the target IP address and the target pattern in a connectivity file;

[0067] In this embodiment, the target IP address and the target pattern are only associated and stored in the connectivity file when the target pattern exists. The connectivity file is a temporary file used to store the mapping relationship between the target pattern and the IP address. It should be noted that when the target pattern does not exist, a new target IP address needs to be selected from the IP address set and tested. The tested IP address will be marked as tested and will not be selected again.

[0068] Step S40: Update the IP address information of the target network interface card to be configured based on the connectivity file.

[0069] In this embodiment, an automated configuration script can be used to configure the corresponding IP address information for the target network interface card (NIC). Specifically, the network address configuration system first obtains the population information of the connectivity file, which includes the mapping relationship between the target mode and the target IP address. Then, based on the population information, the system updates the configuration parameters of the automated configuration script under the network address configuration system. Subsequently, the automated configuration script is started, thereby controlling the script to configure the IP address for the target NIC based on the configuration parameters.

[0070] For example, the populated information in the connectivity file is as follows: the target IP address for network card A in bond1 mode is "192.168.99.99", and the corresponding IP address in VLAN ID mode is "192.168.100.100". The target IP address for network card B in VLAN ID mode is "192.168.88.88", and the target IP address for network card C in bond4 mode is "192.168.77.77", etc. The automated configuration script records these configuration parameters and overwrites the original parameters. Subsequently, it configures IP addresses for network card A in bond1+VLAN ID mode, network card B in VLAN ID mode, and network card C in bond4 mode.

[0071] It should be noted that the IP address configuration process can be performed after all IP addresses in the IP address set have completed network connectivity tests under the target network interface card (NIC) to be configured, and then the IP address information of the target NIC to be configured is updated based on the connectivity file. That is, before step S40, it is necessary to obtain the network connectivity status detection information of each IP address in the IP address set under multiple test target modes of the target NIC to be configured. When the network connectivity status detection information of all IP addresses is "detected," then step S40 is executed.

[0072] Alternatively, please continue to refer to Figure 2 In this embodiment, after the automated configuration script updates the IP address information of the target network interface card (NIC), to ensure overall network connectivity, it is necessary to perform IP address connectivity verification on all NICs to be configured, avoiding issues such as duplicate IP addresses and network communication failures. If the IP address connectivity test result for any target NIC fails, an IP address configuration failure message for that NIC is output. Conversely, if the IP address connectivity test results for all NICs to be configured pass, a configuration success message for all NICs to be configured is output. This eliminates the need for manual verification, improving IP verification efficiency.

[0073] In the technical solution disclosed in this embodiment, the network connectivity of the target IP address under the target network interface card (NIC) in VLAN ID mode, Bond1 mode, Bond1+VLAN ID mode, Bond4 mode, and Bond4+VLAN ID mode is traversed to obtain the target mode for the NIC and the target IP address to access the network. The target mode and the target IP address are then associated and stored in a connectivity file. After all IP addresses in the IP address set have been tested, the configuration parameters of the automated configuration script are updated according to the connectivity file. This controls the automated configuration script to update the IP address information for the NIC. The entire process is executed automatically by the network configuration system. Without relying on a DHCP server, dynamic configuration of network addresses is achieved. At the same time, by automating the configuration of IP addresses, manual configuration and verification of IP addresses are avoided, which improves the efficiency of IP address configuration and verification.

[0074] Second Embodiment

[0075] Please refer to Figure 3 In the second embodiment, based on the first embodiment, after step S20, which determines the target mode corresponding to the target IP address in the target network interface card to be configured, the method further includes:

[0076] Step S50: When the target mode does not exist, mark the target IP address in the disconnected state as a blank IP address and delete the blank IP address from the IP address set;

[0077] In this embodiment, if the target mode does not exist, it means that the currently selected target IP address does not match any of the IP configurations of the target network interface card (NIC). This IP address cannot enable the target NIC to access the network. In this case, a new target IP address needs to be selected for testing. Please refer to... Figure 4 To avoid duplicate selection of IP addresses, the target IP address that is in a disconnected state (i.e., the IP address that failed the test) can be marked as a blank IP address, and the blank IP address in the IP address set can be deleted. Then, a new target IP address can be selected for testing.

[0078] Step S60: When the network status detection information of all the IP addresses is detected, if the fill information of the connectivity file is empty, output a prompt message indicating that the network configuration has not been issued.

[0079] In this embodiment, please continue to refer to Figure 4When all IP addresses in the IP address set have been detected and all the padding information in the connectivity file is empty, it means that the network configuration of the switch has not been issued. At this time, a prompt message indicating that the network configuration has not been issued can be output to avoid repeatedly obtaining the IP address set and repeatedly performing invalid IP address detection.

[0080] Optionally, in step S30 of the first embodiment, after storing the target IP address and the target pattern in the connectivity file, to avoid duplicate storage or reuse of already stored IP addresses, the target IP address in the IP address set needs to be deleted. After the deletion operation, if the IP address set is not empty, the target IP address and the target network interface card to be configured are selected from the IP address set. If the IP address set is empty, but the fill information in the connectivity file is not empty, the step of updating the IP address information of the target network interface card to be configured based on the connectivity file is executed. Based on this, the efficiency of IP address processing is improved by determining whether to perform subsequent configuration operations by reducing the number of subsets of the IP address set. It can be understood that the deleted target IP address is the IP address stored in the connectivity file as associated with the target pattern.

[0081] In the technical solution disclosed in this embodiment, when the target mode does not exist, the target IP address corresponding to the IP address set is deleted, or the associated stored target IP address is deleted. Based on this, by deleting the IP address that has been successfully connected or failed to connect, the situation of repeated selection of IP address in the IP address set can be avoided, thereby ensuring the uniqueness of the configured IP address and further improving the verification efficiency of IP address.

[0082] Reference Figure 5 , Figure 5 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of the present invention.

[0083] like Figure 5 As shown, the terminal may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a network interface 1003, and a memory 1004. The communication bus 1002 is used to enable communication between these components. The network interface 1003 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1004 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. Alternatively, the memory 1004 may be a storage device independent of the aforementioned processor 1001.

[0084] Those skilled in the art will understand that Figure 5 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0085] like Figure 5 As shown, the memory 1004, which serves as a computer storage medium, may include an operating system, a data storage module, a network communication module, and a network address configuration program.

[0086] exist Figure 5 In the terminal shown, network interface 1003 is mainly used to connect to the backend server and communicate with it; processor 1001 can call the network address configuration program stored in memory 1004 and perform the following operations:

[0087] After receiving the set of IP addresses to be configured, select the target IP address and the target network interface card to be configured from the set of IP addresses;

[0088] Determine the target mode corresponding to the target IP address among the target network interface cards to be configured, wherein, under the target mode, the target network interface card to be configured can access the network based on the target IP address;

[0089] The target IP address and the target pattern are associated and stored in a connectivity file;

[0090] The IP address information of the target network interface card to be configured is updated based on the connectivity file.

[0091] Furthermore, the processor 1001 can call the network address configuration program stored in the memory 1004 and also perform the following operations:

[0092] Obtain the fill information of the connected file, and update the configuration parameters of the automated configuration script based on the fill information;

[0093] The automated configuration script is started, and an IP address is configured for the target network interface card based on the configuration parameters.

[0094] Furthermore, the processor 1001 can call the network address configuration program stored in the memory 1004 and also perform the following operations:

[0095] Obtain the network status detection information of each IP address in the set of IP addresses under multiple target modes of the target network card to be configured;

[0096] When the network status detection information of all the IP addresses is detected, the step of updating the IP address information of the target network card to be configured based on the connectivity file is executed.

[0097] Furthermore, the processor 1001 can call the network address configuration program stored in the memory 1004 and also perform the following operations:

[0098] Upon receiving the set of IP addresses to be configured, the network configuration status of each IP address is determined;

[0099] If any of the IP addresses are in a configured state, delete the IP addresses in the configured state from the set of IP addresses.

[0100] The IP address with the smallest number in the IP address set is selected as the target IP address based on the order of IP address numbers. At the same time, the target network card to be configured is selected based on the arrangement information of multiple network cards to be configured, or the preset network card number information.

[0101] Furthermore, the processor 1001 can call the network address configuration program stored in the memory 1004 and also perform the following operations:

[0102] Determine the configuration priority of multiple target modes for the target network interface card to be configured;

[0103] The test mode is determined based on the configuration priority, and the network status of the target IP address in the test mode is obtained;

[0104] When the target IP address is in a connected state, the mode to be tested is determined to be the target mode; or

[0105] When the target IP address is not in a connected state, the priority of the target mode is reduced, and the process jumps to the step of determining the test mode based on the configuration priority and obtaining the network status of the target IP address in the test mode.

[0106] Furthermore, the processor 1001 can call the network address configuration program stored in the memory 1004 and also perform the following operations:

[0107] When the target pattern does not exist, the target IP address that is in a disconnected state is marked as a blank IP address, and the blank IP address is deleted from the IP address set;

[0108] When the network status detection information for all the IP addresses is detected, if the fill information of the connectivity file is empty, output a prompt message indicating that the network configuration has not been issued.

[0109] Furthermore, the processor 1001 can call the network address configuration program stored in the memory 1004 and also perform the following operations:

[0110] Delete the target IP address from the set of IP addresses;

[0111] When the IP address set is not empty, proceed to the steps of selecting the target IP address from the IP address set and selecting the target network interface card to be configured; or

[0112] When the IP address set is empty and the connectivity file is not empty, the step of updating the IP address information of the target network interface card to be configured based on the connectivity file is executed.

[0113] Furthermore, the processor 1001 can call the network address configuration program stored in the memory 1004 and also perform the following operations:

[0114] Perform IP address connectivity checks on all network cards to be configured;

[0115] If the IP address connectivity test result for the target network interface card to be configured is unsuccessful, output the IP address configuration failure message for the target network interface card;

[0116] When the IP address connectivity test results for all the network interfaces to be configured are successful, output a message indicating that all the network interfaces to be configured have been successfully configured.

[0117] Furthermore, those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the control terminal to implement the process steps of the embodiments of the above methods.

[0118] Therefore, the present invention also provides a computer-readable storage medium storing a network address configuration program, which, when executed by a processor, implements the various steps of the network address configuration method as described in the above embodiments.

[0119] It should be noted that, since the storage medium provided in the embodiments of this application is the storage medium used to implement the methods of the embodiments of this application, those skilled in the art can understand the specific structure and variations of the storage medium based on the methods described in the embodiments of this application, and therefore will not be repeated here. All storage media used in the methods of the embodiments of this application fall within the scope of protection of this application.

[0120] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0121] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0122] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0123] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0124] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0125] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0126] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

[0127] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for configuring a network address, characterized in that, The method for configuring the network address includes: After receiving the set of IP addresses to be configured, select the target IP address and the target network interface card to be configured from the set of IP addresses; Determine the target mode corresponding to the target IP address among the target network interface cards to be configured, wherein, under the target mode, the target network interface card to be configured can access the network based on the target IP address. This includes determining the configuration priority of multiple target modes of the target network interface card to be configured; determining a test mode based on the configuration priority; obtaining the network connection status of the target IP address under the test mode; when the target IP address is in a connected state, determining the test mode as the target mode; or when the target IP address is not in a connected state, lowering the priority of the target mode, and jumping to the steps of determining the test mode based on the configuration priority and obtaining the network connection status of the target IP address under the test mode. The target IP address and the target pattern are associated and stored in a connectivity file; The IP address information of the target network interface card to be configured is updated based on the connectivity file.

2. The network address configuration method as described in claim 1, characterized in that, The step of updating the IP address information of the target network interface card to be configured based on the connectivity file includes: Obtain the fill information of the connected file, and update the configuration parameters of the automated configuration script based on the fill information; The automated configuration script is started, and an IP address is configured for the target network interface card based on the configuration parameters.

3. The network address configuration method as described in claim 1, characterized in that, Before the step of updating the IP address information of the target network interface card to be configured based on the connectivity file, the method further includes: Obtain the network status detection information of each IP address in the set of IP addresses under multiple target modes of the target network card to be configured; When the network status detection information of all the IP addresses is detected, the step of updating the IP address information of the target network card to be configured based on the connectivity file is executed.

4. The network address configuration method as described in claim 1, characterized in that, The steps of selecting a target IP address and a target network interface card (NIC) from the set of IP addresses to be configured after receiving the set of IP addresses to be configured include: Upon receiving the set of IP addresses to be configured, the network configuration status of each IP address is determined; If any of the IP addresses are in a configured state, delete the IP addresses in the configured state from the set of IP addresses. The IP address with the smallest number in the IP address set is selected as the target IP address based on the order of IP address numbers. At the same time, the target network card to be configured is selected based on the arrangement information of multiple network cards to be configured, or the preset network card number information.

5. The network address configuration method as described in claim 1, characterized in that, After determining the target mode corresponding to the target IP address in the target network interface card to be configured, wherein the target network interface card to be configured can access the network based on the target IP address under the target mode, the method further includes: When the target pattern does not exist, the target IP address that is in a disconnected state is marked as a blank IP address, and the blank IP address is deleted from the IP address set; When the network status detection information of all the IP addresses is detected, if the fill information of the connectivity file is empty, output a prompt message indicating that the network configuration has not been issued.

6. The network address configuration method as described in claim 1, characterized in that, After the step of associating and storing the target IP address and the target pattern in the connectivity file, the method further includes: Delete the target IP address from the set of IP addresses; When the IP address set is not empty, proceed to the steps of selecting the target IP address from the IP address set and selecting the target network interface card to be configured; or When the IP address set is empty and the connectivity file is not empty, the step of updating the IP address information of the target network interface card to be configured based on the connectivity file is executed.

7. The network address configuration method as described in claim 1, characterized in that, After the step of updating the IP address information of the target network interface card to be configured based on the connectivity file, the method further includes: Perform IP address connectivity checks on all network cards to be configured; If the IP address connectivity test result for the target network interface card to be configured is unsuccessful, output the IP address configuration failure message for the target network interface card; When the IP address connectivity test results for all the network interfaces to be configured are successful, output a message indicating that all the network interfaces to be configured have been successfully configured.

8. A network address configuration device, characterized in that, The apparatus includes: a memory, a processor, and a network address configuration program stored in the memory and executable on the processor, wherein when executed by the processor, the network address configuration program implements the steps of the network address configuration method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a network address configuration program, which, when executed by a processor, implements the steps of the network address configuration method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for automatic IP address information configuration by multi-network card server

    CN107592209A

  • Network automatic configuration method, device and system, storage medium and target computer

    CN108039969A