Method and device for mapping multiple virtual machines by external network IP, medium and equipment

By creating external and private networks in a virtualized environment and establishing IP address mapping relationships, the problem of waste of IP addresses when virtual machines serve externally is solved, and efficient sharing of IP addresses and simplifying network management is achieved.

CN119728635APending Publication Date: 2025-03-28XIAN WANXIANG ELECTRONICS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411923360.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In a virtualized environment, when a virtual machine needs to provide services to the outside world, it usually requires a real IP address, which leads to wasting the IP address of the physical network, especially when there are a large number of virtual machines and a single service or internal communication.

Method used

By installing virtualization software on the host, creating an external network and a private network, and establishing a mapping relationship between the external network and the private network, so that the same IP address of the external network corresponds to the IP addresses of multiple virtual machines, thereby realizing the sharing of IP addresses.

Benefits of technology

This method uses a single or a small number of real IP addresses of the physical network in a virtualized scenario to dynamically bind the private network of the virtual machine, simplifying network configuration and management, and reducing IP address conflicts and waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728635A_ABST
    Figure CN119728635A_ABST
Patent Text Reader

Abstract

The invention relates to a method and device for mapping multiple virtual machines through an external network IP, a medium and equipment. Comprising the following steps: installing virtualization software of a virtual network on a host machine operated by a plurality of virtual machines to create an external network and a private network on the virtualization software; wherein the external network is a network on a physical network, and the private network is a network in the virtual machine; establishing a mapping relationship between the external network and the private network of the virtual machine; wherein the mapping relation comprises that the same IP address of the external network corresponds to the IP addresses of the plurality of virtual machines; and according to the mapping relationship, binding the same IP address of the external network with the IP addresses of the plurality of virtual machines so as to map the IP address of the external network to the plurality of virtual machines. According to the application, through the mapping relation established between the external network and the private network, the private network of the virtual machine is dynamically bound by using a single or a small number of real IP addresses of the physical network in a virtual scene, so that the IP address of the external network is mapped to a plurality of virtual machines.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] When a virtual machine provides external communication services, it needs an IP address that actually exists and is valid in the physical environment. However, when a large number of virtual machines exist in the same virtualization environment and need to provide external services, a large number of real IP addresses need to be provided. If some virtual machines provide relatively simple services or only involve internal communication, for example, only communication between virtual machine services, then in these scenarios, if a real IP address is provided for each virtual machine, a large number of real IP addresses of the physical network will be wasted.

[0003] Therefore, it is necessary to provide a new technical solution to improve one or more problems existing in the above solutions.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of this application is to provide a method, apparatus, medium and device for mapping multiple virtual machines to an external network IP, thereby overcoming one or more problems caused by limitations and defects of related technologies at least to a certain extent.

[0006] According to a first aspect of an embodiment of the present application, a method for mapping an external network IP to multiple virtual machines is provided, the method comprising:

[0007] By installing virtual network virtualization software on a host machine where multiple virtual machines are running, an external network and a private network are created on the virtualization software; wherein the external network is a network on a physical network, and the private network is a network inside the virtual machine;

[0008] Establishing a mapping relationship between the external network and the private network of the virtual machine; wherein the mapping relationship includes that the same IP address of the external network corresponds to the IP addresses of multiple virtual machines;

[0009] According to the mapping relationship, the same IP address of the external network is bound to the IP addresses of the multiple virtual machines, so as to map the IP address of the external network to the multiple virtual machines.

[0010] In an embodiment of the present application, the step of corresponding the same IP address of the external network to the IP addresses of multiple virtual machines includes:

[0011] The same IP address of the external network corresponds to different external ports, and the IP addresses of the multiple virtual machines all correspond to the same internal port; wherein the different external ports correspond to the internal ports.

[0012] In an embodiment of the present application, the step of binding the same IP address of the external network to the IP addresses of the multiple virtual machines according to the mapping relationship to map the IP address of the external network to the multiple virtual machines includes:

[0013] By correspondingly binding different external ports to the internal ports, the same IP address of the external network is bound to the IP addresses of the multiple virtual machines.

[0014] In an embodiment of the present application, after the step of binding the same IP address of the external network to the IP addresses of the multiple virtual machines according to the mapping relationship to map the IP address of the external network to the multiple virtual machines, the method further includes:

[0015] The same IP address of the external network is unbound from the IP addresses of the multiple virtual machines.

