An IPv6 address configuration method, server and storage medium

By parsing DHCPv6 request messages to determine the virtual machine image type and assigning DUID and IAID, the unreliable IPv6 address allocation problem in data centers and cloud platforms is solved, address binding and control are implemented, and configuration complexity and cost are reduced.

CN119743464BActive Publication Date: 2025-10-10MAIPU COMM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411859749.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-10-10
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

In data centers or cloud platforms, allocating IPv6 addresses based on the DUID and IAID in DHCPv6 request messages is unreliable, leading to address duplication and conflicts. Furthermore, it is difficult to set the IPv6 address required by users based on the DUID and IAID binding.

Method used

By parsing the vendor type option, DUID type option, and custom option in the DHCPv6 request message, the virtual machine image type is determined and an IPv6 address is allocated based on this type. Combined with the collaboration between the virtual machine configuration server and the DHCPv6 server, a unique DUID and IAID are allocated to ensure address binding.

Benefits of technology

It achieves reliability and controllability of IPv6 address allocation, avoids address conflicts, complies with DHCPv6 protocol specifications, and reduces configuration complexity and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743464B_ABST
    Figure CN119743464B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of IPv6 address configuration method, server and storage medium, it is related to network communication technical field, by virtual machine configuration server, DUID and IAID distributed by DHCPv6 server are configured to virtual machine instance, to make virtual machine instance obtains the IPv6 address of external communication according to the DUID and IAID.It is determined that the method includes: the virtual machine image type to which virtual machine instance belongs;Based on virtual machine image type, according to the address allocation rule set, first IPv6 address is allocated for virtual machine instance, to make virtual machine instance establish connection based on first IPv6 address with virtual machine configuration server;Request message sent by virtual machine configuration server is received, and based on request message, second IPv6 address pre-allocated is determined, and DUID and IAID are distributed, to make virtual machine instance request second IPv6 address according to the DUID and the IAID.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and more specifically, to an IPv6 address configuration method, a server, and a storage medium. Background Art

[0002] DHCPv6 (Dynamic Host Configuration Protocol for IPv6) is an important network configuration protocol for IPv6 networks and is widely used in data centers and cloud platform networks. Unlike the IPv4 DHCP protocol, which completely identifies terminal devices based on MAC (Media Access Control) addresses, the DHCPv6 server uses the client's DUID (DHCP Unique Identifier) ​​and IAID (Identity Association Identifier) ​​to mark and identify different clients.

[0003] In data center or cloud platform scenarios, current methods for allocating IPv6 addresses based on the DUID and IAID in DHCPv6 request messages are often unreliable. First, the DUID and IAID are automatically generated during the virtual machine instance creation process. The DHCPv6 server cannot control the DUID and IAID used by the virtual machine. Furthermore, the generation of the DUID and IAID depends not only on hardware information (such as the MAC address and number of network interfaces), but also on operating system software settings (such as the DUID type). This can result in different virtual machine instances copied or cloned from the same virtual machine image having the same DUID and IAID, leading to duplicate and conflicting IPv6 address allocations. Second, because the DUID and IAID are automatically and randomly generated by the operating system, different virtual machine operating systems generate them differently. The virtual machine management layer cannot tag and identify network devices before virtual machine instance creation, making it difficult to set the user's desired IPv6 address based on the binding of these two parameters. These issues are urgent to address in scenarios such as data centers and cloud platforms where network access policy configuration based on IPv6 addresses is required. Summary of the Invention

[0004] To achieve the above objectives, the embodiments of the present application provide an IPv6 address configuration method, a server, and a storage medium for allocating IPv6 addresses to virtual machines in scenarios such as data centers or cloud platforms where network access policy configuration based on IPv6 addresses is required.

[0005] In a first aspect, an embodiment of the present application provides an IPv6 address configuration method, which is applied to a DHCPv6 server. The method includes:

[0006] receiving a first DHCPv6 request message sent by a virtual machine instance, parsing the first DHCPv6 request message, and determining a virtual machine image type to which the virtual machine instance belongs;

[0007] Based on the virtual machine image type, and in accordance with a set address allocation rule, assigning a first IPv6 address to the virtual machine instance, and sending a DHCPv6 response message carrying the first IPv6 address to the virtual machine instance, so that the virtual machine instance establishes a connection with the virtual machine configuration server based on the first IPv6 address;

[0008] receiving a request message sent by the virtual machine configuration server after a connection is successfully established between the virtual machine configuration server and the virtual machine instance, determining a pre-allocated second IPv6 address based on the request message and allocating a DHCP unique identifier DUID and an identity association identifier IAID for requesting the second IPv6 address, and recording a correspondence between the second IPv6 address, the DUID, and the IAID;

[0009] Sending a response message carrying the DUID and the IAID to a virtual machine configuration server, so that the virtual machine configuration server configures the DUID and the IAID to the virtual machine instance;

[0010] A second DHCPv6 request message carrying the DUID and the IAID is received from the virtual machine instance, and the second IPv6 address is allocated to the virtual machine instance based on the DUID and the IAID, and the second IPv6 address is sent to the virtual machine instance.

[0011] In a possible implementation, the step of parsing the first DHCPv6 request message to determine the virtual machine image type to which the virtual machine instance belongs specifically includes:

[0012] Parse the first DHCPv6 request message, obtain the vendor type option field and / or the DUID type field and / or the custom option field in the first DHCPv6 request message, and determine the virtual machine image type to which the virtual machine instance belongs.

[0013] In a possible implementation, the address allocation rule is: the network segment to which the IPv6 address to be allocated belongs can communicate with the virtual machine configuration server, and a corresponding relationship is established between a designated bit in the IPv6 address to be allocated and a virtual machine image type;

[0014] The step of allocating a first IPv6 address to the virtual machine instance based on the virtual machine image type and in accordance with a set address allocation rule specifically includes:

[0015] Configure the network segment to which the first IPv6 address belongs according to the network segment to which the IPv6 address of the virtual machine configuration server belongs;

[0016] Based on the virtual machine image type, designated bits of the first IPv6 address are configured.

[0017] In one possible implementation, the request message includes a first IPv6 address and network configuration information, and the step of determining the pre-allocated second IPv6 address based on the request message specifically includes: determining the pre-allocated second IPv6 address based on the first IPv6 address and network configuration information in the request message; or

[0018] The request message includes the first IPv6 address, network configuration information, and the user-specified address requested from the DHCPv6 server. The step of determining the pre-allocated second IPv6 address based on the request message specifically includes: obtaining the user-specified address carried in the request message, determining whether the user-specified address is assignable, and if the user-specified address is assignable, determining the user-specified address as the pre-allocated second IPv6 address; if the user-specified address is not assignable, determining the pre-allocated second IPv6 address based on the first IPv6 address and the network configuration information in the request message.

