CN110213391A - A kind of configuration method and device of internet protocol address - Google Patents

A kind of configuration method and device of internet protocol address Download PDF

Info

Publication number
CN110213391A
CN110213391A CN201910629139.5A CN201910629139A CN110213391A CN 110213391 A CN110213391 A CN 110213391A CN 201910629139 A CN201910629139 A CN 201910629139A CN 110213391 A CN110213391 A CN 110213391A
Authority
CN
China
Prior art keywords
virtual machine
address
network protocol
protocol address
network
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.)
Granted
Application number
CN201910629139.5A
Other languages
Chinese (zh)
Other versions
CN110213391B (en
Inventor
赵世济
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910629139.5A priority Critical patent/CN110213391B/en
Publication of CN110213391A publication Critical patent/CN110213391A/en
Application granted granted Critical
Publication of CN110213391B publication Critical patent/CN110213391B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/686Types of network addresses using dual-stack hosts, e.g. in Internet protocol version 4 [IPv4]/Internet protocol version 6 [IPv6] networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the present application discloses the configuration method and device of a kind of internet protocol address, this method comprises: determining the virtual machine mark of virtual machine, the first network protocol configuration information of virtual machine is inquired from database based on virtual machine mark, wherein first network protocol configuration information includes the media access control physical address of virtual machine and the network identity of the affiliated master network of virtual machine;Determine the corresponding configuration file of network identity;Target network protocol address is obtained, physical address and target network protocol address are added in configuration file;It is virtual machine configuration target network protocol address according to the configuration file comprising target network protocol address.Using the embodiment of the present application, it can be achieved that online virtual machine reduces upgrade cost, strong applicability from IPv4 smooth upgrade to IPv4/IPv6 dual stack.

Description

A kind of configuration method and device of internet protocol address
Technical field
This application involves field of computer technology more particularly to the configuration methods and device of a kind of internet protocol address.
Background technique
With the rapid development of internet, Internet Protocol Version 4 (Internet Protocol version 4, IPv4) The contradiction of address space shortage is increasingly prominent, therefore Internet protocol the 6th edition (Internet Protocol version 6, IPv6) it is designed and proposes, to redefine address space, to solve the problems, such as Address Run Short as next generation optical transmission network.With This simultaneously, the development of cloud computing produces very big demand to IPv6 address resource, and most enterprises mostly use third party to set at present One IPv4/IPv6 conversion middleware of standby or independent research with realize same virtual machine can either with IPv4 system communication, again It can be with IPv6 system communication.But this mode is more serious to hardware-dependent, and property not good for system stability, therefore how Realize that the smooth transition of virtual machine dual stack from IPv4 to IPv4/IPv6 becomes currently urgently without interrupting the service It solves the problems, such as.
Summary of the invention
The embodiment of the present application provides the configuration method and device of a kind of internet protocol address.Can be achieved online virtual machine from IPv4 smooth upgrade reduces upgrade cost, strong applicability to IPv4/IPv6 dual stack.
In a first aspect, the embodiment of the present application provides a kind of configuration method of internet protocol address, this method comprises:
The virtual machine mark for determining virtual machine inquires from database the of above-mentioned virtual machine based on above-mentioned virtual machine mark One network protocol configuration information, wherein above-mentioned first network protocol configuration information includes the physical address, above-mentioned of above-mentioned virtual machine The first network protocol address of virtual machine and the network identity of the affiliated master network of above-mentioned virtual machine, above-mentioned first network agreement Location is the internet protocol address communicated based on first network agreement;
Determine the corresponding configuration file of above-mentioned network identity;
Target network protocol address is obtained, above-mentioned physical address and above-mentioned target network protocol address are added to above-mentioned match It sets in file, above-mentioned target network protocol address is the internet protocol address communicated based on the second network protocol, above-mentioned Two network protocols and above-mentioned first network agreement be not identical;
It is the above-mentioned target network association of above-mentioned virtual machine configuration according to the configuration file comprising above-mentioned target network protocol address Discuss address.
The embodiment of the present application passes through the target network protocol address that will acquire and physical address is added to configuration file, with The destination network addresses of virtual machine are configured according to updated configuration file, mode of operation is easy and not easy to make mistakes, reduces simultaneously Upgrade cost of the IPv4 smooth upgrade to IPv4/IPv6, strong applicability.
With reference to first aspect, above-mentioned after above-mentioned acquisition target network protocol address in a kind of possible embodiment Method further include:
The corresponding relationship of above-mentioned physical address Yu above-mentioned target network protocol address is established, and above-mentioned corresponding relationship is added To above-mentioned configuration file;
Wherein, above-mentioned corresponding relationship is used to search to obtain above-mentioned target network protocol address based on above-mentioned physical address.
It is empty that configuration can be improved by establishing the corresponding relationship of physical address Yu target network protocol address in the embodiment of the present application The accuracy of the destination network addresses of quasi- machine, should be readily appreciated that and mode of operation is easy, strong applicability.
With reference to first aspect, in a kind of possible embodiment, above-mentioned basis includes above-mentioned target network protocol address Configuration file, be the above-mentioned target network protocol address of above-mentioned virtual machine configuration, comprising:
It resets internet protocol address and configures process;
The internet protocol address that above-mentioned virtual machine is sent is obtained based on the above-mentioned internet protocol address configuration process after resetting Configuring request, above-mentioned internet protocol address configuring request are used for the net that request is communicated based on above-mentioned second network protocol Network protocol address includes above-mentioned physical address in above-mentioned internet protocol address configuring request;
Based on above-mentioned internet protocol address configuration process, in conjunction with above-mentioned physical address and above-mentioned corresponding relationship from above-mentioned configuration The corresponding above-mentioned target network protocol address of above-mentioned physical address is obtained in file, and above-mentioned target network protocol address is sent To above-mentioned virtual machine.
The embodiment of the present application, which configures process by resetting internet protocol address, makes configuration file come into force, and is based on network protocol Address configuration process is virtual machine configuration target network protocol address, easy to operate and not easy to make mistakes, strong applicability.
With reference to first aspect, in a kind of possible embodiment, the above method further include:
When above-mentioned virtual machine, which closes the configuration information restarted and in above-mentioned configuration file, to be emptied, from above-mentioned database The history configuration information of above-mentioned virtual machine is obtained, above-mentioned history configuration information includes at least above-mentioned physical address, above-mentioned target network Network protocol address and above-mentioned corresponding relationship;
Above-mentioned history configuration information is added to above-mentioned configuration file.
The embodiment of the present application can be improved virtual machine and match by the way that the history configuration information in database is added to configuration file The efficiency set should be readily appreciated that and easy to operate that applicability is high.
With reference to first aspect, in a kind of possible embodiment, above-mentioned virtual machine belongs to first in above-mentioned master network Network protocol subnet, the virtual machine in above-mentioned first network protocol sub-networks are based on above-mentioned first network agreement and are communicated;
Above-mentioned acquisition target network protocol address, comprising:
The second network protocol subnet is created, above-mentioned second network protocol subnet is a subnet in above-mentioned master network, on The virtual machine stated in the second network protocol subnet is communicated based on above-mentioned second network protocol, above-mentioned second network protocol subnet In include multiple second internet protocol addresses;
Any second internet protocol address is obtained from above-mentioned multiple second internet protocol addresses as target network agreement Address.
The embodiment of the present application can determine that in the second network protocol subnet to include more by creating the second network protocol subnet A second internet protocol address, improves the selection flexibility of target network protocol address, while broadcast storm can be effectively suppressed, Applicability is high.
With reference to first aspect, above-mentioned to establish above-mentioned physical address and above-mentioned target network in a kind of possible embodiment The corresponding relationship of network protocol address, comprising:
Obtain the data format that above-mentioned configuration file includes;
Above-mentioned physical address and above-mentioned target network protocol address are combined on to establish according to above-mentioned data format State the corresponding relationship of physical address Yu above-mentioned target network protocol address.
The embodiment of the present application establishes physical address pass corresponding with target network protocol address according to the data format of acquisition System has standardized the format of the configuration information in configuration file, and mode of operation is easy and not easy to make mistakes, and applicability is high.
Second aspect, the embodiment of the present application provide a kind of configuration device of internet protocol address, which includes:
First network protocol configuration information obtains module, for determining that the virtual machine of virtual machine identifies, based on above-mentioned virtual Machine identifies the first network protocol configuration information that above-mentioned virtual machine is inquired from database, wherein above-mentioned first network protocol configuration Information includes the physical address of above-mentioned virtual machine, the first network protocol address of above-mentioned virtual machine and above-mentioned virtual machine institute owner The network identity of network, above-mentioned first network protocol address are the internet protocol address communicated based on first network agreement;
Configuration file determining module, for determining that above-mentioned first network protocol configuration information obtains the above-mentioned net that module determines Network identifies corresponding configuration file;
Configuration file update module, for obtaining target network protocol address, by above-mentioned first network protocol configuration information It is true that the above-mentioned physical address and above-mentioned target network protocol address that acquisition module determines are added to above-mentioned configuration file determining module In fixed above-mentioned configuration file, above-mentioned target network protocol address is the network protocol that is communicated based on the second network protocol Location, above-mentioned second network protocol and above-mentioned first network agreement be not identical;
Target network protocol address configuration module, for according to the above-mentioned configuration text comprising above-mentioned target network protocol address The configuration file that part update module determines is the above-mentioned target network protocol address of above-mentioned virtual machine configuration.
In conjunction with second aspect, in a kind of possible embodiment, above-mentioned apparatus further include:
Corresponding relation building module obtains the above-mentioned object that module determines for establishing above-mentioned first network protocol configuration information Manage the corresponding relationship for the above-mentioned target network protocol address that address and above-mentioned configuration file update module determine, and by above-mentioned correspondence Relationship is added to above-mentioned configuration file;
Wherein, above-mentioned corresponding relationship is used to search to obtain above-mentioned target network protocol address based on above-mentioned physical address.
In conjunction with second aspect, in a kind of possible embodiment, above-mentioned target network protocol address configuration module includes:
Internet protocol address configures process reset cell, for resetting internet protocol address configuration process;
Internet protocol address configuring request acquiring unit, for configuring process based on the above-mentioned internet protocol address after resetting The internet protocol address configuring request that above-mentioned virtual machine is sent is obtained, above-mentioned internet protocol address configuring request is used for request It include above-mentioned based on the internet protocol address that above-mentioned second network protocol is communicated, in above-mentioned internet protocol address configuring request Physical address;
Target network protocol address transmission unit, for configuring process, in conjunction with above-mentioned object based on above-mentioned internet protocol address Manage address and above-mentioned corresponding relationship the corresponding above-mentioned target network agreement of above-mentioned physical address is obtained from above-mentioned configuration file Location, and above-mentioned target network protocol address is sent to above-mentioned virtual machine.
In conjunction with second aspect, in a kind of possible embodiment, the configuration device of above-mentioned internet protocol address further include:
Configuration file loading module, for closing the configuration information quilt restarted and in above-mentioned configuration file when above-mentioned virtual machine When emptying, the history configuration information of above-mentioned virtual machine is obtained from above-mentioned database, above-mentioned history configuration information includes at least upper State physical address, above-mentioned target network protocol address and above-mentioned corresponding relationship;Above-mentioned history configuration information is added to above-mentioned Configuration file.
In conjunction with second aspect, in a kind of possible embodiment, above-mentioned virtual machine belongs to first in above-mentioned master network Network protocol subnet, the virtual machine in above-mentioned first network protocol sub-networks are based on above-mentioned first network agreement and are communicated;It is above-mentioned The configuration device of internet protocol address further include:
Second network protocol subnet creation module, for creating the second network protocol subnet, above-mentioned second network protocol Net is a subnet in above-mentioned master network, and the virtual machine in above-mentioned second network protocol subnet is based on above-mentioned second network protocol It is communicated, includes multiple second internet protocol addresses in above-mentioned second network protocol subnet;It is assisted from above-mentioned multiple second networks View obtains any second internet protocol address as target network protocol address in address.
In conjunction with second aspect, in a kind of possible embodiment, above-mentioned corresponding relation building module is specifically used for:
Obtain the data format that above-mentioned configuration file includes;
Above-mentioned physical address and above-mentioned target network protocol address are combined on to establish according to above-mentioned data format State the corresponding relationship of physical address Yu above-mentioned target network protocol address.
The third aspect, the embodiment of the present application provide a kind of terminal device, which includes processor and memory, The processor and memory are connected with each other.The memory for store support the terminal device execute above-mentioned first aspect and/or The computer program for the method that any possible implementation of first aspect provides, which includes program instruction, The processor is configured for calling above procedure instruction, executes above-mentioned first aspect and/or first aspect is any possible Method provided by embodiment.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, the computer-readable storage medium Matter is stored with computer program, which includes program instruction, which makes at this when being executed by a processor It manages device and executes method provided by above-mentioned first aspect and/or any possible embodiment of first aspect.
Implement the embodiment of the present application, has the following beneficial effects:
The embodiment of the present application passes through the virtual machine mark for determining virtual machine, can be inquired from database based on virtual machine mark To the first network protocol configuration information including physical address and network identity.By obtaining target network protocol address, can incite somebody to action Physical address and target network protocol address are added in the corresponding configuration file of network identity, are then based on the configuration file and are Virtual machine configuration target network protocol address.Using the embodiment of the present application, it can be achieved that online virtual machine from IPv4 smooth upgrade to IPv4/IPv6 reduces upgrade cost, strong applicability.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is the configuration diagram of communication system provided by the embodiments of the present application;
Fig. 2 is the system architecture schematic diagram of IPv4 network provided by the embodiments of the present application;
Fig. 3 is one flow diagram of configuration method of internet protocol address provided by the embodiments of the present application;
Fig. 4 is the application scenarios schematic diagram of configuration file provided by the embodiments of the present application;
Fig. 5 is the application scenarios schematic diagram that IPv6 subnet is created under same master network provided by the embodiments of the present application;
Fig. 6 is the application scenarios schematic diagram of more new configuration file provided by the embodiments of the present application;
Fig. 7 is the application scenarios schematic diagram of the configuration method of internet protocol address provided by the embodiments of the present application;
Fig. 8 is the system architecture schematic diagram of IPv4/IPv6 network provided by the embodiments of the present application;
Fig. 9 is another flow diagram of configuration method of internet protocol address provided by the embodiments of the present application;
Figure 10 is the structural schematic diagram of the device provided by the embodiments of the present application for realizing IPv4/IPv6 dual stack;
Figure 11 is the structural schematic diagram of terminal device provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.
The configuration method of internet protocol address provided by the embodiments of the present application, be widely portable to it is various can be to online void Cloud platform, server or the terminal device of quasi- machine Configuration network protocol address.Wherein, online virtual machine, which refers to, has created IPv4 Network or IPv6 network and the virtual machine that can operate normally business, that is, created and running virtual machine.Terminal device Including but not limited to smart phone, tablet computer, laptop and desktop computer etc., herein with no restrictions.Cloud platform packet Include but be not limited to OpenStack cloud platform etc., herein with no restrictions, for convenience of describing, it will all be carried out by taking cloud platform as an example below Explanation.It is the configuration diagram of communication system provided by the embodiments of the present application referring to Fig. 1, Fig. 1.As shown in Figure 1, the application is implemented The communication system that example provides includes cloud platform and virtual machine, and wherein virtual machine includes virtual machine A, virtual machine B ..., virtual machine C. The internet protocol address configuring request that cloud platform is sent by receiving any virtual machine, can be according to internet protocol address configuring request In include physical address, the corresponding internet protocol address of the physical address is sent to the virtual machine.
For convenience of understanding, below before being illustrated to method provided by the embodiments of the present application, to the embodiment of the present application Relevant knowledge involved in the method for offer is simply described below:
1, information technology (Information Technology, IT) environment of enterprise and service supplier are continuous It develops, inexorable trend of the cloud computing as enterprise's IT future development provides completely new services selection for corporate client, together When the requirement of agility also is proposed to service offering.Cloud computing is increase based on internet related service, uses and deliver Mode, it provides the resource that dynamic easily extends and be virtualization by internet.For simple, cloud computing utilizes interconnection The storage and processing process of data is transferred on internet by the transmittability of net from local server, it is not a kind of new skill Art, but the product of the tradition IT technology such as distributed computing, parallel computation, network storage, virtualization development fusion, are a kind of clothes Business mode.Cloud computing is divided into narrow sense cloud computing and broad sense cloud computing.Narrow sense cloud computing refers to the delivery and use of IT infrastructure Mode refers to the resource (hardware, platform, software) needed for obtaining by network with on-demand, easy extension way.The net of resource is provided Network is referred to as " cloud ".Broad sense cloud computing refers to the delivery and use pattern of service, refers to through network with on-demand, easy extension way Service needed for obtaining, this service can be IT infrastructure and software, be also possible to any other services.
Virtualization technology is always the important pushing factor of cloud computing development.As the architecture of cloud computing, desktop is deposited Storage and the virtualization of server have all developed like a raging fire, and network virtualization, so that being all the network friendship of architecture Exchange device supports network virtualization multi-tenant architecture, and physical network and logical network are efficiently separated, the clothes of cloud computing are met Business characteristic, while improving the utilization rate of Internet resources.It in simple terms, can be in a physics using mainframe virtualization technology Multiple virtual machines are run on host, and between each virtual machine it is mutually indepedent, be independent of each other, user can be clever on a virtual machine Any software of installation living.The application program run on same host of mainframe virtualization technology insulation avoids resource punching It is prominent, while can dynamically move to the hardware resource not made full use of in the most desirable application program, to improve bottom The utilization rate of layer hardware resource.Be continuously increased along with the quantity of virtual machine, IP address quantity needed for leading to cloud computing also at Ratio increases.
2, transmission control protocol/network protocol (Transfer Control Protocol/Internet Protocol, It TCP/IP) is communication protocol most basic in the current network system most successful in the world and protocol specification and network.IP association View is the agreement of network layer in TCP/IP protocol suite, it is the core protocol of TCP/IP protocol suite, the version number of current IP protocol It is 4, i.e. IPv4.IPv4 be Internet engineering task force (The Internet Engineering Task Force, IETF) first version being widely deployed of the 4th revision version and this agreement in Internet protocol development process. IPv4, which is developed so far, to be used for thirties years, and it theoretically can be entire that IPv4, which uses 32 (4 byte) address sizes, More than 40 hundred million host assignment addresses on Internet.But with internet flourish, IPv4 define limitedly Location space will be depleted quickly, and the deficiency of address space will hinder the further development of internet.Therefore IPv6 is designed And propose that the IP next generation protocol as substitution IPv4 solves the problems, such as Address Run Short to redefine address space.IPv6 is used 128 (16 byte) address sizes, to IPv6 actually assignable address by conservative approach estimate, every square metre of the entire earth A IP address more than 1000 can be distributed on area.Other than once and for all solves IP address shortage problem, IPv6's Also other problems insoluble in IPv4 are considered in design process, such as end-to-end IP connection, service quality (QoS), the problems such as safety, multicast, mobility, plug and play.
In the embodiment of the present application, first network agreement may include IPv4 agreement or IPv6 agreement, herein with no restrictions, Two network protocols may also comprise IPv4 agreement or IPv6 agreement, herein with no restrictions, and first network agreement and the second network association View is different.Such as when first network agreement is IPv4 agreement, the second network protocol is IPv6 agreement;When first network agreement is When IPv6 agreement, the second network protocol is IPv4 agreement.For convenience of description, below all embodiments described herein all with First network agreement be IPv4 agreement, the second network protocol be IPv6 agreement for be illustrated.
3, OpenStack is that the open source cloud computing that OpenStack community development personnel and cloud computing technology expert develop is flat Platform, it is intended to be provided simply for the cloud infrastructure of public cloud and private clound, can extend and enrich on a large scale the solution party of function Case.OpenStack is developed so far, and is integrated with following several components in total: Nova (calculating service), Neutron (network service), Swift (object storage service), Cinder (block storage service), Glance (mirroring service), Keystone (authentication service), Horizon (UI service), Ceilometer (monitoring service), Heat (cluster service) and Trove (database service).
4, a core component of the Neutron as OpenStack, it can provide net for entire OpenStack environment Network is supported, including Layer2 switching, three-layer routing, load balancing, firewall and Virtual Private Network (Virtual Private Network, VPN) etc..Neutron provides a flexible frame, by configuring, either open source or business software all It can be used to realize these functions.The Internet resources of Neutron management include master network (network), subnet (subnet) With port (port).Wherein, network can be regarded as the L 2 broadcast domain of an isolation, and subnet can be regarded as one IP address pond (IPv4 address pool or IPv6 address pool).It is one-to-many relationship between network and subnet, i.e., one There can be multiple and different subnet under network, but a subnet can only belong to a network, the embodiment of the present application The IPv4 subnet (i.e. IPv4subnet) and IPv6 subnet (i.e. IPv6subnet) of middle building come under the same network, i.e., IPv4subnet and IPv6subnet shares the L 2 broadcast domain of an isolation.Port can be regarded as one on virtual switch A port defines physical address and internet protocol address, i.e. medium access control (Media Access on port Control, MAC) address and IP address (address IPv4 and/or the address IPv6), here port IP address (address IPv4 or The address IPv6) it is the distribution from subnet (i.e. IPv4 address pool or IPv6 address pool).When the Microsoft Loopback Adapter of virtual machine When (Virtual Interface, VIF) is connected on port, i.e. when the VIF and port of virtual machine are bound, port can be incited somebody to action Physical address and IP address (address IPv4 and/or the address IPv6) distribute to VIF, are here one-to-one between port and VIF Relationship.
5, Neutron provide dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) component serviced is DHCP agent.When DHCP agent is run on the network node, default is realized by dnsmasq DHCP function.Dnsmasq is one and provides the open source software of DHCP and DNS service, when it is as DNS name resolution server When, the connection speed to the network address accessed can be improved by caching DNS request, when it is as Dynamic Host Configuration Protocol server, can used In distribution IP address and offer routing etc..The embodiment of the present application only focuses on dnsmasq and provides the function of DHCP service, that is, works as creation Network and when enabling DHCP on subnet, the DHCP agent on network node will start a dnsmasq process be should Network provides DHCP service.Dnsmasq process and network are one-one relationships, i.e., a dnsmasq process can be All subnet provide DHCP service in same network.
The configuration method of internet protocol address provided by the embodiments of the present application, by determining that the virtual machine of virtual machine identifies, It can be identified based on virtual machine and inquire from database the first network protocol configuration information of the virtual machine (i.e. IPv4 matches confidence Breath), wherein first network protocol configuration information include the physical address of virtual machine, virtual machine first network protocol address (i.e. The address IPv4) and the affiliated master network of virtual machine network identity.It determines the corresponding configuration file of network identity, passes through acquisition Target network protocol address (i.e. the address IPv6), physical address and target network protocol address is added in configuration file, so It is virtual machine configuration target network protocol address afterwards according to the configuration file comprising target network protocol address.Using the application Embodiment is, it can be achieved that online virtual machine reduces upgrade cost, applicability from IPv4 smooth upgrade to IPv4/IPv6 dual stack By force.
In the embodiment of the present application, virtual machine is to have created IPv4 network and can operate normally the online virtual of business Machine.For ease of understanding, referring to fig. 2, Fig. 2 is the system architecture schematic diagram of IPv4 network provided by the embodiments of the present application.Such as Fig. 2 institute Show, the IPv4 network in the embodiment of the present application is created in cloud platform, and wherein IPv4 network includes the master network being created that 1, IPv4 subnet 1, port and the virtual machine created under master network 1.Its middle port includes port 1, port 2 ..., port 3, Virtual machine includes virtual machine A, virtual machine B ..., virtual machine C.Virtual machine A is connect with port 1, and virtual machine B is connect with port 2, empty Quasi- machine C is connect with port 3, middle port 1, port 2 ..., and port 3 is connect with IPv4 subnet 1, i.e., the address IPv4 on port is all From IPv4 subnet 1.When an IPv4 network is completed in creation, the above-mentioned virtual machine A built, virtual machine B ..., virtual machine C Based on IPv4 agreement can communicate.
Method provided by the embodiments of the present application and relevant apparatus are carried out respectively respectively below in conjunction with Fig. 3 to Figure 11 in detail Explanation.Method provided by the embodiments of the present application may include for determine virtual machine mark, obtain first network protocol configuration information, It determines configuration file, obtain target network protocol address, addition target network protocol address to configuration file, be based on configuration file The data processing stages such as target network protocol address are distributed for virtual machine.Wherein, the realization side of above-mentioned each data processing stage Formula can be found in implementation shown in following Fig. 3 to Figure 11.
Referring to Fig. 3, Fig. 3 is one flow diagram of configuration method of internet protocol address provided by the embodiments of the present application.This The method that application embodiment provides may include steps of 101 to 104:
101, the virtual machine mark for determining virtual machine, the first net of virtual machine is inquired based on virtual machine mark from database Network protocol configuration information.
In some possible embodiments, if virtual machine belongs to the first network protocol sub-networks in master network, first Virtual machine in network protocol subnet can be communicated based on first network agreement.Then pass through the virtual machine mark of determining virtual machine Know, the first network protocol configuration information for inquiring virtual machine from database can be identified based on virtual machine, wherein first network is assisted Discussing configuration information includes the physical address of virtual machine, the first network protocol address of virtual machine and the affiliated master network of virtual machine Network identity etc., herein with no restrictions.Here, first network protocol address is the network communicated based on first network agreement Protocol address, wherein first network agreement can be IPv4 agreement or IPv6 agreement etc., herein with no restrictions.It is understandable It is that, when first network agreement is IPv4 agreement, first network protocol address is the address IPv4, first network protocol configuration information For IPv4 configuration information, first network protocol sub-networks are IPv4 subnet;When first network agreement is IPv6 agreement, first network Protocol address is the address IPv6, and first network protocol configuration information is IPv6 configuration information, and first network protocol sub-networks are IPv6 Subnet.For convenience of description, the embodiment of the present application is IPv4 agreement with first network agreement, and first network protocol address is IPv4 Location, first network protocol configuration information are IPv4 configuration informations, and first network protocol sub-networks are illustrated for IPv4 subnet.
Specifically, since the virtual machine in present application example is to have created IPv4 network and can operate normally business Online virtual machine, therefore all information related with IPv4 network creation have all stored in the database, i.e., store in database The IPv4 configuration informations of all online virtual machines.By determining that the virtual machine of virtual machine identifies, can be identified based on virtual machine The virtual machine is inquired from database identifies corresponding IPv4 configuration information.Wherein, the corresponding virtual machine of a virtual machine Mark, virtual machine mark are one generated when creating virtual machine and are used for the character string of uniquely tagged virtual machine, the character string It can be made of number, character and/or letter, herein with no restrictions.May include in IPv4 configuration information virtual machine physical address, IPv4 subnet where the address IPv4 of virtual machine, the network identity of the affiliated master network of virtual machine (i.e. network), virtual machine is (i.e. IPv4subnet port-mark and port status of port (i.e. port) bound in IPv4 Subnet Identification), virtual machine etc., This is with no restrictions.
102, the corresponding configuration file of network identity is determined.
In some possible embodiments, by obtaining the IPv4 configuration information of virtual machine, IPv4 can be obtained with confidence The network identity for including in breath can be matched to the corresponding configuration file of network identity based on the network identity in the database.It can With understanding, a network identity corresponds to a configuration file, includes a plurality of record in a configuration file, wherein a note Record a configuration information of a corresponding virtual machine, configuration information can by a physical address, a virtual machine title with An and internet protocol address composition.That is, all included by being stored in a configuration file under a master network All configuration informations of virtual machine.
For example, referring to fig. 4, Fig. 4 is the application scenarios schematic diagram of configuration file provided by the embodiments of the present application.This is matched Setting the network identity that file is master network is the corresponding configuration file of network identity 1, altogether includes 4 records in the configuration file, Respectively first record, Article 2 record, Article 3 record and Article 4 record.Wherein the data format of every record is " physical address, virtual machine title, internet protocol address ", network association included in first record~Article 4 record in figure Discussing address is all first network protocol address (i.e. the address IPv4).
103, target network protocol address is obtained, physical address and target network protocol address are added to configuration file In.
In some possible embodiments, since the online virtual machine in the application belongs to the first network in master network Protocol sub-networks (i.e. IPv4 subnet), therefore, if also needing to need to create for online the second internet protocol address of virtual machine configuration Second network protocol subnet.Here the second network protocol subnet is a subnet in above-mentioned master network, the second network protocol Virtual machine in net is based on the second network protocol and is communicated, and the second network protocol is different from first network agreement.Due to this Apply for that the first network agreement in embodiment is IPv4 agreement, therefore the second network protocol is IPv6 agreement, when the second network is assisted When view is IPv6 agreement, the second internet protocol address is the address IPv6, and the second network protocol configuration information is IPv6 configuration information, Second network protocol subnet is IPv6 subnet (i.e. IPv6subnet).Specifically, by obtaining IPv6 subnet address section and IPv6 Subnet title can create to obtain an IPv6 subnet.Here, IPv6 subnet can be regarded as an IPv6 address pool or one IPv6 address range, that is to say, that include multiple addresses IPv6 in IPv6 subnet.In the embodiment of the present application, due to being to realize Second internet protocol address (i.e. the address IPv6) is added to online virtual machine, therefore master network has existed, it is only necessary in the master Continue to create an IPv6 subnet under network.That is, IPv4 subnet and newly created IPv6 where virtual machine Net belongs to the same master network.It is that IPv6 is created under same master network provided by the embodiments of the present application for example, with reference to Fig. 5, Fig. 5 The application scenarios schematic diagram of net.IPv4 network created includes master network 1 in cloud platform, the lower creation of master network 1 IPv4 subnet 1, port and virtual machine.Its middle port includes port 1, and port 2 ..., port 3, virtual machine includes virtual machine A, Virtual machine B ..., virtual machine C, virtual machine A are connect with port 1, and virtual machine B is connect with port 2, and virtual machine C is connect with port 3. Port 1, port 2 ..., port 3 are connect with IPv4 subnet 1, that is to say, that the address IPv4 on port is all from IPv4 subnet 1.As shown in figure 5, creating IPv6 subnet 1 under master network 1, then IPv4 subnet 1 and IPv6 subnet 1 belong to identical master network 1.
In some possible embodiments, after creating IPv6 subnet, by from the above-mentioned IPv6 subnet of creation An address IPv6 being not used by is obtained at random, which can be determined as target network protocol address.It then will be empty The physical address of quasi- machine is added in the corresponding configuration file of the affiliated master network of virtual machine with the address IPv6 got.Specifically The network identity can be searched or be matched in ground it is corresponding by the network identity of the above-mentioned affiliated master network of the virtual machine determined Configuration file can be based on the data format and determination by obtaining the data format for the configuration information for including in configuration file The physical address and target network protocol address of virtual machine title, virtual machine out generate a configuration information to establish physics The corresponding relationship of address and target network protocol address.That is, the virtual machine that can will be determined according to above-mentioned data format Title, physical address and target network protocol address are added in configuration file.It is understood that above-mentioned by physical address And this process for being added in configuration file of target network protocol address will not influence the normal operation of online virtual machine.
It for example, is the application scenarios schematic diagram of more new configuration file provided by the embodiments of the present application referring to Fig. 6, Fig. 6. The configuration file is that the network identity of master network is the corresponding configuration file of network identity 1, altogether includes 4 notes in the configuration file Record, respectively first record, Article 2 record, Article 3 record and Article 4 record.The wherein data lattice of every record Formula is " physical address, virtual machine title, internet protocol address ", net included in first record~Article 4 record in figure Network protocol address is all first network protocol address (i.e. the address IPv4).If the physical address of virtual machine to be configured is physically Location 1, the entitled virtual machine title 1 of virtual machine, target network protocol address are the second internet protocol address 1, then can be according to data The form of format " physical address, virtual machine title, internet protocol address " is by physical address 1, virtual machine title 1 and the second net Network protocol address 1 is with " form of physical address 1, virtual machine title 1, the second internet protocol address 1 " is added in configuration file As the Article 5 record in the configuration file.
It 104, is virtual machine configuration target network protocol address according to the configuration file comprising target network protocol address.
In some possible embodiments, above-mentioned that physical address and target network protocol address are added to configuration file Process be the equal of having increased an IPv6 configuration information newly in configuration file, this process is just as programmer is in developing instrument In to write source code the same.But updated configuration file is made to come into force if necessary, then it also needs to reset internet protocol address Configuration process, this source code write just as programmer needs is first compiled in compiler, wherein network protocol Location configuration process can be dnsmasq process.In the embodiment of the present application, can be by obtaining SIGKILL signal, being based on should SIGKILL signal resets internet protocol address and configures process.In simple terms, due to virtual machine be can operate normally business Line virtual machine, therefore internet protocol address configuration process has been actuated while that the i.e. affiliated master network of virtual machine has had been started up one Internet protocol address configures process and provides DHCP service for the master network.The wherein IPv4 subnet as belonging to virtual machine and newly-built IPv6 subnet belong to the same master network, and internet protocol address configuration process and master network are one-one relationships, i.e., one Internet protocol address configuration process can provide DHCP service for the virtual machine under all-ones subnet in same master network, therefore, weight Already present internet protocol address configuration process originally need to first be terminated by setting internet protocol address configuration process.In the embodiment of the present application In, by obtaining a SIGKILL signal, which can make already present internet protocol address configuration process originally It terminates immediately, then cloud platform can restart one when monitoring that internet protocol address configuration process exception exits immediately Internet protocol address configures process, that is, resetting internet protocol address configures process.
In some possible embodiments, updated configuration can be made by configuring process by resetting internet protocol address File comes into force.Then, when receiving the internet protocol address configuring request of virtual machine transmission, by with parsing the network protocol The physical address carried in internet protocol address configuring request and requested internet protocol address can be obtained in location configuring request Address style, here, the address style of requested internet protocol address is the address IPv6, that is to say, that above-mentioned network association View address configuration request is based on the internet protocol address that the second network protocol (i.e. IPv6 agreement) is communicated for request (i.e. the address IPv6).Therefore, process is configured, in conjunction with internet protocol address configuring request based on the internet protocol address after resetting It is corresponding can to get physical address from updated configuration file for the physical address of middle carrying and updated configuration file Target network protocol address, and the target network protocol address is sent to the virtual machine.Specifically, internet protocol address Configuration process is by searching for the corresponding configuration file of network identity, by parsing the configuration file, can obtain from configuration file The corresponding target network protocol address of the physical address of virtual machine (i.e. the address IPv6) then sends out the target network protocol address Give virtual machine.Based on this, the address IPv4 and the address IPv6, and the implementation of above-mentioned each step will be existed simultaneously on virtual machine Journey will not influence the operation of virtual machine, that is to say, that can realize that virtual machine is not interrupting based on the method in the embodiment of the present application The smooth transition of the dual stack from IPv4 to IPv4/IPv6 is completed in the case where business.
For example, be referring to Fig. 7, Fig. 7 internet protocol address provided by the embodiments of the present application configuration method application Schematic diagram of a scenario.Assuming that virtual machine is virtual machine C, then pass through step: S01, based on virtual machine mark, acquisition is empty from database The physical address of quasi- machine C;S02, the address IPv6 is obtained from IPv6 subnet 1, and add together with physical address, virtual machine title Into configuration file;S03, resetting internet protocol address configure process;S04, the internet protocol address configuration for obtaining virtual machine C are asked It asks;S05, internet protocol address configuration process obtain the corresponding address IPv6 of physical address of virtual machine C from configuration file, and The address IPv6 is sent to virtual machine C.It can realize that virtual machine C on the basis of possessing the address IPv4, continues to distribute based on this To the address IPv6.In other words, the implementation process based on above-mentioned steps S01~S05 can be realized virtual machine C in non-interrupting service In the case where possess IPv4/IPv6 dual stack, that is to say, that connection is established between IPv6 subnet 1 and port 3.
It further, can if all virtual machines under IPv4 subnet all pass through the configuration process of the above-mentioned address IPv6 Realize that each virtual machine can possess IPv4/IPv6 dual stack without interrupting the service.For example, referring to Fig. 8, Fig. 8 is the system architecture schematic diagram of IPv4/IPv6 network provided by the embodiments of the present application.IPv4/ in the embodiment of the present application IPv6 network is created in cloud platform, including master network 1, the lower IPv4 subnet 1 created of master network 1, IPv6 subnet 1, port and virtual machine.Its middle port includes port 1, and port 2 ..., port 3, virtual machine includes virtual machine A, virtual machine B ..., virtual machine C, virtual machine A are connect with port 1, and virtual machine B is connect with port 2, and virtual machine C is connect with port 3.Port 1, Port 2 ..., port 3 are all attached with IPv4 subnet 1 and IPv6 subnet 2 respectively.That is, the address IPv4 on port The void of IPv4/IPv6 network is put up all from IPv6 subnet 1 in the address IPv6 all on IPv4 subnet 1, port Quasi- machine A, virtual machine B ..., virtual machine C can not only be communicated based on IPv4 agreement, but also can be led to based on IPv6 agreement Letter.
The configuration method of internet protocol address provided by the embodiments of the present application, by determining that the virtual machine of virtual machine identifies, It can be identified based on virtual machine and inquire from database the first network protocol configuration information of the virtual machine (i.e. IPv4 matches confidence Breath), the physical address of virtual machine, the first network agreement of virtual machine are wherein included at least in first network protocol configuration information The network identity of location (i.e. the address IPv4) and the affiliated master network of virtual machine.It determines the corresponding configuration file of network identity, leads to Acquisition target network protocol address (i.e. the address IPv6) is crossed, physical address and target network protocol address are added to configuration file In, process is then configured by resetting internet protocol address, enables internet protocol address configuration process according to comprising target network The configuration file of network protocol address is virtual machine configuration target network protocol address.It is using the embodiment of the present application, it can be achieved that online Virtual machine reduces upgrade cost, strong applicability from IPv4 smooth upgrade to IPv4/IPv6 dual stack.
Referring to Fig. 9, Fig. 9 is that the method another process provided by the embodiments of the present application for realizing IPv4/IPv6 dual stack is shown It is intended to.Method provided by the embodiments of the present application may include steps of 201 to 204:
201, the virtual machine mark for determining virtual machine, the first net of virtual machine is inquired based on virtual machine mark from database Network protocol configuration information.
202, the corresponding configuration file of network identity is determined.
203, target network protocol address is obtained, physical address and target network protocol address are added to network identity pair In the configuration file answered.
It 204, is virtual machine configuration target network protocol address according to the configuration file comprising target network protocol address.
Wherein, the specific implementation of above-mentioned steps 201 to step 204 can be found in the corresponding embodiment of Fig. 3 to step 101 to step 104 description, be not discussed here.
205, it when virtual machine, which closes the configuration information restarted and in configuration file, to be emptied, is obtained from database virtual The history configuration information of machine is simultaneously added in configuration file.
In some possible embodiments, when cloud platform closing is restarted or virtual machine closing is restarted, configuration text Part configuration information all can disappear or empty, therefore for the ease of subsequent use, rise to virtual machine configuration internet protocol address Efficiency can will include the information conduct of above-mentioned physical address, target network protocol address (i.e. the address IPv6) and network identity One history configuration information saves in the database.That is, according to the physical address of virtual machine, target network protocol address And the network identity of virtual machine belonging network produces an IPv6 configuration information, and by the IPv6 configuration information update to number According in library.Then, when next cloud platform is restarted, cloud platform can configuration information in reading database, and these are configured Information is write in configuration file, and when requesting internet protocol address in order to virtual machine, internet protocol address configures process can According to the physical address of virtual machine, the corresponding internet protocol address of physical address is found in configuration file, with continue rent to Virtual machine.
The configuration method of internet protocol address provided by the embodiments of the present application, by determining that the virtual machine of virtual machine identifies, It can be identified based on virtual machine and inquire from database the first network protocol configuration information of the virtual machine (i.e. IPv4 matches confidence Breath), the physical address of virtual machine, the first network agreement of virtual machine are wherein included at least in first network protocol configuration information The network identity of location (i.e. the address IPv4) and the affiliated master network of virtual machine.It determines the corresponding configuration file of network identity, leads to Acquisition target network protocol address (i.e. the address IPv6) is crossed, physical address and target network protocol address are added to configuration file In, process is then configured by resetting internet protocol address, enables internet protocol address configuration process according to comprising target network The configuration file of network protocol address is virtual machine configuration target network protocol address.It finally will include above-mentioned physical address, target The IPv6 configuration information of internet protocol address and network identity stores in the database, the configuration note in updatable data library Record.Using the embodiment of the present application, it can be achieved that online virtual machine is reduced and risen from IPv4 smooth upgrade to IPv4/IPv6 dual stack Grade cost, strong applicability.
It is the structural schematic diagram of the configuration device of internet protocol address provided by the embodiments of the present application referring to Figure 10, Figure 10. The configuration device of internet protocol address provided by the embodiments of the present application includes:
First network protocol configuration information obtains module 31, for determining that the virtual machine of virtual machine identifies, is based on above-mentioned void Quasi- machine mark inquires the first network protocol configuration information of above-mentioned virtual machine from database, wherein above-mentioned first network agreement is matched Confidence breath includes belonging to the first network protocol address and above-mentioned virtual machine of the physical address of above-mentioned virtual machine, above-mentioned virtual machine The network identity of master network, above-mentioned first network protocol address are the network protocol that is communicated based on first network agreement Location;
Configuration file determining module 32, for determining that above-mentioned first network protocol configuration information obtains what module 31 determined State the corresponding configuration file of network identity;
Configuration file update module 33 believes above-mentioned first network protocol configuration for obtaining target network protocol address Breath obtains the above-mentioned physical address that module 31 determines and above-mentioned target network protocol address is added to above-mentioned configuration file and determines mould In the above-mentioned configuration file that block 32 determines, above-mentioned target network protocol address is the network communicated based on the second network protocol Protocol address, above-mentioned second network protocol and above-mentioned first network agreement be not identical;
Target network protocol address configuration module 34, for according to the above-mentioned configuration comprising above-mentioned target network protocol address The configuration file that file update module 33 determines is the above-mentioned target network protocol address of above-mentioned virtual machine configuration.
In some possible embodiments, above-mentioned apparatus further include:
Corresponding relation building module 35 obtains what module 31 determined for establishing above-mentioned first network protocol configuration information The corresponding relationship for the above-mentioned target network protocol address that physical address is determined with above-mentioned configuration file update module 33 is stated, and will be upper It states corresponding relationship and is added to above-mentioned configuration file;Wherein, above-mentioned corresponding relationship is used to search to obtain based on above-mentioned physical address State target network protocol address.
In some possible embodiments, above-mentioned target network protocol address configuration module 34 includes:
Internet protocol address configures process reset cell 3401, for resetting internet protocol address configuration process;
Internet protocol address configuring request acquiring unit 3402, for based on the above-mentioned internet protocol address configuration after resetting Process obtains the internet protocol address configuring request that above-mentioned virtual machine is sent, and above-mentioned internet protocol address configuring request is for requesting The internet protocol address communicated based on above-mentioned second network protocol is obtained, includes in above-mentioned internet protocol address configuring request Above-mentioned physical address;
Target network protocol address transmission unit 3403, for based on above-mentioned internet protocol address configuration process, in conjunction with It states physical address and above-mentioned corresponding relationship obtains the corresponding above-mentioned target network association of above-mentioned physical address from above-mentioned configuration file Address is discussed, and above-mentioned target network protocol address is sent to above-mentioned virtual machine.
In some possible embodiments, the configuration device of above-mentioned internet protocol address further include:
Configuration file loading module 36, for closing the configuration information restarted and in above-mentioned configuration file when above-mentioned virtual machine When being emptied, the history configuration information of above-mentioned virtual machine is obtained from above-mentioned database, above-mentioned history configuration information includes at least Above-mentioned physical address, above-mentioned target network protocol address and above-mentioned corresponding relationship;Above-mentioned history configuration information is added to State configuration file.
In some possible embodiments, above-mentioned virtual machine belongs to the first network protocol sub-networks in above-mentioned master network, Virtual machine in above-mentioned first network protocol sub-networks is based on above-mentioned first network agreement and is communicated;Above-mentioned internet protocol address Configuration device further include:
Second network protocol subnet creation module 37, for creating the second network protocol subnet, above-mentioned second network protocol Subnet is a subnet in above-mentioned master network, and the virtual machine in above-mentioned second network protocol subnet is assisted based on above-mentioned second network View is communicated, and includes multiple second internet protocol addresses in above-mentioned second network protocol subnet;From above-mentioned multiple second networks Any second internet protocol address is obtained in protocol address as target network protocol address.
In some possible embodiments, above-mentioned corresponding relation building module is specifically used for:
Obtain the data format that above-mentioned configuration file includes;
Above-mentioned physical address and above-mentioned target network protocol address are combined on to establish according to above-mentioned data format State the corresponding relationship of physical address Yu above-mentioned target network protocol address.
In the specific implementation, the configuration device of above-mentioned internet protocol address can be executed such as by each functional module built in it Implementation provided by each step in above-mentioned Fig. 3 and Fig. 9.For example, above-mentioned first network protocol configuration information obtains module 31 can be used for executing determining virtual machine mark in above-mentioned each step, and identify inquiry first network agreement based on virtual machine and match Confidence breath and other implementations, for details, reference can be made to implementations provided by above-mentioned each step, and details are not described herein.Above-mentioned configuration File determining module 32, which can be used for executing in above-mentioned each step, determines the related step such as corresponding configuration file according to network identity Rapid described implementation, for details, reference can be made to implementations provided by above-mentioned each step, and details are not described herein.It is above-mentioned to match It sets file update module 33 and can be used for executing and obtain target network protocol address in above-mentioned each step, by physical address and target Internet protocol address is updated to configuration file and other implementations, for details, reference can be made to implementation provided by above-mentioned each step, Details are not described herein.Above-mentioned target network protocol address configuration module 34 can be used for executing in above-mentioned each step according to configuration text Part configures the target network protocol address and other implementations of virtual machine, and for details, reference can be made to realization sides provided by above-mentioned each step Formula, details are not described herein.Above-mentioned corresponding relation building module 35 can be used for executing established in above-mentioned each step physical address and The corresponding relationship and other implementations of target network protocol address, for details, reference can be made to implementation provided by above-mentioned each step, Details are not described herein.Above-mentioned configuration file loading module 36 can be used for executing in above-mentioned each step obtain history configuration information, History configuration information is loaded to configuration file and other implementations, for details, reference can be made to implementation provided by above-mentioned each step, Details are not described herein.Above-mentioned second network protocol subnet creation module 37, which can be used for executing in above-mentioned each step, creates the second net Network protocol sub-networks and acquisition target network protocol address and other implementations from the second network protocol subnet, for details, reference can be made to upper Implementation provided by each step is stated, details are not described herein.
In the embodiment of the present application, the configuration device of internet protocol address can be identified based on the virtual machine determined from data The first network protocol configuration information (i.e. IPv4 configuration information) of the virtual machine is inquired in library, wherein first network protocol configuration Including at least the physical address of virtual machine, the first network protocol address (i.e. the address IPv4) and virtual machine of virtual machine in information The network identity of affiliated master network.The corresponding configuration file of network identity is determined, by obtaining target network protocol address (i.e. The address IPv6), physical address and target network protocol address are added in configuration file, then by resetting network protocol Location configures process, enables internet protocol address configuration process according to the configuration file comprising target network protocol address, for void Quasi- machine configures target network protocol address.It finally will include above-mentioned physical address, target network protocol address and network identity The storage of IPv6 configuration information in the database, configuration in updatable data library record.Using the embodiment of the present application, it can be achieved that Online virtual machine reduces upgrade cost, flexibility is high, applied widely from IPv4 smooth upgrade to IPv4/IPv6 dual stack.
It is the structural schematic diagram of terminal device provided by the embodiments of the present application referring to Figure 11, Figure 11.As shown in figure 11, this reality Applying the terminal device in example may include: one or more processors 401 and memory 402.Above-mentioned processor 401 and memory 402 are connected by bus 403.For memory 402 for storing computer program, which includes program instruction, processing Device 401 is used to execute the program instruction of the storage of memory 402, performs the following operations:
The virtual machine mark for determining virtual machine inquires from database the of above-mentioned virtual machine based on above-mentioned virtual machine mark One network protocol configuration information, wherein above-mentioned first network protocol configuration information includes the physical address, above-mentioned of above-mentioned virtual machine The first network protocol address of virtual machine and the network identity of the affiliated master network of above-mentioned virtual machine, above-mentioned first network agreement Location is the internet protocol address communicated based on first network agreement;
Determine the corresponding configuration file of above-mentioned network identity;
Target network protocol address is obtained, above-mentioned physical address and above-mentioned target network protocol address are added to above-mentioned match It sets in file, above-mentioned target network protocol address is the internet protocol address communicated based on the second network protocol, above-mentioned Two network protocols and above-mentioned first network agreement be not identical;
It is the above-mentioned target network association of above-mentioned virtual machine configuration according to the configuration file comprising above-mentioned target network protocol address Discuss address.
In some possible embodiments, above-mentioned processor 401 is used for:
The corresponding relationship of above-mentioned physical address Yu above-mentioned target network protocol address is established, and above-mentioned corresponding relationship is added To above-mentioned configuration file;
Wherein, above-mentioned corresponding relationship is used to search to obtain above-mentioned target network protocol address based on above-mentioned physical address.
In some possible embodiments, above-mentioned processor 401 is used for:
It resets internet protocol address and configures process;
The internet protocol address that above-mentioned virtual machine is sent is obtained based on the above-mentioned internet protocol address configuration process after resetting Configuring request, above-mentioned internet protocol address configuring request are used for the net that request is communicated based on above-mentioned second network protocol Network protocol address includes above-mentioned physical address in above-mentioned internet protocol address configuring request;
Based on above-mentioned internet protocol address configuration process, in conjunction with above-mentioned physical address and above-mentioned corresponding relationship from above-mentioned configuration The corresponding above-mentioned target network protocol address of above-mentioned physical address is obtained in file, and above-mentioned target network protocol address is sent To above-mentioned virtual machine.
In some possible embodiments, above-mentioned processor 401 is used for:
When above-mentioned virtual machine, which closes the configuration information restarted and in above-mentioned configuration file, to be emptied, from above-mentioned database The history configuration information of above-mentioned virtual machine is obtained, above-mentioned history configuration information includes at least above-mentioned physical address, above-mentioned target network Network protocol address and above-mentioned corresponding relationship;
Above-mentioned history configuration information is added to above-mentioned configuration file.
In some possible embodiments, above-mentioned virtual machine belongs to the first network protocol sub-networks in above-mentioned master network, Virtual machine in above-mentioned first network protocol sub-networks is based on above-mentioned first network agreement and is communicated;Above-mentioned processor 401 is used for:
The second network protocol subnet is created, above-mentioned second network protocol subnet is a subnet in above-mentioned master network, on The virtual machine stated in the second network protocol subnet is communicated based on above-mentioned second network protocol, above-mentioned second network protocol subnet In include multiple second internet protocol addresses;
Any second internet protocol address is obtained from above-mentioned multiple second internet protocol addresses as target network agreement Address.
In some possible embodiments, above-mentioned processor 401 is used for:
Obtain the data format that above-mentioned configuration file includes;
Above-mentioned physical address and above-mentioned target network protocol address are combined on to establish according to above-mentioned data format State the corresponding relationship of physical address Yu above-mentioned target network protocol address.
It should be appreciated that in some possible embodiments, above-mentioned processor 401 can be central processing unit (central processing unit, CPU), which can also be other general processors, digital signal processor (digital signal processor, DSP), specific integrated circuit (application specific integrated Circuit, ASIC), ready-made programmable gate array (field programmable gate array, FPGA) or other can Programmed logic device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor Or the processor is also possible to any conventional processor etc..The memory 402 may include read-only memory and deposit at random Access to memory, and instruction and data is provided to processor 401.The a part of of memory 402 can also include non-volatile random Access memory.For example, memory 402 can be with the information of storage device type.
In the specific implementation, above-mentioned terminal device can be executed by each functional module built in it as in above-mentioned Fig. 3 and Fig. 9 Implementation provided by each step, for details, reference can be made to implementations provided by above-mentioned each step, and details are not described herein.
In the embodiment of the present application, terminal device can inquire the void based on the virtual machine mark determined from database The first network protocol configuration information (i.e. IPv4 configuration information) of quasi- machine, wherein includes at least in first network protocol configuration information Physical address, the first network protocol address (i.e. the address IPv4) of virtual machine and the net of the affiliated master network of virtual machine of virtual machine Network mark.The corresponding configuration file of network identity is determined, by obtaining target network protocol address (i.e. the address IPv6), by object Reason address and target network protocol address are added in configuration file, are then configured process by resetting internet protocol address, are made Internet protocol address, which configures process, to be virtual machine configuration target network according to the configuration file comprising target network protocol address Network protocol address.Finally by the IPv6 configuration information including above-mentioned physical address, target network protocol address and network identity In the database, the configuration in updatable data library records for storage.Using the embodiment of the present application, it can be achieved that online virtual machine from IPv4 smooth upgrade reduces upgrade cost, flexibility is high, applied widely to IPv4/IPv6 dual stack.
The embodiment of the present application also provides a kind of computer readable storage medium, which has meter Calculation machine program, the computer program include program instruction, which realizes each in Fig. 3 and Fig. 9 when being executed by processor The configuration method of internet protocol address provided by step, for details, reference can be made to implementation provided by above-mentioned each step, This is repeated no more.
Above-mentioned computer readable storage medium can be the configuration dress for the internet protocol address that aforementioned any embodiment provides It sets or the internal storage unit of above-mentioned terminal device, such as the hard disk or memory of electronic equipment.The computer-readable storage medium Matter is also possible to the plug-in type hard disk being equipped on the External memory equipment of the electronic equipment, such as the electronic equipment, intelligent storage Block (smart media card, SMC), secure digital (secure digital, SD) card, flash card (flash card) etc.. Further, which can also both include the internal storage unit of the electronic equipment or deposit including outside Store up equipment.The computer readable storage medium for other programs needed for storing the computer program and the electronic equipment and Data.The computer readable storage medium can be also used for temporarily storing the data that has exported or will export.
Following claims and term " first " in specification and attached drawing, " second ", " third ", " the 4th " etc. It is to be not use to describe a particular order for distinguishing different objects.In addition, term " includes " and " having " and they are any Deformation, it is intended that cover and non-exclusive include.Such as contain the process, method, system, product of a series of steps or units Or equipment is not limited to listed step or unit, but optionally further comprising the step of not listing or unit, or can Selection of land further includes the other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments It is contained at least one embodiment of the application.It is identical that each position in the description shows that the phrase might not be each meant Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and Implicitly understand, embodiment described herein can be combined with other embodiments.In present specification and appended Term "and/or" used in claims refers to any combination and institute of one or more of associated item listed It is possible that combining, and including these combinations.Those of ordinary skill in the art may be aware that in conjunction with reality disclosed herein Each exemplary unit and algorithm steps of example description are applied, can be come with the combination of electronic hardware, computer software or the two real It is existing, in order to clearly illustrate the interchangeability of hardware and software, generally described in the above description according to function Each exemplary composition and step.These functions are implemented in hardware or software actually, depending on the specific of technical solution Using and design constraint.Professional technician can realize each specific application using distinct methods described Function, but it is this realize it is not considered that exceed scope of the present application.
Method provided by the embodiments of the present application and relevant apparatus be referring to method flow diagram provided by the embodiments of the present application and/ Or structural schematic diagram is come what is described, can specifically be realized by computer program instructions the every of method flow diagram and/or structural schematic diagram The combination of process and/or box in one process and/or box and flowchart and/or the block diagram.These computer programs refer to Enable the processor that can provide general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices To generate a machine, so that generating use by the instruction that computer or the processor of other programmable data processing devices execute In the function that realization is specified in one or more flows of the flowchart and/or structural schematic diagram one box or multiple boxes Device.These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with specific In the computer-readable memory that mode works, so that it includes instruction that instruction stored in the computer readable memory, which generates, The manufacture of device, the command device are realized in one box of one or more flows of the flowchart and/or structural schematic diagram Or the function of being specified in multiple boxes.These computer program instructions can also be loaded into computer or the processing of other programmable datas In equipment, so that executing series of operation steps on a computer or other programmable device to generate computer implemented place Reason, so that instruction executed on a computer or other programmable device offer is for realizing in one process of flow chart or multiple The step of function of being specified in process and/or structural representation one box or multiple boxes.