[0016] In an embodiment of the present application, the step of unbinding the same IP address of the external network from the IP addresses of the multiple virtual machines includes:

[0017] According to the same IP address and the external port of the external network, the mapping relationship between the external network and the multiple virtual machines is found, and the mapping relationship is deleted to unbind the same IP address of the external network from the IP addresses of the multiple virtual machines.

[0018] According to a second aspect of an embodiment of the present application, a device for mapping an external network IP to multiple virtual machines is provided, the device comprising:

[0019] A creation module, used to install virtual network virtualization software on a host machine where multiple virtual machines are running, so as to create an external network and a private network on the virtualization software; wherein the external network is a network on a physical network, and the private network is a network inside the virtual machine;

[0020] An establishing module, used to establish a mapping relationship between the external network and the private network of the virtual machine; wherein the mapping relationship includes that the same IP address of the external network corresponds to the IP addresses of multiple virtual machines;

[0021] The binding module is used to bind the same IP address of the external network to the IP addresses of the multiple virtual machines according to the mapping relationship, so as to map the IP address of the external network to the multiple virtual machines.

[0022] In the embodiment of the present application, it also includes:

[0023] The binding submodule is used to bind the same IP address of the external network to the IP addresses of multiple virtual machines by correspondingly binding different external ports to the internal ports.

[0024] In the embodiment of the present application, it also includes:

[0025] The unbinding module is used to unbind the same IP address of the external network from the IP addresses of the multiple virtual machines.

[0026] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps of the method for mapping an external network IP to multiple virtual machines described in any one of the above embodiments are implemented.

[0027] According to a fourth aspect of an embodiment of the present application, there is provided an electronic device, including:

[0028] Processor; and

[0029] A memory, configured to store executable instructions of the processor;

[0030] The processor is configured to execute the steps of the method for mapping an external network IP to multiple virtual machines in any one of the above embodiments by executing the executable instructions.

[0031] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0032] In one embodiment of the present application, through the above method, virtualization software is installed on the host machine where the virtual machine runs and an external network and a private network are created, and then a mapping relationship between the external network and the private network is established. Through the mapping relationship, a single or a small number of real IP addresses of the physical network are used in the virtualization scenario to dynamically bind the private network of the virtual machine, so as to realize mapping the IP address of the external network to multiple virtual machines, so that the virtual machine of the private network inside the virtualization platform or the service provided by the virtual machine can be accessed from the external network through the real IP address. This method simplifies network configuration and management, and reduces potential IP address conflicts and waste.

[0033] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0035] Figure 1 A flowchart schematically illustrating a method for mapping an external network IP to multiple virtual machines in an exemplary embodiment of the present application;

[0036] Figure 2 A schematic diagram schematically shows the binding of an external network and a private network in an exemplary embodiment of the present application;

[0037] Figure 3 A schematic diagram schematically shows a corresponding virtual machine bound with a private network IP address + internal port through an external network IP address + and an external port in an exemplary embodiment of the present application;

[0038] Figure 4 A block diagram schematically illustrates a device for mapping an external network IP to multiple virtual machines in an exemplary embodiment of the present application;

[0039] Figure 5 A schematic diagram of a program product in an exemplary embodiment of the present application is schematically shown;

[0040] Figure 6 A schematic diagram of an electronic device in an exemplary embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0041] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0042] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0043] This example implementation first provides a method for mapping an external network IP to multiple virtual machines. Figure 1 As shown in , the method may include: steps S101 to S103.

[0044] Wherein, step S101: installing virtual network virtualization software on a host machine where multiple virtual machines are running, so as to create an external network and a private network on the virtualization software; wherein the external network is a network on a physical network, and the private network is a network inside a virtual machine.

[0045] Step S102: Establish a mapping relationship between the external network and the private network of the virtual machine; wherein the mapping relationship includes that the same IP address of the external network corresponds to the IP addresses of multiple virtual machines.

[0046] Step S103: According to the mapping relationship, the same IP address of the external network is bound to the IP addresses of the multiple virtual machines, so as to map the IP address of the external network to the multiple virtual machines.