[0019] In a possible implementation, after sending the DHCPv6 response message carrying the first IPv6 address to the virtual machine instance, the method further includes:

[0020] An ICMPv6 neighbor advertisement message is sent to the network using the first IPv6 address as the source address to trigger the virtual machine configuration server to establish a connection with the virtual machine instance.

[0021] In a second aspect, an embodiment of the present application provides an IPv6 address configuration method, which is applied to a virtual machine configuration server, the method comprising:

[0022] Listening to ICMPv6 neighbor advertisement messages in the network, obtaining a first IPv6 address in the ICMPv6 neighbor advertisement message, parsing a virtual machine image type and setting a virtual machine connection method based on an address allocation rule for the first IPv6 address, and initiating a connection request with the first IPv6 address as a destination address based on the virtual machine connection method to establish a connection with the virtual machine instance configured with the first IPv6 address;

[0023] After successfully establishing a connection with the virtual machine instance, sending a request message to the DHCPv6 server, so that the DHCPv6 server determines the pre-allocated second IPv6 address based on the request message and allocates a DHCP unique identifier DUID and an identity association identifier IAID for requesting the second IPv6 address;

[0024] Receive a response message sent by the DHCPv6 server, which carries the DUID and IAID used to request the second IPv6 address, obtain the DUID and the IAID, and configure them on the virtual machine instance.

[0025] In a possible implementation manner, the request message includes the first IPv6 address and network configuration information; or

[0026] The request message includes the first IPv6 address, network configuration information, and a user-specified address requested from the DHCPv6 server.

[0027] In a third aspect, an embodiment of the present application provides a DHCPv6 server, the DHCPv6 server comprising:

[0028] A receiving module, configured to receive a first DHCPv6 request message sent by a virtual machine instance;

[0029] a configuration module, configured to parse the first DHCPv6 request message, determine the virtual machine image type to which the virtual machine instance belongs, and allocate a first IPv6 address to the virtual machine instance based on the virtual machine image type and in accordance with a set address allocation rule;

[0030] a sending module, configured to send a DHCPv6 response message carrying the first IPv6 address to the virtual machine instance, so that the virtual machine instance establishes a connection with the virtual machine configuration server based on the first IPv6 address;

[0031] The receiving module is further configured to receive a request message sent after the virtual machine configuration server successfully establishes a connection with the virtual machine instance;

[0032] The configuration module is further configured to determine a pre-allocated second IPv6 address based on the request message and allocate a DHCP unique identifier DUID and an identity association identifier IAID for requesting the second IPv6 address, and record a correspondence between the second IPv6 address, the DUID, and the IAID;

[0033] The sending module is further configured to send a response message carrying the DUID and the IAID to the virtual machine configuration server, so that the virtual machine configuration server configures the DUID and the IAID to the virtual machine instance;

[0034] The receiving module is further configured to receive a second DHCPv6 request message sent by the virtual machine instance and carrying the DUID and the IAID;

[0035] The configuration module is further configured to allocate the second IPv6 address to the virtual machine instance based on the DUID and the IAID;

[0036] The sending module is further configured to send the second IPv6 address to the virtual machine instance.

[0037] In a fourth aspect, an embodiment of the present application provides a virtual machine configuration server, the virtual machine configuration server comprising:

[0038] A receiving module is used to monitor ICMPv6 neighbor advertisement messages in the network;

[0039] A configuration module, configured to obtain the first IPv6 address in the monitored ICMPv6 neighbor advertisement message, and parse the virtual machine image type and set the virtual machine connection method according to the address allocation rule of the first IPv6 address;

[0040] a sending module, configured to initiate a connection request using the first IPv6 address as a destination address based on the virtual machine connection method, so as to establish a connection with the virtual machine instance configured with the first IPv6 address; and after successfully establishing the connection with the virtual machine instance, send a request message to a DHCPv6 server, so that the DHCPv6 server determines a pre-allocated second IPv6 address based on the request message and allocates a DHCP unique identifier DUID and an identity association identifier IAID for requesting the second IPv6 address;

[0041] The receiving module is further configured to receive a response message sent by the DHCPv6 server and carrying the DUID and IAID used to request the second IPv6 address;

[0042] The configuration module is further configured to obtain the DUID and the IAID and configure them on the virtual machine instance.

[0043] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the IPv6 address configuration method as described in the first aspect above, or, when executed by a processor, implements the IPv6 address configuration method as described in the second aspect above.

[0044] This application provides an IPv6 address configuration method, server, and storage medium. A virtual machine configuration server obtains the DUID and IAID used by a DHCPv6 server to allocate IPv6 addresses and configures them on a virtual machine instance. This allows the virtual machine instance to initiate a DHCPv6 request based on the DUID and IAID to obtain an IPv6 address for external communications. This method does not require modification of standard DHCPv6 protocol messages and interaction processes, and is more consistent with the IPv6 address binding and allocation specifications of the DHCPv6 protocol. It is simple, versatile, and low-cost. Furthermore, because the DUID and IAID used by the virtual machine instance to request an IPv6 address are assigned by the DHCPv6 server rather than automatically generated by the virtual machine instance, the IPv6 address allocation process is easier to control. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0046] Figure 1 A schematic diagram of an exemplary topological structure provided in an embodiment of the present application;

[0047] Figure 2 A schematic diagram of the interactive process of a method for configuring an IPv6 address for a virtual machine provided in an embodiment of the present application;

[0048] Figure 3 A flowchart of a method for configuring an IPv6 address for a virtual machine provided in an embodiment of the present application;

[0049] Figure 4 A flowchart of a method for configuring an IPv6 address for a virtual machine provided in an embodiment of the present application;

[0050] Figure 5 A DHCPv6 server provided in an embodiment of the present application;

[0051] Figure 6 A virtual machine configuration server is provided in an embodiment of the present application.

[0052] Icons: 10 - VM instance; 20 - VM configuration server; 30 - DHCPv6 server. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present application, not all of the embodiments. Those skilled in the art should know that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0054] The terms "first," "second," and the like used in the embodiments of this application are used solely to distinguish features of the same type and should not be construed as indicating relative importance, quantity, or order. It should be understood that such use of features of the same type can be interchanged where appropriate to provide a clearer and more accurate description and understanding of the embodiments of this application.

[0055] The terms "exemplary" or "for example" in the embodiments of this application are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0056] The above method is described in detail below with reference to specific embodiments.