Claims (10)

1. a kind of configuration method of internet protocol address, which is characterized in that the described method includes:
The virtual machine mark for determining virtual machine, the first net of the virtual machine is inquired based on virtual machine mark from database Network protocol configuration information, wherein the first network protocol configuration information includes the physical address, described virtual of the virtual machine The first network protocol address of machine and the network identity of the affiliated master network of the virtual machine, the first network protocol address are The internet protocol address communicated based on first network agreement;
Determine the corresponding configuration file of the network identity;
Target network protocol address is obtained, the physical address and the target network protocol address are added to the configuration text In part, the target network protocol address is the internet protocol address communicated based on the second network protocol, second net Network agreement and the first network agreement be not identical;
According to the configuration file comprising the target network protocol address, for target network agreement described in the virtual machine configuration Location.
2. method according to claim 1, which is characterized in that after the acquisition target network protocol address, the method Further include:
The corresponding relationship of the physical address Yu the target network protocol address is established, and the corresponding relationship is added to institute State configuration file;
Wherein, the corresponding relationship is used to search to obtain the target network protocol address based on the physical address.
3. method according to claim 2, which is characterized in that configuration of the basis comprising the target network protocol address File is target network protocol address described in the virtual machine configuration, comprising:
It resets internet protocol address and configures process;
The internet protocol address configuration that the virtual machine is sent is obtained based on the internet protocol address configuration process after resetting Request, the network association that the internet protocol address configuring request is communicated for request based on second network protocol Address is discussed, includes the physical address in the internet protocol address configuring request;
Based on internet protocol address configuration process, in conjunction with the physical address and the corresponding relationship from the configuration file It is middle to obtain the corresponding target network protocol address of the physical address, and the target network protocol address is sent to institute State virtual machine.
4. method according to claim 2, which is characterized in that the method also includes:
When the virtual machine, which closes the configuration information restarted and in the configuration file, to be emptied, obtain from the database The history configuration information of the virtual machine, the history configuration information includes at least the physical address, the target network is assisted Discuss address and the corresponding relationship;
The history configuration information is added to the configuration file.
5. any one of -4 the methods according to claim 1, which is characterized in that the virtual machine belongs to the in the master network One network protocol subnet, the virtual machine in the first network protocol sub-networks are based on the first network agreement and are communicated;
The acquisition target network protocol address, comprising:
Creating the second network protocol subnet, the second network protocol subnet is a subnet in the master network, described the Virtual machine in two network protocol subnets is based on second network protocol and is communicated, and wraps in the second network protocol subnet Include multiple second internet protocol addresses;
Any second internet protocol address is obtained from the multiple second internet protocol address as target network protocol address.
6. according to any one of claim 2-4 the method, which is characterized in that described to establish the physical address and the target The corresponding relationship of internet protocol address, comprising:
Obtain the data format that the configuration file includes;
The physical address and the target network protocol address are combined to establish the object according to the data format Manage the corresponding relationship of address and the target network protocol address.
7. a kind of configuration device of internet protocol address, which is characterized in that described device includes:
First network protocol configuration information obtains module, for determining that the virtual machine of virtual machine identifies, is based on the virtual machine mark The first network protocol configuration information that the virtual machine is inquired from database is known, wherein the first network protocol configuration information The first network protocol address and the affiliated master network of the virtual machine of physical address, the virtual machine including the virtual machine Network identity, the first network protocol address is the internet protocol address communicated based on first network agreement;
Configuration file determining module, for determining that the first network protocol configuration information obtains the network mark that module determines Know corresponding configuration file;
Configuration file update module obtains the first network protocol configuration information for obtaining target network protocol address The physical address and the target network protocol address that module determines are added to what the configuration file determining module determined In the configuration file, the target network protocol address is the internet protocol address communicated based on the second network protocol, Second network protocol and the first network agreement be not identical;
Target network protocol address configuration module, more for the configuration file of the basis comprising the target network protocol address The configuration file that new module determines is target network protocol address described in the virtual machine configuration.
8. device according to claim 7, which is characterized in that described device further include:
Corresponding relation building module obtains described in module determination physically for establishing the first network protocol configuration information The corresponding relationship for the target network protocol address that location and the configuration file update module determine, and by the corresponding relationship It is added to the configuration file;
Wherein, the corresponding relationship is used to search to obtain the target network protocol address based on the physical address.
9. a kind of terminal device, which is characterized in that including processor and memory, the processor and memory are connected with each other;
The memory is for storing computer program, and the computer program includes program instruction, and the processor is configured For calling described program to instruct, as the method according to claim 1 to 6 is executed.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence, the computer program include program instruction, and described program instruction executes the processor such as Method described in any one of claims 1-6.
CN201910629139.5A 2019-07-12 2019-07-12 Method and device for configuring network protocol address Active CN110213391B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910629139.5A CN110213391B (en) 2019-07-12 2019-07-12 Method and device for configuring network protocol address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910629139.5A CN110213391B (en) 2019-07-12 2019-07-12 Method and device for configuring network protocol address