[0047] In one embodiment of the present application, through the above method, virtualization software is installed on the host machine where the virtual machine runs and an external network and a private network are created, and then a mapping relationship between the external network and the private network is established. Through the mapping relationship, a single or a small number of real IP addresses of the physical network are used in the virtualization scenario to dynamically bind the private network of the virtual machine, so as to realize mapping the IP address of the external network to multiple virtual machines, so that the virtual machine of the private network inside the virtualization platform or the service provided by the virtual machine can be accessed from the external network through the real IP address. This method simplifies network configuration and management, and reduces potential IP address conflicts and waste.

[0048] Next, we will refer to Figures 1 to 3 Each step of the above method in this example implementation is described in more detail.

[0049] In step S101, the present application installs virtual network virtualization software on a host machine where multiple virtual machines are running, and creates an external network and a private network on the virtualization software. The external network is a network that actually exists on the physical network, and the private network is a network inside the virtual machine. The purpose of creating the external network and the private network is mainly to break through the isolation between the external network and the private network inside the virtualization platform to achieve communication between the external network and the private network. Among them, the virtualization platform includes multiple virtual machines.

[0050] It should be noted that when the external network communicates with the private network, it is necessary to know the direction of the upstream and downstream traffic. Among them, the upstream traffic refers to the data sent by the virtual machine to the network service (i.e., external network) provider, such as uploading files, photos, and messages sent to the network server when browsing the web. Downstream traffic refers to the transmission data from the network service provider to the virtual machine, such as watching videos online, downloading files, etc.

[0051] In step S102, after the external network and the private network are created on the virtualization software, a mapping relationship between the two needs to be established. Since the mapping relationship is mainly about the relationship between the same IP address of the external network and the IP addresses of multiple virtual machines, after the external network and the private network are established, it is convenient to bind the IP address of the external network to the IP addresses of multiple virtual machines.

[0052] Furthermore, the step of corresponding the same IP address of the external network to the IP addresses of multiple virtual machines includes:

[0053] The same IP address of the external network corresponds to different external ports, and the IP addresses of multiple virtual machines correspond to the same internal port; wherein different external ports correspond to internal ports.

[0054] It should be noted that the IP addresses of the same network segment of the external network are the same, but the external ports are different. Through different external ports, the external network with the same IP address can be connected to other corresponding networks (such as the private network of the virtual machine). In the virtualization platform, the IP address of each virtual machine is different. The mapping relationship between the external network and the private network specifically means that the same IP address of the external network corresponds to different external ports, the IP addresses of multiple virtual machines correspond to the same internal port, and different external ports correspond to internal ports.

[0055] In step S103, based on the above mapping relationship, the same IP address of the external network can be bound to the IP addresses of different virtual machines.

[0056] Specifically, according to the mapping relationship, binding the same IP address of the external network to the IP addresses of the multiple virtual machines to map the IP addresses of the external network to the multiple virtual machines includes:

[0057] By binding different external ports to internal ports accordingly, the same IP address of the external network can be bound to the IP addresses of multiple virtual machines.

[0058] It should be noted that, through different ports of the external network, the same IP address of the external network is bound to the IP address of the private network of the corresponding virtual machine, so as to map the IP address of the external network to different virtual machines and realize the connection between the external network and the private network of the corresponding virtual machine. This application uses the real IP address of the external network plus the external port to access the virtual machine of the private network inside the virtualization platform, or the service provided by the virtual machine, thereby simplifying network configuration and management, and reducing potential IP address conflicts and waste.

[0059] It should also be noted that when binding multiple virtual machines, the external port of the external network cannot be repeated with the external port that has been bound, and other external ports need to be specified, that is, when binding the IP address of the external network with the IP address of the private network of the virtual machine, each external port can only be used once. In this way, the same IP address of the external network can be bound to the IP address of the private network of the corresponding virtual machine through different ports of the external network.

[0060] In one example, when binding multiple virtual machines, the external port of the external network cannot be repeated with the external port that has been bound, and other external ports need to be specified. For example, the IP address of the external network is 172.14.1.5, and the IP addresses of the private networks of the two virtual machines are 192.168.2.4 and 192.168.2.5 respectively. Under the secure network protocol, if the user wants to access the virtual machines with the private network IP address 192.168.2.4 and the virtual machine with the IP address 192.168.2.5 through the external network IP address 172.14.1.5, it is only necessary to establish a mapping relationship between the external network IP address 172.14.1.5 and the external port 8089 and the port 22 of the virtual machine IP address 192.168.2.4, and a mapping relationship between the external network IP address 172.14.1.5 and the external port 8090 and the port 22 of the virtual machine IP address 192.168.2.5. Under the security protocol, users can access the virtual machine at the private network IP address 192.168.2.4 through the external network IP address 172.14.1.5 and external port 8089, and can access the virtual machine at the private network IP address 192.168.2.5 through the external network IP address 172.14.1.5 and external port 8090.