[0057] DHCPv6 (Dynamic Host Configuration Protocol for IPv6) is a key network configuration protocol for IPv6 (Internet Protocol Version 6) networks and is widely used in data centers and cloud platforms. Unlike the DHCP protocol for IPv4 (Internet Protocol Version 4), which identifies end devices solely based on MAC addresses, a DHCPv6 server uses the client's DUID (DHCP Unique Identifier) ​​and IAID (Identity Association Identifier) ​​to identify and distinguish different clients. The DUID is a globally unique identifier that is generated during client initialization and remains unchanged throughout the client's lifecycle. Common DUID generation methods include hardware addresses (such as MAC addresses), timestamps, and vendor-defined methods. The IAID identifies a specific network interface on the client and is typically automatically generated by the client operating system. Each network interface has a unique IAID. When a client sends a DHCPv6 request to a DHCPv6 server, it carries its DUID and IAID in the message. The DHCPv6 server identifies and distinguishes different clients and their network interfaces by parsing the DUID and IAID, ensuring that the correct IPv6 address and other configuration information are assigned to each client's network interface. This approach makes DHCPv6 more efficient in complex network environments, especially in large-scale deployment scenarios such as data centers and cloud platforms.

[0058] In data center or cloud platform scenarios, current methods for allocating IPv6 addresses based on the DUID and IAID in DHCPv6 request messages are often unreliable. First, the DUID and IAID are automatically generated during the virtual machine instance creation process. The DHCPv6 server cannot control the DUID and IAID used by the virtual machine. Furthermore, the generation of the DUID and IAID depends not only on hardware information (such as the MAC address and number of network interfaces), but also on operating system software settings (such as the DUID type). This can result in different virtual machine instances copied or cloned from the same virtual machine image having the same DUID and IAID, leading to duplicate and conflicting IPv6 address allocations. Second, because the DUID and IAID are automatically and randomly generated by the operating system, different virtual machine operating systems generate them differently. The virtual machine management layer cannot tag and identify network devices before virtual machine instance creation, making it difficult to set the user's desired IPv6 address based on the binding of these two parameters. These issues are urgent to address in scenarios such as data centers and cloud platforms where network access policy configuration based on IPv6 addresses is required.

[0059] To address the above issues, existing technologies generally consider the following two solutions. The first solution considers allocating IPv6 addresses by matching MAC addresses. Specifically, by assigning fixed MAC addresses to virtual machines or devices, the DHCPv6 server can configure fixed IPv6 addresses. However, because the DHCPv6 protocol standard stipulates that servers do not use MAC addresses to distinguish requesting clients, and some operating systems' DHCPv6 address requests do not carry MAC address information that can be used for identification and differentiation, all MAC address-based IPv6 address binding and allocation methods require additional adaptation processing by the client and the intermediary network devices, increasing the difficulty and cost of IPv6 address configuration. The second solution considers intercepting DHCPv6 request messages sent by virtual machines, identifying and modifying the message data within the DHCPv6 request messages, and enabling the DHCPv6 server to distinguish different virtual machines based on the DHCPv6 request messages. However, this implementation requires additional functional support and modification of the intermediate network devices, which not only compromises the performance of the network devices but also may introduce certain security risks.

[0060] Therefore, an embodiment of the present application provides an IPv6 address configuration method, which can implement allocation control of virtual machine IPv6 addresses.

[0061] like Figure 1The figure shows a topological structure diagram of an example virtual machine IPv6 address configuration, in which the virtual machine instance 10 is the virtual machine actually used by the user, which is created by cloning the virtual machine image on the cloud platform. After the created virtual machine instance is started, it will actively or passively obtain relevant system configuration and network configuration from the virtual machine configuration server and the DHCPv6 server, thereby completing the system initialization of the virtual machine instance. The virtual machine configuration server 20 is used to store and issue virtual machine configurations, such as hard disk partitions, application software configurations, connection keys, etc., and is usually deployed in a cloud platform environment or runs on a cloud platform system as a cloud platform component. In the embodiment of the present application, the virtual machine configuration server will issue and configure the DUID and IAID obtained from the DHCPv6 server to the virtual machine instance. The DHCPv6 server 30 is used to configure the IPv6 address for the virtual machine instance and needs to support IPv6 address binding based on the DUID and IAID. In the embodiment of the present application, the DHCPv6 server is mainly used to identify the virtual machine image type based on the DHCPv6 request message and provides a DHCPv6 ID allocation service interface for allocating DUID and IAID.

[0062] Based on the topology structure of the above example, the embodiment of the present application provides a method for configuring the IPv6 address of a virtual machine, such as Figure 2 As shown, the method includes:

[0063] After the virtual machine instance is cloned and started based on the virtual machine image, the virtual machine instance sends a DHCPv6 request message to the DHCPv6 server. The DHCPv6 request message is used to request the DHCPv6 server for a first IPv6 address for communicating with the virtual machine configuration server. The DHCPv6 request message can be a Solicit message.

[0064] After receiving the DHCPv6 request message, the DHCPv6 server parses the DUID and IAID carried in the message to determine whether the DUID and IAID were assigned by the DHCPv6 server. If not, the DHCPv6 server further parses the message to determine the virtual machine image type of the virtual machine instance sending the DHCPv6 request message. If it was assigned by the DHCPv6 server, the server processes the DHCPv6 request message according to standard DHCPv6 procedures.

[0065] In an embodiment of the present application, the DHCPv6 server can parse one or more of the vendor type option field, the DUID type field, and the custom option field in the DHCPv6 request message, and determine the virtual machine image type to which the virtual machine instance belongs based on a combination of one or more of the vendor type option field, the DUID type field, and the custom option field. For the virtual machine configuration control layer, it can identify and adapt to different virtual machine operating systems to ensure that the DUID and IAID of the virtual machine instance are correctly set.

[0066] For example, the steps for the DHCPv6 server to determine the virtual machine image type to which the virtual machine instance belongs include:

[0067] By reading the Vendor Class Option field in the DHCPv6 request message and identifying the value of the Vendor Class Option field, the operating system and related parameters of the virtual machine instance can be determined. For example, if the value of the Vendor Class Option field is A, it indicates that the image created by the vendor A is the operating system of vendor A, and the operating system is the operating system related to vendor A. Based on the operating system related to vendor A, the virtual machine image type of the virtual machine instance can be determined.

[0068] For example, the steps for the DHCPv6 server to determine the virtual machine image type to which the virtual machine instance belongs include:

[0069] The DUID type field carried in the DHCPv6 request message is used for judgment. If the DUID type field is UUID (Universally Unique Identifier), the virtual machine operating system is usually a Linux operating system. If the DUID type field is LLT (Link-Layer Address plus Time), the virtual machine operating system is usually a Windows operating system. Therefore, the virtual machine image type of the virtual machine instance can be determined based on the DUID type.

[0070] For example, the steps for the DHCPv6 server to determine the virtual machine image type to which the virtual machine instance belongs include:

[0071] When creating a VM image, the DHCPv6 request message (such as the DHCPv6 Solicit message) sent by the client carries a custom option that identifies the VM image type. The DHCPv6 server can then parse the custom option field in the DHCPv6 request message and determine the VM image type based on the custom option field.

