CN112988330A - Method and system for establishing virtual machine by designating ip address - Google Patents
Method and system for establishing virtual machine by designating ip address Download PDFInfo
- Publication number
- CN112988330A CN112988330A CN202110311282.7A CN202110311282A CN112988330A CN 112988330 A CN112988330 A CN 112988330A CN 202110311282 A CN202110311282 A CN 202110311282A CN 112988330 A CN112988330 A CN 112988330A
- Authority
- CN
- China
- Prior art keywords
- address
- virtual machine
- network
- virtual
- specifying
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 19
- 238000005315 distribution function Methods 0.000 claims abstract description 4
- 238000004891 communication Methods 0.000 claims description 8
- 238000013519 translation Methods 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 description 8
- 238000013459 approach Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/02—Standardisation; Integration
- H04L41/0213—Standardised network management protocols, e.g. simple network management protocol [SNMP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a method and a system for establishing a virtual machine by specifying an ip address, wherein the method comprises the following steps of 1: specifying an internal ip address; step 2: creating a virtual machine on a host machine by using iso files; and step 3: starting a dhcp network distribution function on a virtual machine; and 4, step 4: after the virtual machine is established, a gateway of the virtual machine is appointed, and a client on the virtual machine also uses the gateway; and 5: configuring a forwarding rule by using a router operating system, and forwarding the network traffic of the internal ip address to the specified external ip address traffic; step 6: and restarting the network after the router operating system is successfully configured. According to the method and the device, the user can conveniently create the virtual machine, the virtual machine is the user needing the ip, and meanwhile, the creation is simple and easy to realize, and the user does not need to enter the created virtual machine for configuration in person.
Description
Technical Field
The invention relates to the field of computer virtualization, in particular to a method and a system for creating a virtual machine by specifying an ip address.
Background
Computer virtualization technology generally refers to technology that allows a plurality of different operating systems to be used on one machine, and now, in the development of the technology, each operating system has its own ip address, and communication can be realized as long as the configuration is proper. Common technologies in the field of virtual machine development at present include a kvm virtual technology and a docker container virtual technology.
In the prior art, when a virtual machine is created, it is difficult to directly specify an ip address for creation. Generally, ip is randomly allocated through dhcp, or after the creation is completed, the created virtual machine is entered for configuration. If an ip address is specified for creation, only a fixed range (only a network which is allocated to a virtual machine by a host) can be specified for communication, otherwise, after configuration, the virtual machine has ip but cannot communicate. The invention aims to solve the problem that a network which is not allocated to a virtual machine by a host machine but can be used for designating an address of an internal network created by the non-host machine is designated, and the virtual machine can be bound with an external address through a routing management system, namely, the virtual machine is created by designating an address.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a method and a system for establishing a virtual machine by designating an ip address, wherein a virtualization technology and a virtualized host are interacted by a system virtualization module in combination with a background program and a management tool for managing the virtualization module, the system virtualization module can meet the requirement that a plurality of virtual machines (client machines) are operated on one physical machine (host machine), so that a user can conveniently establish the virtual machine which needs ip by the user, and the establishment is simple and easy to realize and does not need the user to personally enter the established virtual machine for configuration.
The invention discloses a method for establishing a virtual machine by specifying an ip address, which comprises the following steps:
step 1: specifying an internal ip address;
step 2: creating a virtual machine on a host machine by using iso files;
and step 3: starting a dhcp network distribution function on a virtual machine;
and 4, step 4: after the virtual machine is established, a gateway of the virtual machine is designated, and a client on the virtual machine also uses the gateway, so that network traffic of a virtual host and the client in the virtualization platform passes through the route;
and 5: configuring a forwarding rule by using a router operating system, and forwarding network traffic of an internal ip address to specified external ip address traffic, so that the traffic passing through the router can establish communication with the outside by a forwarding mode;
step 6: and restarting the network after the router operating system is successfully configured.
Preferably, the iso file contains a computer system that is supported and identified by the system virtualization module, the computer system is selected and configured by using a virtualization management tool, and after configuration is completed, the virtualization module virtualizes an image file with a suffix name qcow2 through the iso file according to parameters specified by the virtualization management tool.
After the ip address is specified, a virtual machine is established by the virtualization platform, so that the virtual machine has a specified function and a specified system, the ip address in the virtualization platform is obtained, communication is carried out in the virtual machine, a router operating system is enabled to obtain the internal ip address, network forwarding setting is configured, and the network traffic of the internal ip address is forwarded to the specified external ip address traffic.
The invention discloses a system for creating a virtual machine by specifying an ip address, which comprises the following steps: the virtual platform is used for establishing a virtual machine by specifying an ip address and comprises a virtual module and a virtual management tool, the router operating system is used for carrying out route forwarding, and the architecture of the router operating system is divided into: management plane, control plane, data forwarding plane. The virtualization technology operates on a server-level virtualization platform deployed in computer hardware, on which a user can recreate a host and use a virtualization management tool for management.
Preferably, the management plane provides configuration commands required by network management personnel to manage the routers using a mode including UCI, Web, SNMP and TR069, and to perform these management functions, and the management plane provides configuration parameters required by the control plane to operate normally.
Preferably, the control plane is used for controlling and managing the operation of all network protocols, including the management and control of ARP, DHCP, DNS and multicast protocols.
Preferably, the data forwarding plane is used for processing and forwarding various types of data on different network interfaces, including performing network address translation, routing, and ACL.
Preferably, the router operating system is two network cards, and an ip address of one network card is an internal ip address 192.168.10.254 and is a gateway of all internal virtual machines; the ip address of the virtualization platform is 192.168.10.253, and the ip address of the virtual machine on the virtualization platform is 192.168.10.x, which are both internal addresses.
Preferably, after the virtual machine is created by the ip address 192.168.10.253 of the virtualization platform, the created virtual machine has a designated gateway, i.e. the route management system 192.168.10.254, and its own gateway is also the route management system.
Preferably, the client on the virtual machine also uses a designated gateway, i.e., the route management system 192.168.10.254, through which network traffic for both the virtual host and the client within the virtualization platform passes.
The invention has the beneficial effects that: the method for establishing the virtual machine by designating the ip address can use a new network construction and corresponding mode, so that a user can conveniently establish the virtual machine which needs the ip, and meanwhile, the establishment is simple and easy to realize, and the user does not need to enter the established virtual machine for configuration in person.
Drawings
FIG. 1 is a basic schematic diagram of a method for specifying ip addresses to create a virtual machine according to the present invention.
FIG. 2 is a flow chart of a method for designating an ip address to create a virtual machine according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples and drawings, but the present invention is not limited thereto.
As shown in fig. 2, the present invention discloses a method for creating a virtual machine by specifying an ip address, which specifically includes:
step 1: specifying an internal ip address;
step 2: creating a virtual machine on a host machine by using iso files;
and step 3: starting a dhcp network distribution function on a virtual machine;
and 4, step 4: after the virtual machine is established, a gateway of the virtual machine is designated, and a client on the virtual machine also uses the gateway, so that network traffic of a virtual host and the client in the virtualization platform passes through the route;
and 5: configuring a forwarding rule by using a router operating system, and forwarding network traffic of an internal ip address to specified external ip address traffic, so that the traffic passing through the router can establish communication with the outside by a forwarding mode;
step 6: and restarting the network after the router operating system is successfully configured.
Furthermore, the iso file contains a computer system which is supported and identified by the system virtualization module, a virtualization management tool is used for selection and configuration, and after configuration is completed, the virtualization module virtualizes an image file with a suffix name of qcow2 through the iso file according to parameters specified by the virtualization management tool.
After the IP address is assigned, a virtual machine is established by a virtualization platform, so that the virtual machine has an assigned function and a system, an internal IP address of the virtualization platform can be obtained, communication is carried out inside the virtual machine, then a router operating system is enabled to obtain the internal IP address, network forwarding setting is configured, network traffic of the internal IP address is forwarded to be assigned external IP address traffic, and routing forwarding of the assigned IP is achieved.
As shown in fig. 1, the present invention discloses a system for designating ip addresses to create virtual machines, comprising: the virtual platform is used for establishing a virtual machine by specifying an ip address and comprises a virtual module and a virtual management tool, the router operating system is used for carrying out route forwarding, and the architecture of the router operating system is divided into: management plane, control plane, data forwarding plane. The virtualization technology operates on a server-level virtualization platform deployed in computer hardware, on which a user can recreate a host and use a virtualization management tool for management.
Furthermore, the virtualization technology operates on a server-level virtualization platform, the platform is deployed in computer hardware, and on the virtualization platform, a user can create a host and use a virtualization management tool for management.
Further, the management plane is to provide network management personnel to manage the router by using modes including UCI, Web, SNMP and TR069, and to execute configuration commands and the like required by the management functions, and the management plane provides configuration parameters required by the control plane to operate normally.
Further, the control plane is used for controlling and managing the operation of all network protocols, including the management and control of ARP, DHCP, DNS, and multicast protocols.
Further, the data forwarding plane is used for processing and forwarding various types of data on different network interfaces, including performing network address translation, routing, and ACL.
Furthermore, the router operating system in the method is two network cards, the ip address of one network card is an internal ip address 192.168.10.254, and the network cards are gateways of all internal virtual machines; the ip address of the virtualization platform is 192.168.10.253, and the ip address of the virtual machine on the virtualization platform is 192.168.10.x, which is an internal address.
Further, after the virtual machine is created by the ip address 192.168.10.253 of the virtualization platform in the method, the created virtual machine has a designated gateway, i.e., the route management system 192.168.10.254, and its own gateway is also the route management system.
Further, the client on the virtual machine also uses a designated gateway, i.e., the route management system 192.168.10.254, through which network traffic of both the virtual host and the client in the virtualization platform passes.
Furthermore, the router operating system may configure one-to-one forwarding rules, and enable the virtual machine on the virtualization platform to establish communication with the outside by forwarding the traffic passing through the router.
Further, the method for configuring the network forwarding setting comprises the following steps: and configuring firewall files and network files in a router operating system.
Further, firewall file can configure iptables forwarding chain DNAT to forward from one portal wan to another portal lan. The option proto is specified to forward the traffic including tcp and udp protocols. The forwarded destination address option dest _ ip is an internal address, and the forwarded source address option src _ dip is an external address. Each ip address is forwarded in a one-to-one correspondence, and can be named as a different name (option name).
An address with an internal address of 192.168.10.2, which is forwarded as an external ip address 172.16.20.25. It should be configured as a firewall file with the following added at the end of the file.
config redirect
option target 'DNAT'
option src 'wan'
option dest 'lan'
option proto 'tcp udp'
option dest_ip '192.168.10.2'
option name 'OpenWRT-45'
option src_dip '172.16.20.25'
The network file may configure the external address and gateway, subnet mask, to forward. The following should be changed at the end:
config interface 'lan'
option ipaddr '192.168.10.254'
option netmask '255.255.255.0'
……
config interface 'WAN1'
option gateway '172.16.20.254'
list ipaddr '172.16.20.178/24'
list ipaddr '172.16.20.25/24'
the lan port is configured to make the routing system an internal ip gateway, so that the ip address is 192.168.10.254, and the subnet mask is 255.255.255.0.
The configuration of port wan1 allows gateway to be configured as an external gateway to the entire external network environment. list ipaddr '172.16.20.25/24' indicates that the configured forwarding is 172.16.20.25,/24 indicates that the subnet mask is 255.255.255.0 and prefix is 24. But not the netmask approach, but the prefix approach. The prefix here may not correspond to the netmask configured by the lan port.
After the configuration is completed, the network is restarted, the external ip address can be accessed from the outside, the traffic is actually forwarded to the internal ip address through the route forwarding system, and the computer which is actually accessed is an internal computer.
The above description is a preferred embodiment of the present invention, but the present invention is not limited to the above description, and any other changes, modifications, substitutions, blocks and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and they are included in the scope of the present invention.
Claims (9)
1. A method for specifying an ip address to create a virtual machine, comprising:
step 1: specifying an internal ip address;
step 2: creating a virtual machine on a host machine by using iso files;
and step 3: starting a dhcp network distribution function on a virtual machine;
and 4, step 4: after the virtual machine is established, a gateway of the virtual machine is designated, and a client on the virtual machine also uses the gateway, so that network traffic of a virtual host and the client in the virtualization platform passes through the route;
and 5: configuring a forwarding rule by using a router operating system, and forwarding network traffic of an internal ip address to specified external ip address traffic, so that the traffic passing through the router can establish communication with the outside by a forwarding mode;
step 6: and restarting the network after the router operating system is successfully configured.
2. The method according to claim 1, wherein in step 2, the computer system identified by the system virtualization module contained in the iso file is selected and configured by using a virtualization management tool, and after configuration is completed, the virtualization module virtualizes an image file through the iso file according to parameters specified by the virtualization management tool.
3. A system for specifying an ip address to create a virtual machine, comprising: the virtual platform is used for establishing a virtual machine by specifying an ip address and comprises a virtual module and a virtual management tool, the router operating system is used for carrying out route forwarding, and the architecture of the router operating system is divided into: management plane, control plane, data forwarding plane.
4. The system of claim 3, wherein the management plane provides network management personnel to manage the routers using a method including UCI, Web, SNMP and TR069, and configuration commands required to perform these management functions, and the management plane provides configuration parameters required for the control plane to operate properly.
5. The system of claim 3, wherein the control plane is configured to control and manage the operation of all network protocols, including the management and control of ARP, DHCP, DNS, and multicast protocols.
6. A system for specifying ip addresses to create virtual machines as claimed in claim 3 wherein said data forwarding plane is configured to process and forward various types of data on different network interfaces including network address translation, routing, ACL.
7. The system for creating the virtual machine by specifying the ip address according to claim 3, wherein the router operating system comprises two network cards, the ip address of one network card is an internal ip address, and the network cards are gateways of all internal virtual machines; the ip address of the virtualization platform and the ip address of the virtual machine on the virtualization platform are both internal addresses.
8. The system for specifying ip addresses for creating virtual machines according to claim 3, wherein the created virtual machine has a specified gateway after the creation of the virtual machine by the ip address of the virtualization platform.
9. The system for specifying ip addresses to create virtual machines according to claim 3, wherein the clients on the virtual machines use specified gateways through which network traffic of both the virtual hosts and the clients within the virtualization platform passes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110311282.7A CN112988330A (en) | 2021-03-24 | 2021-03-24 | Method and system for establishing virtual machine by designating ip address |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110311282.7A CN112988330A (en) | 2021-03-24 | 2021-03-24 | Method and system for establishing virtual machine by designating ip address |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112988330A true CN112988330A (en) | 2021-06-18 |
Family
ID=76333332
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110311282.7A Pending CN112988330A (en) | 2021-03-24 | 2021-03-24 | Method and system for establishing virtual machine by designating ip address |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112988330A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116074284A (en) * | 2023-04-07 | 2023-05-05 | 广东保伦电子股份有限公司 | Method for acquiring IP address between virtual machines under PVE platform |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102231708A (en) * | 2011-07-04 | 2011-11-02 | 清华大学 | Virtual routing device and routing method thereof |
US20130191912A1 (en) * | 2011-07-26 | 2013-07-25 | Somnath Chakrabarti | Secure network topology on a virtualized server |
CN111193665A (en) * | 2019-12-31 | 2020-05-22 | 江苏省未来网络创新研究院 | Docker-based realization of virtualized router and method thereof |
CN111459606A (en) * | 2020-03-03 | 2020-07-28 | 山东汇贸电子口岸有限公司 | Method for quickly creating virtual machine under virtualization and server |
CN112165432A (en) * | 2020-09-07 | 2021-01-01 | 广州锦行网络科技有限公司 | Method for realizing communication between OpenStack virtual machine and outside |
-
2021
- 2021-03-24 CN CN202110311282.7A patent/CN112988330A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102231708A (en) * | 2011-07-04 | 2011-11-02 | 清华大学 | Virtual routing device and routing method thereof |
US20130191912A1 (en) * | 2011-07-26 | 2013-07-25 | Somnath Chakrabarti | Secure network topology on a virtualized server |
CN111193665A (en) * | 2019-12-31 | 2020-05-22 | 江苏省未来网络创新研究院 | Docker-based realization of virtualized router and method thereof |
CN111459606A (en) * | 2020-03-03 | 2020-07-28 | 山东汇贸电子口岸有限公司 | Method for quickly creating virtual machine under virtualization and server |
CN112165432A (en) * | 2020-09-07 | 2021-01-01 | 广州锦行网络科技有限公司 | Method for realizing communication between OpenStack virtual machine and outside |
Non-Patent Citations (1)
Title |
---|
唐柱斌: "《Windows Server 2012配置与管理项目教程》", 30 June 2019, 京:北京理工大学出版社, pages: 178 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116074284A (en) * | 2023-04-07 | 2023-05-05 | 广东保伦电子股份有限公司 | Method for acquiring IP address between virtual machines under PVE platform |
CN116074284B (en) * | 2023-04-07 | 2023-06-30 | 广东保伦电子股份有限公司 | Method for acquiring IP address between virtual machines under PVE platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10972341B2 (en) | Subnet stretching via layer three communications | |
US7940791B2 (en) | Router for establishing connectivity between a client device and on-board systems of an airplane | |
US8667574B2 (en) | Assigning a network address for a virtual device to virtually extend the functionality of a network device | |
CN112511431B (en) | Routing flow fusion method for virtual network simulation | |
WO2020180776A1 (en) | Network access controller operation | |
US11558246B2 (en) | Implementing service function chains | |
CN107547403B (en) | Message forwarding method, message assistance device, controller and host | |
KR20190047002A (en) | Distributed customer premises equipment | |
US10756966B2 (en) | Containerized software architecture for configuration management on network devices | |
CN112988330A (en) | Method and system for establishing virtual machine by designating ip address | |
US12028311B2 (en) | Methods and systems for efficient virtualization of inline transparent computer networking devices | |
CN102780584B (en) | Method and device for quickly accessing network management system of Ethernet equipment | |
JP6968226B2 (en) | How to control the network | |
JP5350333B2 (en) | Packet relay apparatus and network system | |
GB2559660B (en) | Implementing service function chains | |
CN113965509A (en) | Routing method, cross-device link aggregation group, device, storage medium and network | |
CN112769870B (en) | Method for generating massive ip detection threats across network segments | |
US20230179516A1 (en) | Router device, packet transfer method and packet transfer program | |
Hoogendoorn et al. | Logical Switching | |
Araji | Embedding Location-Based Network Connectivity within IPv6 Address | |
Rajamohan Parthasarathy | Design And Configuration Of Static Network Address Translation Techniques Method Using Cisco Packet Tracer Tool |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |