IP address allocation method, binding method, device, equipment and medium
By generating a mapping between identification information and IP address based on the device's location and switch connection information, and combining this with a DHCP server to allocate dynamic IP addresses, the problem of automating device and IP address binding in existing technologies is solved, achieving a one-to-one correspondence and automated binding between devices and IP addresses.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE COMM LTD RES INST
- Filing Date
- 2023-07-21
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, DHCP-based IP address allocation cannot achieve an accurate mapping between servers and IP addresses, requiring manual intervention and failing to automatically bind devices to IP addresses.
Based on the device's location information and switch connection information, a mapping relationship between the device's identification information and IP address in the out-of-band network is generated. Combined with the identification information in the in-band network, a static IP address is determined, and a dynamic IP address is assigned and bound via a DHCP server.
It achieves a one-to-one correspondence between devices and IP addresses, automates the allocation and binding of static IP addresses, and reduces manual intervention.
Smart Images

Figure CN116915747B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technology, specifically relating to an IP address allocation method, binding method, device, equipment, and medium. Background Technology
[0002] In the field of computer technology, the most basic step in using a bare-metal server is to complete the operating system installation and assign IP addresses to achieve device reachability. A Preboot Execute Environment (PXE) can be used for unattended system installation scenarios. After system installation is complete, PXE's built-in Dynamic Host Configuration Protocol (DHCP) service assigns a dynamic IP address to each client, thus achieving device reachability.
[0003] Current technical solutions use DHCP to dynamically allocate IP addresses to the operating system. This automatic allocation method is done in batches and automatically, and cannot obtain an accurate correspondence between servers and IP addresses. It is necessary to manually log in to the operating system of a specified server and modify it to a specified IP address in order to achieve a one-to-one correspondence between servers and IP addresses. Summary of the Invention
[0004] This application provides an IP address allocation method, binding method, apparatus, device, and medium to solve the problem of not being able to automatically bind devices and IP addresses.
[0005] Firstly, an IP address allocation method is provided, applied to an IP address allocation device, comprising:
[0006] Assign an IP address to each device based on its location information and / or its switch connection information;
[0007] Based on the first identification information of each device in the out-of-band network and the IP address of each device, generate the first correspondence information between the first identification information of the device in the out-of-band network and the IP address;
[0008] The first correspondence information is sent to the target device. The first correspondence information is used to determine the static IP address of the target device by combining the second identification information of the target device in the in-band network, so as to obtain the second correspondence information between the target device and the static IP address.
[0009] Optionally, sending the first correspondence information to the target device includes:
[0010] Obtain the dynamic IP address assigned to the target device by the Dynamic Host Configuration Protocol (DHCP) server;
[0011] The first correspondence information is sent to the target device via the dynamic IP address.
[0012] Optionally, obtaining the dynamic IP address assigned to the target device by the DHCP server includes:
[0013] Obtain the first IP address of the target device when the operating system is installed and the third identification information of the device corresponding to the first IP address;
[0014] Based on the first correspondence information, a first identification information related to the third identification information is determined as the unique identification information of the target device;
[0015] Obtain the second IP address in the in-band network assigned by the DHCP server to the operating system of each device, and the fourth identification information of the device corresponding to the second IP address;
[0016] The unique identifier information is compared with the fourth identifier information, and the target IP address is determined to be the dynamic IP address assigned to the target device by the DHCP server. The target IP address is the second IP address corresponding to the fourth identifier information related to the unique identifier information.
[0017] Optionally, the method further includes:
[0018] The device's first identification information in the out-of-band network is obtained through the out-of-band management interface. The first identification information includes at least one of the following: device serial number, motherboard serial number, and media access control MAC address.
[0019] Secondly, an IP address binding method is provided, applied to a target device, including:
[0020] Obtain first correspondence information between first identification information and IP address of at least some devices in the out-of-band network, and second identification information of the target device in the in-band network;
[0021] The first correspondence information is compared with the second identification information of the target device in the in-band network, and the IP address corresponding to the first identification information related to the second identification information is determined as the static IP address of the target device.
[0022] Establish a second correspondence between the target device and the static IP address.
[0023] Optionally, obtain at least some of the devices' first identification information and first correspondence information with their IP addresses in the out-of-band network, including:
[0024] The power-on self-test (POST) process of the pre-boot execution environment PXE server is used to obtain the first correspondence information between the first identification information and the first IP address of at least some devices in the out-of-band network.
[0025] or,
[0026] The device receives at least a portion of the device's first identification information and first correspondence information between the device's IP address and its dynamic IP address in an out-of-band network, sent by the IP address allocation device through the dynamic IP address of the target device, wherein the dynamic IP address is allocated by a DHCP server.
[0027] Thirdly, an IP address allocation device is provided, comprising:
[0028] The allocation module is used to allocate an IP address to each device based on the device's location information and / or the device's switch connection information;
[0029] The generation module is used to generate a first correspondence information between the first identification information and the IP address of each device in the out-of-band network, based on the first identification information of each device in the out-of-band network and the IP address of each device.
[0030] The sending module is used to send the first correspondence information to the target device. The first correspondence information is used to determine the static IP address of the target device by combining the second identification information of the target device in the in-band network, so as to obtain the second correspondence information between the target device and the static IP address.
[0031] Fourthly, an IP address binding device is provided, comprising:
[0032] The second acquisition module is used to acquire first correspondence information between first identification information and IP address of at least some devices in the out-of-band network, and second identification information of the target device in the in-band network;
[0033] The determining module is used to compare the first correspondence information with the second identification information of the target device in the in-band network, and determine the IP address corresponding to the first identification information related to the second identification information as the static IP address of the target device;
[0034] The binding module is used to establish a second correspondence between the target device and the static IP address.
[0035] Fifthly, a communication device is provided, comprising: a memory, a transceiver, and a processor; wherein the memory is used to store a computer program; and the processor is used to implement the steps of the method as described in the first or second aspect.
[0036] A sixth aspect provides a processor-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method as described in the first or second aspect.
[0037] In this embodiment, an IP address is assigned to each device based on its location information and / or its switch connection information; a first correspondence between the first identification information and the IP address of each device in the out-of-band network is generated based on the first identification information of each device in the out-of-band network and the IP address of each device; the first correspondence is sent to the target device, and the first correspondence is used to determine the static IP address of the target device by combining it with the second identification information of the target device in the in-band network, so as to obtain the second correspondence between the target device and the static IP address, thereby binding the target device and the static IP address. Attached Figure Description
[0038] Figure 1 This is one of the flowcharts of the IP address allocation method provided in the embodiments of this application;
[0039] Figure 2 This is the second flowchart of the IP address binding method provided in the embodiments of this application;
[0040] Figure 3 This is a flowchart of the IP address allocation and binding method provided in the embodiments of this application;
[0041] Figure 4 This is a network topology diagram provided in an embodiment of this application;
[0042] Figure 5 A schematic diagram of the IP address allocation device provided in the embodiments of this application;
[0043] Figure 6 A schematic diagram of the IP address binding device provided in the embodiments of this application;
[0044] Figure 7 This is a schematic diagram of the communication device provided in this embodiment. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0046] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited in number; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0047] See Figure 1 The embodiments of this application provide an IP address allocation method, which is applied to an IP address allocation device, and the specific steps include: step 101, step 102 and step 103.
[0048] Step 101: Assign an IP address to each device based on its location information and / or its switch connection information;
[0049] The device in this embodiment can also be called a PXE client, and the IP address can be a static IP address.
[0050] Step 102: Based on the first identification information of each device in the out-of-band network and the IP address of each device, generate the first correspondence information between the first identification information of the device in the out-of-band network and the IP address;
[0051] In this embodiment, the identification information includes at least one of the following: device serial number, motherboard serial number, and MAC address.
[0052] If the identification information is a MAC address, then in step 102, a first correspondence information between the MAC address and IP address of the target device is generated. This first correspondence information may be a first MAC-IP list.
[0053] Step 103: Send the first correspondence information to the target device. The first correspondence information is used to determine the static IP address of the target device by combining the identification information of the target device in the in-band network, so as to obtain the second correspondence between the target device and the static IP address.
[0054] That is, the IP address allocation device sends the first correspondence (e.g., the first MAC-IP list) to the target device, the target device's operating system determines the target device's static IP address based on the first correspondence and the target device's identification information in the in-band network, and the target device's operating system binds the target device to the static IP address.
[0055] In this embodiment, the binding of the target device to a static IP address is completed by using the relevant information of the target device in the in-band network and out-of-band network, which can achieve a one-to-one correspondence between the device and the IP address.
[0056] In one embodiment of this application, sending the first correspondence to the target device includes:
[0057] Obtain the dynamic IP address assigned to the target device by the DHCP server;
[0058] The first correspondence is sent to the target device via the dynamic IP address.
[0059] The aforementioned dynamic IP address can also be called a temporary IP address.
[0060] In one embodiment of this application, obtaining the dynamic IP address assigned to the target device by the DHCP server includes:
[0061] Obtain the first IP address of the target device when the operating system is installed and the third identification information of the device corresponding to the first IP address;
[0062] Based on the first correspondence information, a first identification information related to the third identification information is determined as the unique identification information of the target device;
[0063] Obtain the second IP address in the in-band network assigned by the DHCP server to the operating system of each device, and the fourth identification information of the device corresponding to the second IP address;
[0064] The unique identifier information is compared with the fourth identifier information, and the target IP address is determined to be the dynamic IP address assigned to the target device by the DHCP server. The target IP address is the second IP address corresponding to the fourth identifier information related to the unique identifier information.
[0065] For example, obtain the first IP address of the target device when the operating system is installed and the MAC address corresponding to the first IP address, generate a second MAC-IP list, compare the second MAC-IP list with the first MAC-IP list, and use a MAC address of the target device (first identification information) as the unique identification information of the target device.
[0066] It should be noted that the first IP address and the second IP address can be the same, or they can be different.
[0067] Optionally, after the operating system installation on one or more devices is completed, the step of obtaining the second IP address in the in-band network assigned by the DHCP server to the operating system of each device and the fourth identification information of the device corresponding to the second IP address is executed. It is understood that this embodiment performs initial IP address configuration after the operating system is installed.
[0068] In one embodiment of this application, prior to step 102, the method further includes:
[0069] The device's first identification information in the out-of-band network is obtained through the out-of-band management interface. The first identification information includes at least one of the following: device serial number, motherboard serial number, and MAC address.
[0070] For example, the number of devices can be n. The MAC address of the network card of device 1 can include MAC_1-1, MAC_1-2, ..., MAC_1-m, and the MAC address of the network card of device n can include MAC_n-1, MAC_n-2, ..., MAC_n-m, where m is the number of network cards.
[0071] In this embodiment, an IP address is assigned to each device based on its location information and / or its switch connection information; a first correspondence between the first identification information and the IP address of each device in the out-of-band network is generated based on the first identification information of each device in the out-of-band network and the IP address of each device; the first correspondence is sent to the target device, and the first correspondence is used to determine the static IP address of the target device by combining it with the second identification information of the target device in the in-band network, so as to obtain the second correspondence between the target device and the static IP address, thereby binding the target device and the static IP address.
[0072] See Figure 2 The embodiments of this application provide an IP address binding method applied to a target device, the specific steps of which include:
[0073] Step 201: Obtain the first correspondence information between the identification information and IP address of at least some devices in the out-of-band network, wherein the IP address is related to the device's location information and / or the device's switch connection information;
[0074] Step 202: Compare the first correspondence information with the second identification information of the target device in the in-band network, and determine the IP address corresponding to the first identification information related to the second identification information as the static IP address of the target device;
[0075] Step 203: Establish a second correspondence between the target device and the static IP address.
[0076] Optionally, the target device's operating system uses scripts or commands to perform static IP address binding based on the first correspondence information and the target device's second identification information in the in-band network.
[0077] In one embodiment of this application, obtaining a first correspondence between the identification information and IP address of at least some devices in an out-of-band network includes:
[0078] The PXE server's POST process is used to obtain at least some of the devices' out-of-band network identification information and the first correspondence between their IP addresses.
[0079] or,
[0080] The device receives a first correspondence information between the identification information of at least a portion of the devices in the out-of-band network and the IP address sent by the IP address allocation device via a dynamic IP address, wherein the dynamic IP address is allocated by a DHCP server.
[0081] In this embodiment, a first correspondence between first identification information and IP address of at least some devices in an out-of-band network is obtained, wherein the IP address is related to the device's location information and / or the device's switch connection information; the first correspondence is compared with the second identification information of the target device in an in-band network, and the IP address corresponding to the first identification information related to the second identification information is determined as the static IP address of the target device; a second correspondence is established between the target device and the static IP address to achieve binding between the target device and the static IP address.
[0082] See Figure 3 This embodiment provides an IP address allocation and binding process, with the following specific steps:
[0083] Step 301: Obtain the first identification information of the device in the out-of-band network;
[0084] For example, the first identification information of a device in an external network can be obtained through an out-of-band management interface. The list of first identification information includes at least one of the following: device serial number, motherboard serial number, and MAC address.
[0085] For example, the number of devices can be n. The MAC address of the network card of device 1 can include MAC_1-1, MAC_1-2, ..., MAC_1-m, and the MAC address of the network card of device n can include MAC_n-1, MAC_n-2, ..., MAC_n-m, where m is the number of network cards.
[0086] Step 302: Assign an IP address to each device based on at least one of the device's location information and the device's switch connection information, and generate a first correspondence between the device's first identification information and the IP address based on the device's identification information list and the IP address;
[0087] It is understandable that the first correspondence information records the correspondence between the first identifier information and the IP address.
[0088] For example, the network configuration of device 1 is performed based on at least one of the first identification information list of device 1, the location information of device 1, and the switch connection information of device 1.
[0089] Step 303: Install the operating system on n devices via the PXE server;
[0090] Step 304: Obtain the first IP address (temporary IP1) of the target device and the third identification information of the device corresponding to the first IP address when installing the operating system;
[0091] For example, device 1 can send a request to the PXE server through a certain port, and the request can carry the device's third identification information (such as a second MAC address).
[0092] Step 305: Compare the third identification information with the first correspondence information, and determine a first identification information related to the third identification information as the unique identification information of the target device;
[0093] For example, a MAC address of the target device can be used as the unique identifier of the target device.
[0094] Step 306: Determine if the operating system installation is complete;
[0095] Step 307: After the operating system installation is complete, obtain the second IP address (temporary IP2) and the corresponding fourth identification information (e.g., the first MAC address) in the in-band network assigned by the DHCP server to the operating system of each device.
[0096] The second IP address mentioned above can be the same as the first IP address, or it can be different.
[0097] It is understandable that PXE servers and DHCP servers can be configured together, meaning they can be on the same server, or they can be configured independently.
[0098] For example, a device can send a request to a DHCP server, which can include the device's first MAC address.
[0099] Step 308: Compare the unique identifier information of the target device with the second IP address and the fourth identifier information of the device corresponding to the second IP address, and determine the target IP address as the dynamic IP address assigned to the target device by the DHCP server. The target IP address is the second IP address corresponding to the fourth identifier information related to the unique identifier information.
[0100] For example, the target device's dynamic IP address (or temporary IP address) is the second IP address.
[0101] Step 309: Send the first mapping relationship to the target device based on the target device's dynamic IP address;
[0102] Step 310: Obtain the second identification information of the target device in the in-band network through the operating system;
[0103] Step 311: Compare the first correspondence information with the second identification information of the target device in the in-band network, determine the IP address corresponding to the first identification information related to the second identification information as the static IP address of the target device, and establish the second correspondence information between the target device and the static IP address.
[0104] For example, the target device's operating system obtains the target device's second identification information in the in-band network, and uses a script or command to complete the static IP binding based on the target device's first correspondence information.
[0105] See Figure 4 This application provides a network topology diagram, which includes: an IP address allocation device, a control module, and a PXE server. The IP address allocation device is used to allocate an IP address to each device based on the device's location information and / or the device's switch connection information; generate a first correspondence between the first identification information of each device in the out-of-band network and the IP address of each device based on the first identification information of each device in the out-of-band network and the IP address of each device; send the first correspondence information to a target device, wherein the first correspondence information is used to determine the static IP address of the target device in combination with the identification information of the target device in the in-band network, so as to obtain a second correspondence between the target device and the static IP address; the control module is responsible for configuration, and the control module and the IP address allocation device can be set together or set separately; the PXE server and / or DHCP server are responsible for initial DHCP allocation, providing system image files, etc.
[0106] See Figure 5 Embodiments of this application provide an IP address allocation device, the device 500 comprising:
[0107] The allocation module 501 is used to allocate an IP address to each device based on the device's location information and / or the device's switch connection information;
[0108] The generation module 502 is used to generate a first correspondence relationship between the first identification information of each device in the out-of-band network and the IP address of each device, based on the first identification information of each device in the out-of-band network and the IP address of each device.
[0109] The sending module 503 is used to send the first correspondence information to the target device. The first correspondence information is used to determine the static IP address of the target device by combining the second identification information of the target device in the in-band network, so as to obtain the second correspondence information between the target device and the static IP address.
[0110] In one embodiment of this application, the sending module 503 includes:
[0111] The acquisition unit is used to acquire the dynamic IP address assigned to the target device by the DHCP server;
[0112] The sending unit is used to send the first correspondence information between the identification information list and the IP address to the target device through the dynamic IP address.
[0113] In one embodiment of this application, the acquisition unit is further configured to:
[0114] Obtain the first IP address of the target device when the operating system is installed and the third identification information of the device corresponding to the first IP address;
[0115] Based on the first correspondence information, a first identification information related to the third identification information is determined as the unique identification information of the target device;
[0116] Obtain the second IP address in the in-band network assigned by the DHCP server to the operating system of each device, and the fourth identification information of the device corresponding to the second IP address;
[0117] The unique identifier information is compared with the fourth identifier information, and the target IP address is determined to be the dynamic IP address assigned to the target device by the DHCP server. The target IP address is the second IP address corresponding to the fourth identifier information related to the unique identifier information.
[0118] In one embodiment of this application, the apparatus further includes:
[0119] The first acquisition module is used to acquire the first identification information of the device in the out-of-band network through the out-of-band management interface. The first identification information includes at least one of the following: device serial number, motherboard serial number, and media access control MAC address.
[0120] In the embodiments of this application, the device is capable of implementing this application. Figure 1 The various processes implemented in the method embodiments shown, and the same beneficial effects achieved, will not be described again here to avoid repetition.
[0121] See Figure 6 Embodiments of this application provide an IP address binding device, device 600 including:
[0122] The second acquisition module 601 is used to acquire first correspondence information between first identification information and IP address of at least some devices in the out-of-band network, and second identification information of the target device in the in-band network;
[0123] The determining module 602 is used to compare the first correspondence information with the second identification information of the target device in the in-band network, and determine the IP address corresponding to the first identification information related to the second identification information as the static IP address of the target device;
[0124] The binding module 603 is used to establish a second correspondence between the target device and the static IP address.
[0125] In one embodiment of this application, the second acquisition module 601 is further configured to:
[0126] The power-on self-test (POST) process of the pre-boot execution environment PXE server is used to obtain the first correspondence information between the first identification information and the first IP address of at least some devices in the out-of-band network.
[0127] or,
[0128] The device receives at least a portion of the device's first identification information and first correspondence information between the device's IP address and its dynamic IP address in an out-of-band network, sent by the IP address allocation device through the dynamic IP address of the target device, wherein the dynamic IP address is allocated by a DHCP server.
[0129] In the embodiments of this application, the device is capable of implementing this application. Figure 2 The various processes implemented in the method embodiments shown, and the same beneficial effects achieved, will not be described again here to avoid repetition.
[0130] It should be noted that the module division in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional units.
[0131] If the integrated module is implemented as a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0132] like Figure 7 As shown, an embodiment of the present invention also provides a communication device, including: a memory 720, a transceiver 700, and a processor 710; wherein, the memory 700 is used to store a computer program; and the processor 710 is used to read the computer program in the memory.
[0133] Among them, Figure 7 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 710) and memory (memory 720). The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 700 can be multiple elements, including transmitters and transceivers, providing a unit for communicating with various other devices over a transmission medium. The processor 710 is responsible for managing the bus architecture and general processing, and the memory 720 can store data used by the processor 710 during operation.
[0134] The processor 710 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a complex programmable logic device (CPLD). The processor can also adopt a multi-core architecture.
[0135] It should be noted that the communication device provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.
[0136] In addition, specific embodiments of the present invention also provide a processor-readable storage medium storing a computer program thereon. When executed by a processor, this program implements the steps of the configuration method described above and achieves the same technical effect; therefore, to avoid repetition, it will not be described again here. The readable storage medium can be any available medium or data storage device accessible to the processor, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs), etc.).
[0137] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0138] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-executable instructions. These computer-executable 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, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0139] These processor-executable instructions may also be stored in a processor-readable memory that can instruct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the processor-readable memory produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more blocks of a block diagram.
[0140] These processor-executable instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of a block diagram.
[0141] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. An IP address allocation method, applied to an IP address allocation device, characterized in that, include: Assign an IP address to each device based on its location information and / or its switch connection information; Based on the first identification information of each device in the out-of-band network and the IP address of each device, generate the first correspondence information between the first identification information of the device in the out-of-band network and the IP address; Send the first correspondence information to the target device. The first correspondence information is used to determine the static IP address of the target device by combining the second identification information of the target device in the in-band network, so as to obtain the second correspondence information between the target device and the static IP address. Sending the first correspondence information to the target device includes: Obtain the dynamic IP address assigned to the target device by the Dynamic Host Configuration Protocol (DHCP) server; The first correspondence information is sent to the target device via the dynamic IP address; Obtaining the dynamic IP address assigned to the target device by the DHCP server includes: Obtain the first IP address of the target device when the operating system is installed and the third identification information of the device corresponding to the first IP address; Based on the first correspondence information, a first identification information related to the third identification information is determined as the unique identification information of the target device; Obtain the second IP address in the in-band network assigned by the DHCP server to the operating system of each device, and the fourth identification information of the device corresponding to the second IP address; The unique identifier information is compared with the fourth identifier information, and the target IP address is determined to be the dynamic IP address assigned to the target device by the DHCP server. The target IP address is the second IP address corresponding to the fourth identifier information related to the unique identifier information.
2. The method according to claim 1, characterized in that, The method further includes: The device's first identification information in the out-of-band network is obtained through the out-of-band management interface. The first identification information includes at least one of the following: device serial number, motherboard serial number, and media access control MAC address.
3. An IP address binding method, applied to a target device, characterized in that, include: Obtain first correspondence information between first identification information and IP address of at least some devices in the out-of-band network, and second identification information of the target device in the in-band network; The first correspondence information is compared with the second identification information of the target device in the in-band network, and the IP address corresponding to the first identification information related to the second identification information is determined as the static IP address of the target device. Establish a second correspondence between the target device and the static IP address; Wherein, the first correspondence information is sent by the IP address allocation device to the target device through a dynamic IP address. The dynamic IP address is obtained by the IP address allocation device in the following manner: obtaining the first IP address of the target device when the operating system is installed and the third identification information of the device corresponding to the first IP address; based on the first correspondence information, determining a first identification information related to the third identification information as the unique identification information of the target device; obtaining the second IP address in the in-band network allocated by the DHCP server to the operating system of each device and the fourth identification information of the device corresponding to the second IP address; comparing the unique identification information with the fourth identification information, and determining the target IP address as the dynamic IP address allocated by the DHCP server to the target device, wherein the target IP address is the second IP address corresponding to the fourth identification information related to the unique identification information.
4. The method according to claim 3, characterized in that, Obtain the first correspondence information between the first identification information and the first IP address of at least some devices in the out-of-band network, including: The power-on self-test (POST) process of the pre-boot execution environment PXE server is used to obtain the first correspondence information between the first identification information and the first IP address of at least some devices in the out-of-band network. or, The device receives at least a portion of the device's first identification information and first correspondence information between the device's IP address and its dynamic IP address, which is sent by the IP address allocation device through the dynamic IP address of the target device. The dynamic IP address is allocated by a DHCP server.
5. An IP address allocation device, characterized in that, include: The allocation module is used to allocate an IP address to each device based on the device's location information and / or the device's switch connection information; The generation module is used to generate a first correspondence information between the first identification information and the IP address of each device in the out-of-band network, based on the first identification information of each device in the out-of-band network and the IP address of each device. The sending module is used to send the first correspondence information to the target device. The first correspondence information is used to determine the static IP address of the target device by combining the second identification information of the target device in the in-band network, so as to obtain the second correspondence information between the target device and the static IP address. Sending the first correspondence information to the target device includes: Obtain the dynamic IP address assigned to the target device by the Dynamic Host Configuration Protocol (DHCP) server; The first correspondence information is sent to the target device via the dynamic IP address; Obtaining the dynamic IP address assigned to the target device by the DHCP server includes: Obtain the first IP address of the target device when the operating system is installed and the third identification information of the device corresponding to the first IP address; Based on the first correspondence information, a first identification information related to the third identification information is determined as the unique identification information of the target device; Obtain the second IP address in the in-band network assigned by the DHCP server to the operating system of each device, and the fourth identification information of the device corresponding to the second IP address; The unique identifier information is compared with the fourth identifier information, and the target IP address is determined to be the dynamic IP address assigned to the target device by the DHCP server. The target IP address is the second IP address corresponding to the fourth identifier information related to the unique identifier information.
6. An IP address binding device, characterized in that, include: The second acquisition module is used to acquire first correspondence information between first identification information and IP address of at least some devices in the out-of-band network, and second identification information of the target device in the in-band network; The determining module is used to compare the first correspondence information with the second identification information of the target device in the in-band network, and determine the IP address corresponding to the first identification information related to the second identification information as the static IP address of the target device; A binding module is used to establish a second correspondence between the target device and the static IP address; Wherein, the first correspondence information is sent by the IP address allocation device to the target device through a dynamic IP address. The dynamic IP address is obtained by the IP address allocation device in the following manner: obtaining the first IP address of the target device when the operating system is installed and the third identification information of the device corresponding to the first IP address; based on the first correspondence information, determining a first identification information related to the third identification information as the unique identification information of the target device; obtaining the second IP address in the in-band network allocated by the DHCP server to the operating system of each device and the fourth identification information of the device corresponding to the second IP address; comparing the unique identification information with the fourth identification information, and determining the target IP address as the dynamic IP address allocated by the DHCP server to the target device, wherein the target IP address is the second IP address corresponding to the fourth identification information related to the unique identification information.
7. A communication device, characterized in that, include: The device includes a memory, a transceiver, and a processor; wherein the memory is used to store a computer program; and the processor is used to implement the steps of the method as described in any one of claims 1 to 4.
8. A processor-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Static IP configuration method, device and equipment and readable storage medium
CN108810192A