[0072] After the DHCPv6 server determines the virtual machine image type of the virtual machine instance, it allocates a first IPv6 address based on the determined virtual machine image type and in accordance with the configured address allocation rules. The address allocation rules stipulate that the network segment to which the first IPv6 address belongs can communicate with the virtual machine configuration server, and that a corresponding relationship is established between designated bits in the first IPv6 address and the virtual machine image type. The DHCPv6 server records the configured first IPv6 address and returns it to the virtual machine instance via a DHCPv6 Reply message.

[0073] In one possible implementation, the DHCPv6 server allocates a first IPv6 address to the virtual machine instance based on the virtual machine image type and in accordance with a set address allocation rule, specifically including:

[0074] The DHCPv6 server configures the network segment to which the first IPv6 address belongs according to the network segment to which the IPv6 address of the virtual machine configuration server belongs; and configures designated bits of the first IPv6 address based on the virtual machine image type.

[0075] For example, a specific implementation of allocating a first IPv6 address to a virtual machine instance is as follows: Assuming that the IPv6 address of the virtual machine configuration server is ff0d::fffe / 64, the network segment of the first IPv6 address can be configured to be ff0d:: / 64. The 13th byte of the first IPv6 address is set to mark a specific virtual machine image type. For example: based on the first IPv6 address prefix ff0d:: / 64, the first IPv6 address is configured to be ff0d:: 01 02:2efc, where the 01 in the 13th byte indicates that the VM image type of the VM instance containing the IPv6 address is Ubuntu 22.04.

[0076] In an optional embodiment, a correspondence between a designated bit of the first IPv6 address and a virtual machine connection method may be established in the first IPv6 address, so as to indicate the virtual machine connection method through the first IPv6 address. For example, the 13th to 14th bytes of the first IPv6 address may be set to mark a specific virtual machine image type and a virtual machine connection method. For example, based on the first IPv6 address prefix ff0d:: / 64, the first IPv6 address may be configured as ff0d:: 0102 :2efc, where the 13th byte 01 indicates that the VM image type of the VM instance where the IPv6 address resides is Ubuntu 22.04, and the 14th byte 02 indicates that the default password can be used to log in.

[0077] The embodiment of the present application provides a virtual machine IPv6 address configuration method, a DHCPv6 server allocates a first IPv6 address based on a virtual machine image type carried in a DHCPv6 request message, no additional configuration is needed for an operating system of a virtual machine image when the virtual machine image is constructed, the adaptability is high, no additional virtual machine configuration script needs to be installed, and the virtual machine image is less intrusive.

[0078] In a possible implementation manner, after the virtual machine instance receives and successfully configures the first IPv6 address, the virtual machine instance sends an ICMPv6 NA (ICMPv6 Neighbor Advertisement) message to other devices and servers in the network by using the first IPv6 address as a source address based on an ICMPv6 NDP process, and advertises self network information.

[0079] In another possible implementation manner, after the DHCPv6 server allocates the first IPv6 address, the DHCPv6 server can also send an ICMPv6 NA message by using the first IPv6 address as a source address, to trigger the virtual machine configuration server to establish a connection with the virtual machine instance.

[0080] The virtual machine configuration server listens to an ICMPv6 NA message in the network, after the virtual machine configuration server receives the ICMPv6 NA message, the virtual machine configuration server parses the ICMPv6 NA message and sets a connection method. Specifically, the virtual machine configuration server parses a source address of the ICMPv6 NA message, determines whether the source address of the message is in a network segment range of the first IPv6 address set by the DHCPv6 server, if yes, parses the first IPv6 address according to a first IPv6 address allocation rule, determines a virtual machine image type, and sets a virtual machine connection method for connecting the virtual machine instance. The virtual machine configuration server initiates a connection request by using the virtual machine connection method and using the first IPv6 address as a destination address, to establish a connection with the virtual machine instance configured with the first IPv6 address. After the virtual machine configuration server successfully establishes the connection with the virtual machine instance, the virtual machine configuration server can configure the virtual machine instance by using a channel established by the connection. After the virtual machine instance successfully establishes the connection with the virtual machine configuration server, the virtual machine instance returns a connection success message to the virtual machine configuration server.

[0081] After the virtual machine configuration server successfully establishes the connection with the virtual machine instance, the virtual machine configuration server sends a request message to an ID allocation service interface of the DHCPv6 server, the request message is used to request a DUID and an IAID for allocating a second IPv6 address from the DHCPv6 server. The first IPv6 address information is carried in the request message, for example, the first IPv6 address can be carried in a payload of the request message. Optionally, network configuration related information can also be carried in the request message.

[0082] After receiving the request message, the DHCPv6 server parses the payload in the request message and, based on the acquired first IPv6 address and any network configuration information that may be carried in the payload, determines a pre-allocated second IPv6 address and allocates a DUID and IAID for requesting the second IPv6 address. The server then records the correspondence between the second IPv6 address, DUID, and IAID, encapsulates the DUID and IAID in a response message, and returns it to the virtual machine configuration server. This second IPv6 address is used for external network communication with the virtual machine instance and is typically a cloud platform tenant network address or a public Internet address. It can be specified by the virtual machine configuration server using the network configuration information in the request message; or the DHCPv6 server can select an address from a specific address pool based on the first IPv6 address for allocation.

[0083] In one possible implementation, the virtual machine configuration server requests the DHCPv6 server for the DUID and IAID for allocating the second IPv6 address as follows:

[0084] The DHCPv6 server opens a specific port and listens for request messages sent by the virtual machine server.

[0085] The virtual machine configuration server encapsulates the first IPv6 address and network configuration information in a request message and sends the request message to a specific port of the DHCPv6 server. Optionally, the first IPv6 address and optional network configuration information may be carried in payload data of the request message.

[0086] After the DHCPv6 server receives the request message, it parses the request message, determines the pre-allocated second IPv6 address based on the first IPv6 address and network configuration information in the request message, allocates the DUID and IAID used to request the second IPv6 address, sets and records the binding relationship between the second IPv6 address, DUID, and IAID, encapsulates the DUID and IAID in a response message, and returns it to the virtual machine configuration server.

[0087] In another possible implementation, the virtual machine configuration server requests the DHCPv6 server for the DUID and IAID for allocating the second IPv6 address as follows:

[0088] The DHCPv6 server opens a specific port and listens for request messages sent by the virtual machine server.

[0089] The virtual machine configuration server encapsulates the first IPv6 address, network configuration information, and the user-specified address requested from the DHCPv6 server in a request message, and sends the request message to a specific port of the DHCPv6 server. Optionally, the first IPv6 address, optional network configuration information, and the user-specified address requested from the DHCPv6 server may be included in the payload data of the request message. Specifically, the user-specified address requested from the DHCPv6 server may be added to the payload data of the request message.