[0061] In one embodiment, according to the mapping relationship, after binding the same IP address of the external network to the IP addresses of multiple virtual machines to map the IP address of the external network to the multiple virtual machines, the method further includes:

[0062] Unbind the same IP address of the external network from the IP addresses of multiple virtual machines.

[0063] In one embodiment, the step of unbinding the same IP address of the external network from the IP addresses of multiple virtual machines includes:

[0064] According to the same IP address of the external network and the external port, a mapping relationship between the external network and the multiple virtual machines is found, and the mapping relationship is deleted to unbind the same IP address of the external network from the IP addresses of the multiple virtual machines.

[0065] It should be noted that if the user does not need to access the virtual machine of the private network through the external network, the binding between the external network and the private network can be cancelled.

[0066] The specific process of unbinding is as follows:

[0067] You need to find the IP address and external port of the external network service provided on the virtualization software, find the mapping relationship based on the IP address and external port of the external network, and delete the mapping relationship. The services provided by the corresponding virtual machine cannot be accessed through the IP address and external port of the external network. For example: the external network IP address 172.14.1.5 and external port 8089 are bound to the security network protocol service of the virtual machine with IP address 192.168.2.4, and the external network IP address 172.14.1.5 and external port 8090 are bound to the security network protocol service of the virtual machine with IP address 192.168.2.5. If the user wants to remove the mapping relationship between the two virtual machines, he only needs to find the external network IP address 172.14.1.5 and external port 8090 in the virtualization software. 8089, the external network IP addresses 172.14.1.5 and 8090, are mapped to the virtual machines 192.168.2.4 and 192.168.2.5 respectively, and are deleted respectively. That is, the virtual machine with IP address 192.168.2.4 cannot be accessed through IP address 172.14.1.5 and external port 8089, and the virtual machine with IP address 192.168.2.5 cannot be accessed through IP address 172.14.1.5 and external port 8090.

[0068] It should be noted that, although the steps of the method in the present application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc. In addition, it is also easy to understand that these steps may be, for example, executed synchronously or asynchronously in multiple modules / processes / threads.

[0069] Furthermore, in this example implementation, a device for mapping an external network IP to multiple virtual machines is also provided. Figure 4 As shown in , the device 200 may include a creation module 201, an establishment module 202 and a binding module 203. Among them: the creation module 201 is used to create an external network and a private network on the virtualization software by installing virtual network virtualization software on a host machine where multiple virtual machines are running; wherein the external network is a network on a physical network, and the private network is a network inside a virtual machine; the establishment module 202 is used to establish a mapping relationship between the external network and the private network of the virtual machine; wherein the mapping relationship includes that the same IP address of the external network corresponds to the IP addresses of multiple virtual machines; the binding module 203 is used to bind the same IP address of the external network to the IP addresses of multiple virtual machines according to the mapping relationship, so as to map the IP address of the external network to the multiple virtual machines.

[0070] In one embodiment, it further includes:

[0071] The binding submodule is used to bind the same IP address of the external network to the IP addresses of multiple virtual machines by correspondingly binding different external ports to internal ports.

[0072] In one embodiment, it further includes:

[0073] The unbinding module is used to unbind the same IP address of the external network from the IP addresses of the multiple virtual machines.

[0074] In one embodiment, it further includes:

[0075] The unbinding submodule is used to find the mapping relationship between the external network and the multiple virtual machines according to the same IP address and the external port of the external network, and delete the mapping relationship to unbind the same IP address of the external network from the IP addresses of the multiple virtual machines.

[0076] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0077] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the implementation mode of the present application, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of a module or unit described above can be further divided into multiple modules or units for concretization. The components displayed as modules or units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present application scheme. Those of ordinary skill in the art can understand and implement it without paying creative work.

[0078] In an exemplary embodiment of the present application, a computer-readable storage medium is also provided, on which a computer program is stored, and when the program is included in a processor and executed, the steps of the method for mapping multiple virtual machines to an external network IP address in any of the above embodiments can be implemented. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the method for mapping multiple virtual machines to an external network IP address in the above description of this specification.