Publications (2)

Publication Number Publication Date
CN110213391A true CN110213391A (en) 2019-09-06
CN110213391B CN110213391B (en) 2021-09-28

Family

ID=67797272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910629139.5A Active CN110213391B (en) 2019-07-12 2019-07-12 Method and device for configuring network protocol address

Country Status (1)

Country Link
CN (1) CN110213391B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111586196A (en) * 2020-04-07 2020-08-25 无锡华云数据技术服务有限公司 Method, device and system for realizing network double stacks of virtual machine
CN111600972A (en) * 2020-05-15 2020-08-28 咪咕视讯科技有限公司 Configuration method of double-stack address, server and readable storage medium
CN111629084A (en) * 2020-07-28 2020-09-04 腾讯科技(深圳)有限公司 Data transmission method and device, storage medium and electronic equipment
CN113938459A (en) * 2021-09-06 2022-01-14 锐捷网络股份有限公司 IPv6 configuration method and device
CN115190101A (en) * 2022-09-08 2022-10-14 北京交通大学 Network address management and data transmission method of equipment
CN115277639A (en) * 2022-05-30 2022-11-01 紫光建筑云科技(重庆)有限公司 Method for realizing VPC supporting IPv6

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040141513A1 (en) * 2003-01-10 2004-07-22 Ryuichi Takechi Address translation device
US20040151202A1 (en) * 2003-01-31 2004-08-05 Mandavilli Swamy J. Method and apparatus for discovering topology information in a network
CN103312828A (en) * 2012-03-09 2013-09-18 中兴通讯股份有限公司 Method, device and system of MAC and IP address couple configuration of virtual machine
CN108347493A (en) * 2017-01-25 2018-07-31 华为技术有限公司 Mixed cloud management method, device and computing device
CN109688241A (en) * 2018-12-25 2019-04-26 武汉烽火信息集成技术有限公司 IPv4/IPv6 dual stack conversion method and system based on SDN

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040141513A1 (en) * 2003-01-10 2004-07-22 Ryuichi Takechi Address translation device
US20040151202A1 (en) * 2003-01-31 2004-08-05 Mandavilli Swamy J. Method and apparatus for discovering topology information in a network
CN103312828A (en) * 2012-03-09 2013-09-18 中兴通讯股份有限公司 Method, device and system of MAC and IP address couple configuration of virtual machine
CN108347493A (en) * 2017-01-25 2018-07-31 华为技术有限公司 Mixed cloud management method, device and computing device
CN109688241A (en) * 2018-12-25 2019-04-26 武汉烽火信息集成技术有限公司 IPv4/IPv6 dual stack conversion method and system based on SDN

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111586196A (en) * 2020-04-07 2020-08-25 无锡华云数据技术服务有限公司 Method, device and system for realizing network double stacks of virtual machine
CN111586196B (en) * 2020-04-07 2022-09-06 华云数据控股集团有限公司 Method, device and system for realizing network double stacks of virtual machine
CN111600972A (en) * 2020-05-15 2020-08-28 咪咕视讯科技有限公司 Configuration method of double-stack address, server and readable storage medium
CN111600972B (en) * 2020-05-15 2023-04-07 咪咕视讯科技有限公司 Configuration method of double-stack address, server and readable storage medium
CN111629084A (en) * 2020-07-28 2020-09-04 腾讯科技(深圳)有限公司 Data transmission method and device, storage medium and electronic equipment
CN113938459A (en) * 2021-09-06 2022-01-14 锐捷网络股份有限公司 IPv6 configuration method and device
CN115277639A (en) * 2022-05-30 2022-11-01 紫光建筑云科技(重庆)有限公司 Method for realizing VPC supporting IPv6
CN115190101A (en) * 2022-09-08 2022-10-14 北京交通大学 Network address management and data transmission method of equipment
CN115190101B (en) * 2022-09-08 2023-01-17 北京交通大学 Network address management and data transmission method of equipment

Also Published As

Publication number Publication date
CN110213391B (en) 2021-09-28

Similar Documents

Publication Publication Date Title
CN110213391A (en) A kind of configuration method and device of internet protocol address
US11956207B2 (en) Multi-tenant aware dynamic host configuration protocol (DHCP) mechanism for cloud networking
CN108510389B (en) Intelligent contract calling method and device based on block chain and readable storage medium
CN106301829B (en) A kind of method and apparatus of network service dilatation
US9628328B2 (en) Network controller with integrated resource management capability
CN107911463B (en) Business cross-cloud architecture and creation method and management method thereof
CN107580083A (en) A kind of method and system of container IP address distribution
CN107357660A (en) The distribution method and device of a kind of virtual resource
CN108462592A (en) Resource allocation methods based on SLA and NFVO
CN106953848B (en) Software defined network implementation method based on ForCES
CN103607430A (en) Network processing method and system, and network control center
CN112035216B (en) Communication method for Kubernetes cluster network and OpenStack network
CN112688814B (en) Equipment access method, device, equipment and machine readable storage medium
CN110221918A (en) A kind of correlating method, the apparatus and system of NS and VNF
US11483178B2 (en) Customer activation on edge computing environment
CN107580011A (en) A kind of data sharing method and desktop cloud server terminal
EP3893437B1 (en) Method and device for deploying virtual network function
CN105049222A (en) Method, device and system for cross-domain management of transmission network
CN108370329B (en) Management method and device for management function object
CN116566830A (en) Network configuration method, device, system, edge equipment and storage medium
CN116450297A (en) Virtual machine creation method, device, equipment and storage medium
CN114490393A (en) Single-cluster multi-tenant management system
CN113810230B (en) Method, device and system for carrying out network configuration on containers in container cluster
CN118057776A (en) Method for deploying virtualized network function and communication device
CN115733743A (en) Network service deployment method, NFVO (network function virtualization) and NFV (network function virtualization) system

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
GR01 Patent grant
GR01 Patent grant