[0090] By setting the user-specified address in a request message and sending it to the DHCPv6 server, the DHCPv6 server can allocate a DUID and IAID based on the user-specified address, thereby setting the IPv6 address required by the user based on the binding of the DUID and IAID.

[0091] For example, if the payload of a request message includes the user-specified address 2000:2dcf::1ac / 108 requested from the DHCPv6 server, the DHCPv6 server parses the payload to determine whether the user-specified address "2000:2dcf::1ac / 108" requested in the payload is assignable. If so, the DHCPv6 server identifies the user-specified address as the pre-allocated second IPv6 address, assigns the DUID and IAID used to request the second IPv6 address, establishes and records the binding relationship between the second IPv6 address, the DUID, and the IAID, encapsulates the DUID and IAID in a response message, and returns the response to the virtual machine configuration server. If the user-specified address cannot be allocated, the pre-allocated second IPv6 address is determined based on the first IPv6 address and network configuration information in the request message, and the DUID and IAID used to request the second IPv6 address are allocated. The binding relationship between the second IPv6 address, DUID and IAID is set and recorded, and the DUID and IAID are encapsulated in a response message and returned to the virtual machine configuration server.

[0092] In an embodiment of the present application, the DHCPv6 server allocates a DUID and IAID for the virtual machine instance to request the second IPv6 address based on the second IPv6 address, binds and records the correspondence between the second IPv6 address, the DUID, and the IAID. The DHCPv6 server responds to the request message from the virtual machine configuration server and returns the DUID and IAID to the virtual machine configuration server via a response message.

[0093] For example, if the DHCPv6 server opens a specific TCP port, such as port 80, for listening to the request message sent by the virtual machine server, the virtual machine configuration server requests the DHCPv6 server for the DUID and IAID for allocating the second IPv6 address in the following manner:

[0094] In a possible implementation, the virtual machine configuration server encapsulates the first IPv6 address and network configuration information in an HTTP request message, and sends the HTTP request message to port 80 of the DHCPv6 server. The HTTP request message carries the first IPv6 address and optional network configuration information.

[0095] After the DHCPv6 server intercepts the HTTP request message, it parses the HTTP request message, determines the pre-allocated second IPv6 address based on the first IPv6 address and network configuration information in the HTTP request message, allocates the DUID and IAID used to request the second IPv6 address, sets and records the binding relationship between the second IPv6 address, DUID, and IAID, encapsulates the DUID and IAID in an HTTP response message, and returns it to the virtual machine configuration server.

[0096] In another possible implementation, the virtual machine configuration server encapsulates the first IPv6 address, network configuration information, and the user-specified address requested from the DHCPv6 server in an HTTP request message, and sends the HTTP request message to port 80 of the DHCPv6 server. The HTTP request message carries the first IPv6 address, optional network configuration information, and the user-specified address requested from the DHCPv6 server. After the DHCPv6 server intercepts the HTTP request message, it parses the HTTP request message and determines whether the requested user-specified address in the HTTP request message is assignable. If so, it determines the user-specified address as a pre-assigned second IPv6 address and assigns a DUID and IAID for requesting the second IPv6 address. It then sets and records the binding relationship among the second IPv6 address, DUID, and IAID, encapsulates the DUID and IAID in an HTTP response message, and returns the response to the virtual machine configuration server. If the user-specified address cannot be allocated, the pre-allocated second IPv6 address is determined based on the first IPv6 address and network configuration information in the HTTP request message, and the DUID and IAID used to request the second IPv6 address are allocated. The binding relationship between the second IPv6 address, DUID and IAID is set and recorded, and the DUID and IAID are encapsulated in the HTTP response message and returned to the virtual machine configuration server.

[0097] After the virtual machine configuration server obtains the DUID and IAID used for requesting the second IPv6 address, the virtual machine configuration server configures the DUID and IAID on the virtual machine instance. After the configuration succeeds, the virtual machine instance initiatively releases the first IPv6 address and disconnects the management connection.

[0098] After the virtual machine instance releases the first IPv6 address, the virtual machine instance initiatively reinitiates a DHCPv6 request to the DHCPv6 server by using the DUID and IAID to request the DHCPv6 server to allocate the second IPv6 address. After the DHCPv6 server receives the DHCPv6 request message, the DHCPv6 server returns the bound second IPv6 address to the virtual machine instance based on the corresponding binding relationship between the second IPv6 address, the DUID and the IAID.

[0099] After the virtual machine instance receives and configures the second IPv6 address, the virtual machine instance uses the second IPv6 address to perform normal network communication.

[0100] In the embodiment of the present application, the combination of the DUID and the IAID is unique, and different combinations of the DUID and the IAID are not repeated. The combination of the DUID and the IAID forms a one-to-one binding relationship with the second IPv6 address.

[0101] In the embodiment of the present application, the binding relationship among the DUID, the IAID and the second IPv6 address can be configured before the DHCPv6 server receives the DHCPv6 request including the DUID and the IAID, or the DHCPv6 server automatically generates an IPv6 address from an address pool of the second IPv6 address after receiving the DHCPv6 request.

[0102] The IPv6 address configuration method provided in the embodiment of the present application obtains the DUID and the IAID used by the DHCPv6 server for allocating the IPv6 address through the virtual machine configuration server and configures the DUID and the IAID on the virtual machine instance, so that the virtual machine instance initiates the DHCPv6 request according to the DUID and the IAID to obtain the IPv6 address used for external communication of the virtual machine instance. The method does not need to modify the DHCPv6 standard protocol message and the interaction flow, is more in line with the IPv6 address binding and allocation of the DHCPv6 protocol specification, is simple and universal, and has low cost. Moreover, the DUID and the IAID used by the virtual machine instance for requesting the IPv6 address are allocated by the DHCPv6 server rather than automatically generated by the virtual machine instance, so that the IPv6 address allocation process is more easily controlled.

[0103] As shown in FIG. 1, Figure 3 The embodiment of the present application provides an IPv6 address configuration method, which is applied to a DHCPv6 server, and the method comprises the following steps.

[0104] S301: receiving a first DHCPv6 request message sent by a virtual machine instance, parsing the first DHCPv6 request message, and determining a virtual machine image type to which the virtual machine instance belongs.

[0105] In this step, the step of parsing the first DHCPv6 request message and determining the virtual machine image type to which the virtual machine instance belongs specifically includes:

[0106] The first DHCPv6 request message is parsed to obtain a vendor type option field and / or a DUID type field and / or a custom option field in the first DHCPv6 request message, and the virtual machine image type to which the virtual machine instance belongs is determined.

[0107] In the embodiment of the application, the DHCPv6 server can determine the virtual machine image type to which the virtual machine instance belongs by parsing one or more of the vendor type option field, the DUID type field, and the custom option field in the DHCPv6 request message, and based on a combination of one or more of a vendor type option field value, a DUID type field value, and a custom option field value. For the virtual machine configuration control layer, different virtual machine operating systems can be recognized and adapted to ensure that the DUID and IAID of the virtual machine instance are correctly set.