[0079] refer to Figure 5 As shown, a program product 300 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0080] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0081] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0082] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0083] In an exemplary embodiment of the present application, an electronic device is also provided, which may include a processor and a memory for storing executable instructions of the processor. The processor is configured to execute the steps of the method for mapping multiple virtual machines to an external network IP in any of the above embodiments by executing the executable instructions.

[0084] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0085] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present invention is described. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0086] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0087] The storage unit stores a program code, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps of various exemplary embodiments of the present invention described in the method of mapping multiple virtual machines to an external network IP address. For example, the processing unit 610 can perform the following steps: Figure 1 Follow the steps shown in .

[0088] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0089] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0090] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0091] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0092] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server or a network device, etc.) to execute the above-mentioned external network IP mapping method for multiple virtual machines according to the implementation method of the present application.

[0093] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

Claims

1. A method for mapping an external network IP to multiple virtual machines, characterized in that: The method includes: By installing virtual network virtualization software on a host machine where multiple virtual machines are running, an external network and a private network are created on the virtualization software; wherein the external network is a network on a physical network, and the private network is a network inside the virtual machine; Establishing a mapping relationship between the external network and the private network of the virtual machine; wherein the mapping relationship includes that the same IP address of the external network corresponds to the IP addresses of multiple virtual machines; According to the mapping relationship, the same IP address of the external network is bound to the IP addresses of the multiple virtual machines, so as to map the IP address of the external network to the multiple virtual machines.

2. The method for mapping multiple virtual machines to an external network IP according to claim 1, characterized in that: The same IP address of the external network corresponds to the IP addresses of multiple virtual machines, including: The same IP address of the external network corresponds to different external ports, and the IP addresses of the multiple virtual machines all correspond to the same internal port; wherein the different external ports correspond to the internal ports.

3. The method for mapping multiple virtual machines to an external network IP according to claim 2, characterized in that: The step of binding the same IP address of the external network to the IP addresses of the multiple virtual machines according to the mapping relationship to map the IP address of the external network to the multiple virtual machines includes: By correspondingly binding different external ports to the internal ports, the same IP address of the external network is bound to the IP addresses of the multiple virtual machines.

4. The method for mapping multiple virtual machines to an external network IP according to claim 3, characterized in that: After the step of binding the same IP address of the external network to the IP addresses of the multiple virtual machines according to the mapping relationship to map the IP address of the external network to the multiple virtual machines, the method further includes: The same IP address of the external network is unbound from the IP addresses of the multiple virtual machines.

5. The method for mapping multiple virtual machines to an external network IP according to claim 4, characterized in that: The step of unbinding the same IP address of the external network from the IP addresses of the multiple virtual machines includes: According to the same IP address and the external port of the external network, the mapping relationship between the external network and the multiple virtual machines is found, and the mapping relationship is deleted to unbind the same IP address of the external network from the IP addresses of the multiple virtual machines.

6. A device for mapping an external network IP to multiple virtual machines, characterized in that: The device includes: A creation module, used to install virtual network virtualization software on a host machine where multiple virtual machines are running, so as to create an external network and a private network on the virtualization software; wherein the external network is a network on a physical network, and the private network is a network inside the virtual machine; An establishing module, used to establish a mapping relationship between the external network and the private network of the virtual machine; wherein the mapping relationship includes that the same IP address of the external network corresponds to the IP addresses of multiple virtual machines; The binding module is used to bind the same IP address of the external network to the IP addresses of the multiple virtual machines according to the mapping relationship, so as to map the IP address of the external network to the multiple virtual machines.

7. The device for mapping an external network IP to multiple virtual machines according to claim 6, characterized in that: Also includes: The binding submodule is used to bind the same IP address of the external network to the IP addresses of multiple virtual machines by correspondingly binding different external ports to the internal ports.

8. The device for mapping an external network IP to multiple virtual machines according to claim 7, characterized in that: Also includes: The unbinding module is used to unbind the same IP address of the external network from the IP addresses of the multiple virtual machines.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for mapping an external network IP to multiple virtual machines as described in any one of claims 1 to 5 are implemented.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the steps of the method for mapping an external network IP to multiple virtual machines as described in any one of claims 1 to 5 by executing the executable instructions.

Citation Information

Cited By

  • Multi-IP motion controller, industrial equipment and control method

    CN120871718A