[0108] S302: based on the virtual machine image type, allocating a first IPv6 address to the virtual machine instance according to a set address allocation rule, and sending a DHCPv6 response message carrying the first IPv6 address to the virtual machine instance, so that the virtual machine instance establishes a connection with the virtual machine configuration server based on the first IPv6 address.

[0109] In the embodiment of the application, the address allocation rule is that a network segment to which the to-be-allocated IPv6 address belongs can communicate with the virtual machine configuration server, and a specified bit in the to-be-allocated IPv6 address establishes a corresponding relationship with the virtual machine image type.

[0110] In this step, based on the virtual machine image type, the first IPv6 address is allocated to the virtual machine instance according to the set address allocation rule, specifically including:

[0111] According to a network segment to which an IPv6 address of the virtual machine configuration server belongs, a network segment to which the first IPv6 address belongs is configured.

[0112] Based on the virtual machine image type, a specific bit of the first IPv6 address is configured.

[0113] S303: Receive a request message sent by the virtual machine configuration server after successfully establishing a connection with the virtual machine instance, determine the pre-allocated second IPv6 address based on the request message and allocate a DUID and IAID for requesting the second IPv6 address, and record the correspondence between the second IPv6 address, DUID, and IAID.

[0114] In a possible implementation, the request message includes the first IPv6 address and network configuration information.

[0115] In this step, determining the pre-allocated second IPv6 address based on the request message specifically includes:

[0116] A pre-allocated second IPv6 address is determined based on the first IPv6 address and the network configuration information in the request message.

[0117] In a possible implementation, the request message includes the first IPv6 address, network configuration information, and a user-specified address requested from the DHCPv6 server.

[0118] In this step, determining the pre-allocated second IPv6 address based on the request message specifically includes:

[0119] Parse the user-specified address in the request message and determine whether the user-specified address can be assigned. If the user-specified address can be assigned, determine the user-specified address as the pre-allocated second IPv6 address; if the user-specified address cannot be assigned, determine the pre-allocated second IPv6 address based on the first IPv6 address and network configuration information in the request message.

[0120] S304: Send a response message carrying the DUID and the IAID to the virtual machine configuration server, so that the virtual machine configuration server configures the DUID and the IAID to the virtual machine instance.

[0121] In an embodiment of the present application, after sending the DHCPv6 response message carrying the first IPv6 address to the virtual machine instance, the method further includes:

[0122] An ICMPv6 NA message is sent to the network using the first IPv6 address as the source address to trigger the virtual machine configuration server to establish a connection with the virtual machine instance.

[0123] S305: Receive a second DHCPv6 request message carrying the DUID and IAID sent by the virtual machine instance, allocate a second IPv6 address to the virtual machine instance based on the DUID and IAID in the second DHCPv6 request message, and send the second IPv6 address to the virtual machine instance.

[0124] An embodiment of the present application provides an IPv6 address configuration method, which carries the DUID and IAID used by a virtual machine instance to request the allocation of an IPv6 address in a response message and sends it to a virtual machine configuration server, so that the virtual machine configuration server configures the DUID and IAID to the virtual machine instance. Based on the DUID and IAID, the virtual machine instance initiates a DHCPv6 request to obtain the IPv6 address for external communication of the virtual machine instance. This method does not require modification of the DHCPv6 standard protocol message and interaction process, and is more in line with the IPv6 address binding and allocation specified in the DHCPv6 protocol, thus being simple, universal, and low-cost. Furthermore, since the DUID and IAID used by the virtual machine instance to request the allocation of an IPv6 address are allocated by the DHCPv6 server rather than automatically generated by the virtual machine instance, the IPv6 address allocation process is easier to control.

[0125] like Figure 4 As shown, an embodiment of the present application provides an IPv6 address configuration method, which is applied to a virtual machine configuration server. The method includes:

[0126] S401: Listen for ICMPv6 NA messages in the network, obtain a first IPv6 address in the ICMPv6 NA message, and parse the virtual machine image type and set the virtual machine connection method based on the address allocation rule of the first IPv6 address. Based on the virtual machine connection method, initiate a connection request with the first IPv6 address as the destination address to establish a connection with the virtual machine instance configured with the first IPv6 address.

[0127] S402: After successfully establishing a connection with the virtual machine instance, a request message is sent to the DHCPv6 server, so that the DHCPv6 server determines the pre-allocated second IPv6 address based on the request message and allocates a DUID and IAID for requesting the second IPv6 address.

[0128] In a possible implementation, the request message includes the first IPv6 address and network configuration information.

[0129] In a possible implementation, the request message includes the first IPv6 address, network configuration information, and a user-specified address requested from the DHCPv6 server.

[0130] The request message carries the user-specified address requested from the DHCPv6 server, so that the DHCPv6 server can allocate a DUID and IAID based on the user-specified address, thereby setting the IPv6 address required by the user based on the binding of the DUID and IAID.

[0131] S403: Receive a response message from the DHCPv6 server that carries the DUID and IAID used to request the second IPv6 address, obtain the DUID and IAID in the response message, and configure them on the virtual machine instance.

[0132] An embodiment of the present application provides an IPv6 address configuration method, which uses a virtual machine configuration server to monitor ICMPv6 NA messages containing a first IPv6 address, and initiates a request message to obtain the DUID and IAID assigned by the DHCPv6 server for requesting the allocation of an IPv6 address, and configures the obtained DUID and IAID to the virtual machine instance, so that the virtual machine instance initiates a DHCPv6 request based on the DUID and IAID to obtain the IPv6 address for external communication of the virtual machine instance. This method does not require modification of the DHCPv6 standard protocol message and interaction process, and is more in line with the IPv6 address binding and allocation specified in the DHCPv6 protocol, and is simple, universal, and low-cost. In addition, since the DUID and IAID used by the virtual machine instance to request the allocation of an IPv6 address are assigned by the DHCPv6 server rather than automatically generated by the virtual machine instance, the IPv6 address allocation process is easier to control.

[0133] like Figure 5 As shown, the embodiment of the present application provides a DHCPv6 server 30, which includes:

[0134] The receiving module 501 is configured to receive a first DHCPv6 request message sent by a virtual machine instance.

[0135] The configuration module 502 is configured to parse the first DHCPv6 request message, determine the virtual machine image type to which the virtual machine instance belongs, and allocate a first IPv6 address to the virtual machine instance based on the virtual machine image type and in accordance with a set address allocation rule.

[0136] The sending module 503 is configured to send a DHCPv6 response message carrying the first IPv6 address to the virtual machine instance, so that the virtual machine instance establishes a connection with the virtual machine configuration server based on the first IPv6 address.

[0137] The receiving module 501 is further configured to receive a request message sent by the virtual machine configuration server after a connection is successfully established between the virtual machine configuration server and the virtual machine instance.

[0138] The configuration module 502 is further configured to determine the pre-allocated second IPv6 address based on the request message, allocate a DUID and an IAID for requesting the second IPv6 address, and record a correspondence between the second IPv6 address, the DUID, and the IAID;

[0139] The sending module 503 is configured to send a response message carrying the DUID and IAID to the virtual machine configuration server, so that the virtual machine configuration server configures the DUID and IAID to the virtual machine instance.

[0140] The receiving module 501 is further configured to receive a second DHCPv6 request message sent by the virtual machine instance and carrying the DUID and IAID.

[0141] The configuration module 502 is further configured to allocate a second IPv6 address to the virtual machine instance based on the DUID and IAID in the second DHCPv6 request message.

[0142] The sending module 503 is further configured to send the second IPv6 address to the virtual machine instance.

[0143] In a possible implementation, the configuration module 502 is specifically configured to parse the first DHCPv6 request message, obtain the vendor type option field and / or DUID type field and / or custom option field in the first DHCPv6 request message, and determine the virtual machine image type to which the virtual machine instance belongs.

[0144] In the embodiment of the present application, the address allocation rule is: the network segment to which the IPv6 address to be allocated belongs can communicate with the virtual machine configuration server, and a specific bit in the IPv6 address to be allocated establishes a correspondence with the virtual machine image type.

[0145] The configuration module 502 is specifically configured to configure the network segment to which the first IPv6 address belongs according to the network segment to which the IPv6 address of the virtual machine configuration server belongs; and configure specific bits of the first IPv6 address based on the virtual machine image type.

[0146] In this embodiment of the present application, the request message may include the first IPv6 address and network configuration information.

[0147] The configuration module 502 is specifically configured to determine a pre-allocated second IPv6 address based on the first IPv6 address and the network configuration information in the request message.

[0148] In an embodiment of the present application, the request message may also include a first IPv6 address, network configuration information, and a user-specified address requested from the DHCPv6 server. The configuration module 502 is specifically used to parse the user-specified address in the request message and determine whether the user-specified address can be assigned. If the user-specified address can be assigned, the user-specified address is determined as the pre-allocated second IPv6 address; if the user-specified address cannot be assigned, the pre-allocated second IPv6 address is determined based on the first IPv6 address and network configuration information in the request message.

[0149] In the embodiment of the present application, the sending module 503 is further configured to send an ICMPv6 NA message to the network using the first IPv6 address as the source address to trigger the virtual machine configuration server to establish a connection with the virtual machine instance.

[0150] The embodiment of the present application provides a DHCPv6 server, which carries the DUID and IAID used by a virtual machine instance to request the allocation of an IPv6 address in a response message and sends it to a virtual machine configuration server, so that the virtual machine configuration server configures the DUID and IAID to the virtual machine instance. The virtual machine instance initiates a DHCPv6 request based on the DUID and IAID to obtain the IPv6 address for external communication of the virtual machine instance. This method does not require modification of the DHCPv6 standard protocol message and interaction process, and is more in line with the IPv6 address binding and allocation specified in the DHCPv6 protocol, and is simple, universal, and low-cost. Moreover, since the DUID and IAID used by the virtual machine instance to request the allocation of an IPv6 address are allocated by the DHCPv6 server rather than automatically generated by the virtual machine instance, the DUID and IAID used by the virtual machine instance can be fixed, and the DUID and IAID can be identified and controlled before the DHCPv6 server allocates the IPv6 address. This makes the IPv6 address allocation process easier to control.

[0151] like Figure 6 As shown, the embodiment of the present application provides a virtual machine configuration server 20, which includes:

[0152] Receiving module 601, configured to monitor ICMPv6 NA messages in the network;

[0153] The configuration module 602 is configured to obtain the first IPv6 address in the ICMPv6 NA message monitored by the receiving module, and parse the virtual machine image type and set the virtual machine connection method according to the address allocation rule of the first IPv6 address;

[0154] The sending module 603 is configured to initiate a connection request with the first IPv6 address as the destination address based on the virtual machine connection method to establish a connection with the virtual machine instance configured with the first IPv6 address. After the connection with the virtual machine instance is successfully established, the sending module 603 is configured to send a request message to the DHCPv6 server, so that the DHCPv6 server determines the pre-allocated second IPv6 address based on the request message and allocates a DUID and IAID for requesting the second IPv6 address.

[0155] In a possible implementation, the request message may include the first IPv6 address and network configuration information.

[0156] In a possible implementation, the request message can further include the first IPv6 address, network configuration information, and a user-specified address requested from the DHCPv6 server.

[0157] The receiving module 601 is further configured to receive a response message carrying a DUID and an IAID for requesting a second IPv6 address, which is sent by the DHCPv6 server.

[0158] The configuration module 602 is further configured to obtain the DUID and the IAID in the response message and configure the DUID and the IAID to the virtual machine instance.

[0159] The virtual machine configuration server provided by the embodiments of the present application configures the DUID and the IAID for requesting allocation of an IPv6 address, which is sent by the DHCPv6 server, to the virtual machine instance, so that the virtual machine instance initiates a DHCPv6 request according to the DUID and the IAID to obtain an IPv6 address for external communication of the virtual machine instance. The method does not need to modify the DHCPv6 standard protocol message and the interaction process, is more in line with the IPv6 address binding and allocation of the DHCPv6 protocol specification, is simple and universal, and has low cost. Moreover, the DUID and the IAID for requesting allocation of an IPv6 address, which are used by the virtual machine instance, are allocated by the DHCPv6 server rather than automatically generated by the virtual machine instance, so that the IPv6 address allocation process is more easily controlled.

[0160] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the IPv6 address configuration method disclosed in the above embodiments.

[0161] In the above embodiments provided by the present application, it should be understood that the disclosed method can also be implemented by other ways. The embodiments described above are only schematic, and the division of the units is only a logical function division. There can be another division way for the actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0162] In addition, each function unit in the various embodiments of the present application can be integrated into a processing unit, or each unit can exist alone physically, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware, or can be implemented in the form of software functional units.

[0163] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0164] The above merely provides a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or combinations within the technical scope disclosed in the present application, which shall be encompassed in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for configuring an IPv6 address, characterized in that: Applied to a DHCPv6 server, the method includes: receiving a first DHCPv6 request message sent by a virtual machine instance, parsing the first DHCPv6 request message, and determining a virtual machine image type to which the virtual machine instance belongs; Based on the virtual machine image type, and in accordance with a set address allocation rule, assigning a first IPv6 address to the virtual machine instance, and sending a DHCPv6 response message carrying the first IPv6 address to the virtual machine instance, so that the virtual machine instance establishes a connection with the virtual machine configuration server based on the first IPv6 address; receiving a request message sent by the virtual machine configuration server after a connection is successfully established between the virtual machine configuration server and the virtual machine instance, determining a pre-allocated second IPv6 address based on the request message and allocating a DHCP unique identifier DUID and an identity association identifier IAID for requesting the second IPv6 address, and recording a correspondence between the second IPv6 address, the DUID, and the IAID; Sending a response message carrying the DUID and the IAID to a virtual machine configuration server, so that the virtual machine configuration server configures the DUID and the IAID to the virtual machine instance; A second DHCPv6 request message carrying the DUID and the IAID is received from the virtual machine instance, and the second IPv6 address is allocated to the virtual machine instance based on the DUID and the IAID, and the second IPv6 address is sent to the virtual machine instance.

2. The IPv6 address configuration method according to claim 1, wherein: The step of parsing the first DHCPv6 request message to determine the virtual machine image type to which the virtual machine instance belongs specifically includes: Parse the first DHCPv6 request message, obtain the vendor type option field and / or the DUID type field and / or the custom option field in the first DHCPv6 request message, and determine the virtual machine image type to which the virtual machine instance belongs.

3. The IPv6 address configuration method according to claim 1, wherein: The address allocation rule is: the network segment to which the IPv6 address to be allocated belongs can communicate with the virtual machine configuration server, and a corresponding relationship is established between a designated bit in the IPv6 address to be allocated and the virtual machine image type; The step of allocating a first IPv6 address to the virtual machine instance based on the virtual machine image type and in accordance with a set address allocation rule specifically includes: Configure the network segment to which the first IPv6 address belongs according to the network segment to which the IPv6 address of the virtual machine configuration server belongs; Based on the virtual machine image type, designated bits of the first IPv6 address are configured.

4. The IPv6 address configuration method according to claim 3, wherein: The request message includes the first IPv6 address and network configuration information, and the step of determining the pre-allocated second IPv6 address based on the request message specifically includes: determining the pre-allocated second IPv6 address based on the first IPv6 address and the network configuration information in the request message; or The request message includes the first IPv6 address, network configuration information, and the user-specified address requested from the DHCPv6 server. The step of determining the pre-allocated second IPv6 address based on the request message specifically includes: obtaining the user-specified address carried in the request message, determining whether the user-specified address is assignable, and if the user-specified address is assignable, determining the user-specified address as the pre-allocated second IPv6 address; if the user-specified address is not assignable, determining the pre-allocated second IPv6 address based on the first IPv6 address and the network configuration information in the request message.

5. The IPv6 address configuration method according to any one of claims 1 to 4, characterized in that: After sending the DHCPv6 response message carrying the first IPv6 address to the virtual machine instance, the method further includes: An ICMPv6 neighbor advertisement message is sent to the network using the first IPv6 address as the source address to trigger the virtual machine configuration server to establish a connection with the virtual machine instance.

6. A method for configuring an IPv6 address, characterized in that: Applied to a virtual machine configuration server, the method includes: Listening to ICMPv6 neighbor advertisement messages in the network, obtaining a first IPv6 address in the ICMPv6 neighbor advertisement message, parsing a virtual machine image type and setting a virtual machine connection method based on an address allocation rule for the first IPv6 address, and initiating a connection request with the first IPv6 address as a destination address based on the virtual machine connection method to establish a connection with the virtual machine instance configured with the first IPv6 address; After successfully establishing a connection with the virtual machine instance, sending a request message to the DHCPv6 server, so that the DHCPv6 server determines the pre-allocated second IPv6 address based on the request message and allocates a DHCP unique identifier DUID and an identity association identifier IAID for requesting the second IPv6 address; Receive a response message sent by the DHCPv6 server, which carries the DUID and IAID used to request the second IPv6 address, obtain the DUID and the IAID, and configure them on the virtual machine instance.

7. The IPv6 address configuration method according to claim 6, wherein: The request message includes the first IPv6 address and network configuration information; or The request message includes the first IPv6 address, network configuration information, and a user-specified address requested from the DHCPv6 server.

8. A DHCPv6 server, characterized in that: The DHCPv6 server includes: A receiving module, configured to receive a first DHCPv6 request message sent by a virtual machine instance; a configuration module, configured to parse the first DHCPv6 request message, determine the virtual machine image type to which the virtual machine instance belongs, and allocate a first IPv6 address to the virtual machine instance based on the virtual machine image type and in accordance with a set address allocation rule; a sending module, configured to send a DHCPv6 response message carrying the first IPv6 address to the virtual machine instance, so that the virtual machine instance establishes a connection with the virtual machine configuration server based on the first IPv6 address; The receiving module is further configured to receive a request message sent after the virtual machine configuration server successfully establishes a connection with the virtual machine instance; The configuration module is further configured to determine a pre-allocated second IPv6 address based on the request message and allocate a DHCP unique identifier DUID and an identity association identifier IAID for requesting the second IPv6 address, and record a correspondence between the second IPv6 address, the DUID, and the IAID; The sending module is further configured to send a response message carrying the DUID and the IAID to the virtual machine configuration server, so that the virtual machine configuration server configures the DUID and the IAID to the virtual machine instance; The receiving module is further configured to receive a second DHCPv6 request message sent by the virtual machine instance and carrying the DUID and the IAID; The configuration module is further configured to allocate the second IPv6 address to the virtual machine instance based on the DUID and the IAID; The sending module is further configured to send the second IPv6 address to the virtual machine instance.

9. A virtual machine configuration server, characterized in that: The virtual machine configuration server includes: A receiving module is used to monitor ICMPv6 neighbor advertisement messages in the network; A configuration module, configured to obtain the first IPv6 address in the monitored ICMPv6 neighbor advertisement message, and parse the virtual machine image type and set the virtual machine connection method according to the address allocation rule of the first IPv6 address; a sending module, configured to initiate a connection request using the first IPv6 address as a destination address based on the virtual machine connection method, so as to establish a connection with the virtual machine instance configured with the first IPv6 address; and after successfully establishing the connection with the virtual machine instance, send a request message to a DHCPv6 server, so that the DHCPv6 server determines a pre-allocated second IPv6 address based on the request message and allocates a DHCP unique identifier DUID and an identity association identifier IAID for requesting the second IPv6 address; The receiving module is further configured to receive a response message sent by the DHCPv6 server and carrying the DUID and IAID used to request the second IPv6 address; The configuration module is further configured to obtain the DUID and the IAID and configure them on the virtual machine instance.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the IPv6 address configuration method according to any one of claims 1 to 5 is implemented, or when the computer program is executed by a processor, the IPv6 address configuration method according to claim 6 or 7 is implemented.

Citation Information

Patent Citations

  • Automatic IPv6 address allocation method for virtual machine

    CN111818197A

  • Method for controlling client to be online, network equipment and client

    CN114124314A