CN112887440A - IP address management method and device - Google Patents

IP address management method and device Download PDF

Info

Publication number
CN112887440A
CN112887440A CN201911201067.0A CN201911201067A CN112887440A CN 112887440 A CN112887440 A CN 112887440A CN 201911201067 A CN201911201067 A CN 201911201067A CN 112887440 A CN112887440 A CN 112887440A
Authority
CN
China
Prior art keywords
network card
host
change notification
metadata
updated metadata
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
CN201911201067.0A
Other languages
Chinese (zh)
Other versions
CN112887440B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201911201067.0A priority Critical patent/CN112887440B/en
Publication of CN112887440A publication Critical patent/CN112887440A/en
Application granted granted Critical
Publication of CN112887440B publication Critical patent/CN112887440B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/5053Lease time; Renewal aspects
    • 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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5076Update or notification mechanisms, e.g. DynDNS

Abstract

The application discloses an IP address management method and device, which can be applied to the field of cloud computing. One embodiment of the method comprises: receiving an IP change notification sent by a host machine, wherein the IP change notification comprises an MAC address of a network card with changed IP; acquiring updated metadata based on the MAC address of the network card, wherein the updated metadata comprises all IP addresses of the network card; and updating the network configuration according to the updated metadata. The method and the system solve the problems that a plurality of IP addresses cannot be automatically sensed and acquired in the cloud host, and improve the efficiency and accuracy of IP address management.

Description

IP address management method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of network management technologies, and in particular, to a method and an apparatus for managing an IP address.
Background
The cloud host is a virtualization technology similar to a Virtual Private Server (VPS) host, the VPS adopts virtual software to virtually simulate a plurality of parts similar to independent hosts on one host, single-machine multi-user can be realized, each part can be used as an independent operating system, and the management method is the same as that of the host. The cloud host is a part which is similar to a plurality of independent hosts and is virtualized on a group of cluster hosts, and each host in the cluster is provided with a mirror image of the cloud host, so that the safety and stability of the virtual host are greatly improved.
The flexible network card can be freely migrated among a plurality of cloud hosts. By binding a plurality of elastic network cards on the cloud host, each elastic network card can be bound with a plurality of intranet IP (Internet Protocol, Internet interconnection Protocol) addresses, and a high-availability network scheme is realized. When a user creates, binds and modifies the elastic network card or the intranet IP on the elastic network card for the cloud host, a matched IP address management method is needed in the cloud host, the change of the network card and the IP address is sensed in real time, and persistent network configuration is generated.
In the prior art, for IP address management of a public cloud flexible network card product, IP address management in a cloud Host is mainly realized by combining a method of Dynamic Host Configuration Protocol (DHCP) with manual Configuration of a network administrator. After the elastic network card is mounted on the cloud host, the kernel of the operating system recognizes that a new network card is added, and then acquires a corresponding IP address (the IP address is called as a "main IP" and other IP addresses on the elastic network card are called as "auxiliary IPs") according to a Media Access Control (MAC) address of the elastic network card in a DHCP manner. In addition, "auxiliary IP" on the resilient network card requires the network administrator to manually identify and add to the network configuration.
Disclosure of Invention
The embodiment of the application provides an IP address management method and device.
In a first aspect, the present application provides an IP address management method, including: receiving an IP change notification sent by a host machine, wherein the IP change notification comprises an MAC address of a network card with changed IP; acquiring updated metadata based on the MAC address of the network card, wherein the updated metadata comprises all IP addresses of the network card; and updating the network configuration according to the updated metadata.
In some embodiments, the updated metadata is obtained by: a host machine receives an IP change request; and storing the MAC address of the network card with the changed IP address and all the IP addresses on the network card as metadata to obtain updated metadata.
In some embodiments, receiving the IP change notification sent by the host comprises: and receiving the IP change notification sent by the host machine through the currently running daemon.
In some embodiments, the daemon includes an application programming interface API that is available for invocation, and receiving the IP change notification sent by the host through the currently running daemon includes: and receiving the IP change notification sent by the host machine through an Application Programming Interface (API) which can be called by the currently running daemon.
In some embodiments, the IP address management method further comprises: and running the daemon when the cloud host is started.
In a second aspect, the present application provides an IP address management apparatus, including: the receiving module is configured to receive an IP change notification sent by a host machine, wherein the IP change notification comprises an MAC address of a network card with changed IP; the acquisition module is configured to acquire updated metadata based on the MAC address of the network card, wherein the updated metadata comprises all IP addresses of the network card; and the updating module is configured to update the network configuration according to the updated metadata.
In some embodiments, the updated metadata is obtained by: a host machine receives an IP change request; and storing the MAC address of the network card with the changed IP address and all the IP addresses on the network card as metadata to obtain updated metadata.
In some embodiments, the receiving module is further configured to: and receiving the IP change notification sent by the host machine through the currently running daemon.
In some embodiments, the daemon includes an application programming interface API that is available for invocation, and receiving the IP change notification sent by the host through the currently running daemon includes: and receiving the IP change notification sent by the host machine through an Application Programming Interface (API) which can be called by the currently running daemon.
In some embodiments, the apparatus further comprises: and running the daemon when the cloud host is started.
In a third aspect, the present application provides an electronic device comprising one or more processors; a storage device having one or more programs stored thereon that, when executed by the one or more processors, cause the one or more processors to implement a method for template-based alert rendering.
In a fourth aspect, the present application provides a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method for template-based alert rendering.
According to the IP address management method and device, the IP change notification sent by the host machine is received, wherein the IP change notification comprises the MAC address of the network card with the changed IP; acquiring updated metadata based on the MAC address of the network card, wherein the updated metadata comprises all IP addresses of the network card; according to the updated metadata, the network configuration is updated, the problems that automatic sensing cannot be achieved in the cloud host and a plurality of IP addresses cannot be automatically acquired are solved, and the efficiency and accuracy of IP address management are improved.
Drawings
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram for one embodiment of a method of IP address management according to the present application;
FIG. 3 is a schematic diagram of an application scenario of the IP address management method according to the application;
FIG. 4 is a flow diagram of yet another embodiment of a method of IP address management according to the present application;
fig. 5 is a schematic structural diagram of an embodiment of an IP address management apparatus according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which an embodiment of an IP address management method of the present application may be applied.
As shown in fig. 1, system architecture 100 may include cloud hosts 101, 102, 103, network 104, and host 105. The cloud hosts 101, 102, and 103 are used to represent the cloud hosts 101, 102, and 103 running the IP address management method. Network 104 is intended to represent a medium that provides communication links between cloud hosts 101, 102, 103 and host 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The cloud hosts 101, 102, 103 running the IP address management method interact with the host 105 through the network 104 to obtain the IP change notification and obtain the updated metadata.
The host 105 may be understood as a physical machine in a "host" identity, and a user may create a corresponding service in the host, and the service rents resources such as a memory, a Central Processing Unit (CPU), and a hard disk of the host, for example, a common virtual machine, and the virtual machine is hosted in the host and needs to operate by using the resources such as the memory, the CPU, and the hard disk of the host. Host 105 may be implemented as a distributed host cluster consisting of multiple hosts, or as a single host.
In the technical field of cloud, each cloud host performs operation by using resources of the host in a balanced manner according to respective configuration. The cloud host is an important component of cloud computing in infrastructure application, and products are derived from a cloud computing platform. The interaction between the host 105 and the cloud hosts 101, 102, and 103 is controlled by components of a cloud computing platform, for example, a cloud computing management platform Openstack, which is called Nova by the name of Openstack-based open source project. Nova is a computing organization controller in an Openstack cloud, and all activities supporting the life cycle of an instance in the Openstack cloud are processed by Nova, so that Nova becomes a platform in charge of managing computing resources, networks, authentication and needed expandability. The Nova cloud architecture mainly comprises a Nova-api component, a rabbitm-mq server component, a Nova-computer component, a Nova-network component, a Nova-volume component and a Nova-scheduler component.
The cloud hosts 101, 102, 103 are portions of a group of clustered hosts on which a plurality of similar independent hosts are virtually emulated, each host in the cluster having a mirror image of the cloud host. A plurality of virtual network cards can be configured on the cloud hosts 101, 102, and 103, and a plurality of IP addresses can be bound to the virtual network cards, and the IPs can be respectively used for client connection, service processing, browsing, heartbeat synchronization, and the like. The cloud hosts 101, 102, 103 may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein. It should be noted that the IP address management method provided in the embodiment of the present application is generally executed by the cloud hosts 101, 102, and 103, and accordingly, the IP address management apparatus is generally disposed in the cloud hosts 101, 102, and 103.
It should be understood that the number of cloud hosts 101, 102, 103, network 104, and hosts 105 in fig. 1 is merely illustrative. There may be any number of cloud hosts, networks, and hosts, as desired for implementation.
Fig. 2 shows a flow diagram 200 of an embodiment of an IP address management method that can be applied to the present application. The IP address management method comprises the following steps:
step 201, receiving an IP change notification sent by a host.
In the present embodiment, an execution subject (e.g., the cloud host 101 shown in fig. 1) receives an IP change notification sent by a host. Here, the reason for IP change includes, but is not limited to, user creation, binding, modification of the resilient network card or intranet IP thereon, and the like.
The IP change notification includes the MAC address of the network card whose IP is changed, where the network card is a Virtual network card, such as an Elastic network card, the Elastic network card is a Virtual network card that can be attached to a Private network VPC (Private network on public Cloud) type ECS (Elastic computer Service) instance, and can freely migrate among a plurality of Cloud hosts, and each Elastic network card can bind a plurality of intranet IP addresses.
Step 202, acquiring updated metadata based on the MAC address of the network card.
In this embodiment, the execution main body obtains the updated metadata through the metadata service according to the MAC address of the network card and the access address metadata _ url provided by the updated metadata, where the updated metadata includes all IP addresses on the network card where the IP changes.
The metadata (metadata), also called intermediary data and relay data, is data (data about data) describing data, and is mainly information describing data attribute (property), and is used to support functions such as indicating storage location, history data, resource search, file record, and the like. The metadata service is started locally by nova, and can inject some extra information into the virtual machine, so that the virtual machine can have some customized configuration after creation.
Here, the concrete implementation of the metadata service is in the nova-api component, and thus, the name of the nova's metadata service is nova-api-metadata.
However, the execution agent cannot directly access the metadata service to obtain updated metadata, and needs to be used in conjunction with neutron. The execution agent may forward the access request to the metadata service in the novi-api via neutron.
Here, the neutron is a core component for providing network services in the Openstack, and based on the idea of defining a network by software, software-based network resource management is realized, various network resource management in the Linux system is fully utilized in the realization, various network related technologies in the Linux system are fully utilized in the realization, and a third-party plug-in is supported.
It should be noted that, a specific access instruction for the execution main body to obtain the updated metadata according to the MAC address of the network card and the access address metadata _ url provided by the updated metadata may be: curl metadata _ url/latest/MAC _ address. A curl (Command Line Uniform Resource Locator) is a file transfer tool provided by linux, and a curl Command is followed by a specific url (Uniform Resource Locator) address, which can obtain a network file pointed by the url (for example, curl www.baidu.com can be downloaded to the content of the hundred pages, which is equivalent to inputting the address in a browser). metadata _ url may be http: // 169.254.169.254. Latest denotes the latest version number of the interface currently supported by the metadata service, and a certain version number, for example, 2018-08-08, may be used, or latest may be used directly. MAC _ address is the MAC address of the network card that wants to obtain IP, e.g. 00:16: EA: AE:3C: 40.
The specific process of acquiring the updated metadata according to the access instruction may be to send an acquire updated metadata request to neutron-ns-metadata-proxy through a router or a DHCP. The neutron-ns-metadata-proxy adds instance _ ip and router _ id or network _ id to the head of an http (Hyper Text Transfer Protocol) request and sends the request to the neutron-metadata-agent through the unix domain socket. The neutron-metadata-agent adds the instance _ id obtained according to the IP and the router into the head of the http request, and then forwards the instance _ id to the nova-api-metadata. The nova-api-metadata takes out corresponding information from the http header of the request, obtains the ID (Identification) of the execution subject, then reads the updated metadata information, i.e., the IP address information, from the database, and finally returns the result.
Further, the instructions may be executed using an application or a script.
In some alternatives, the updated metadata is obtained by: and the host machine receives the IP change request, and stores the MAC address of the network card with the changed IP address and all the IP addresses on the network card as metadata to obtain updated metadata.
In this implementation, after storing all IP address information on the network card and the network card with changed IP, the host synchronizes this part of data as metadata to the service responsible for processing metadata, and the service stores the metadata according to its attributes and provides a data address metadata _ url for subsequent access. Here, the data storage form may be a form of recording data in a certain format in a computer internal or external storage medium, for example, a database, etc., in the prior art or in the future development, which is not limited in this application.
Here, the host stores the network card with changed IP and all IP address information on the network card, and mainly aims to display the network card to the console interface of the user and configure and use the network card for the relevant network.
In the implementation manner, after the host receives the IP change request, the updated metadata is obtained by storing the network card with the changed IP and all the IP address information on the network card as metadata and providing an access address, so that the execution main body can obtain all the IP addresses by obtaining the updated metadata, and the accuracy of IP address management is further improved.
Step 203, updating the network configuration according to the updated metadata.
In this embodiment, the execution body compares the acquired updated metadata, that is, all IP addresses on the network card with changed IP addresses, with the data of the existing local network card, and executes a network configuration instruction, for example, IP rule add (add routing rule), IP route add (add static routing), etc., to update the network configuration.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the IP address management method according to the present embodiment.
In the application scenario shown in fig. 3, a cloud host 301 running with the IP address management method is bound with an elastic network card 302, for example, the MAC address of the elastic network card 302 is 00:16: EA: AE:3C:40, and an IP is bound to the elastic network card 302, and the IP address is 192.168.0.5. For some reason, the IP address on the flexible network card 302 changes, for example, the user adds an IP address 192.168.0.6 to the flexible network card. At this time, the host 303 receives the IP change request, and sends an IP change notification to the cloud host 301, where the IP change notification includes the MAC address of the flexible network card 302. The cloud host 301 accesses an address metadata _ url provided according to the MAC address of the flexible network card 302 and the updated metadata, for example, http: //169.254.169.254, obtain updated metadata. One specific access instruction to obtain updated metadata here may be: curl http://169.254.169.254/2018-08-08/00:16: EA: AE:3C: 40. The specific process of the instruction execution is that the request for obtaining the updated metadata is routed to the virtual gateway device of the virtual network where the platform is located on the network node through the default gateway of the cloud computing management platform, then redirected to the neutral-ns-metadata-proxy service, and finally returned to the new metadata, namely all the IP addresses on the elastic network card 302 by the metadata service provided in nova-api through the neutral-metadata-agent. According to all the acquired IP addresses IP:192.168.0.5 and IP:192.168.0.6, the cloud host 301 compares the acquired IP addresses with the local existing network card data, namely IP:192.168.0.5, the network configuration is updated by executing network configuration commands, such as ip rule add, ip route add, etc.
According to the IP address management method provided by the embodiment of the disclosure, an IP change notice sent by a host computer is received, wherein the IP change notice comprises an MAC address of a network card with changed IP; acquiring updated metadata based on the MAC address of the network card, wherein the updated metadata comprises all IP addresses of the network card; according to the updated metadata, the network configuration is updated, the problems that automatic sensing cannot be achieved in the cloud host and a plurality of IP addresses cannot be automatically acquired are solved, and the efficiency and accuracy of IP address management are improved.
With further reference to fig. 4, a flow 400 of yet another embodiment of an IP address management method is shown. The process 400 of the IP address management method includes the following steps:
step 401, receiving an IP change notification sent by a host through a currently running daemon.
In this embodiment, the daemon process running on the execution subject may adopt a service process running in the prior art or future development technology, such as qemu-guest-agent, etc., which executes some task in the background and periodically or waits to process the occurrence of some event, which is not limited in this application. The daemon process can be started when the system is booted and runs until the system is closed, or can be started only when needed, and the daemon process is automatically ended after a task is finished.
Here, QEMU-guest-agent, QEMU (Quick simulator) user agent, qga for short, is a daemon process inside the execution main body, and is used to receive an instruction sent by the host machine to perform an injection operation on the execution main body or obtain information of the execution main body. Host communication with qga within the execution body extends the host's control capabilities over the execution body. qga interact with the socket channel on the host machine through the read-write serial device, the host machine can use the ordinary unix socket read-write mode to read and write the socket file, finally realizes the interaction with qga, the interaction Protocol is the same as qmp (QEMU Monitor Protocol, QEMU monitoring Protocol), the json (JavaScript Object Notation, JS Object Notation) format is simply used for data exchange, the speed of the serial device is usually low, so the serial device is more suitable for the exchange of small data volume.
In some optional ways, the currently running daemon process includes: and the daemon process runs when the cloud host is started.
In this implementation, the daemon runs when the cloud host is started until the cloud host is turned off.
According to the implementation mode, the daemon is operated when the cloud host is started, so that the cloud host can respond to the change notification of the IP address in time, the IP address is further acquired, the network configuration is updated, and the timeliness of IP address management is improved.
In some optional manners, the daemon includes an Application Programming Interface (API) for calling, and the receiving, by the daemon running at present, the IP change notification sent by the host includes: and receiving the IP change notification sent by the host machine through an Application Programming Interface (API) which can be called by the currently running daemon.
In this implementation, the execution subject may receive the IP change notification sent by the host through the application programming interface API of the daemon. Where API refers to a number of predefined functions, the purpose is to provide applications and developers the ability to access a set of routines based on certain software or hardware, without accessing source code or understanding the details of the internal working mechanisms.
The API may be named according to an actual situation, and specifically, the API for the execution subject to receive the IP change notification may be named as interface _ update, which is used to indicate the network card update.
According to the implementation mode, the IP change notification sent by the host machine is received by using the application programming interface API of the daemon process, details of specific implementation of the application program are not required, and therefore the efficiency of IP address management is further improved.
Step 402, in response to finding the group matched with the identity information in a preset database, taking the found group as the group associated with the failed module.
In this embodiment, reference may be made to the description of step 202 for details of implementation and technical effects of step 402, which are not described herein again.
Step 403, based on the alarm information, obtaining a preset number of solutions associated with the alarm information, and publishing the solutions and the alarm information to a group.
In this embodiment, reference may be made to the description of step 203 for details of implementation and technical effects of step 403, which are not described herein again.
Compared with the embodiment shown in fig. 2, the flow 400 of the IP address management method in the embodiment shown in fig. 4 highlights that the IP change notification sent by the host is received by the currently running daemon process. Therefore, the scheme described in this embodiment enables the execution main body to respond to the notification of the IP address change in time, so as to obtain all IP addresses of the network card with the changed IP address, thereby further improving the efficiency of IP address management.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an IP address management apparatus, which corresponds to the method embodiment shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 5, the IP address management apparatus 500 of the present embodiment includes: a receiving module 501, an obtaining module 502 and an updating module 503.
The obtaining module 501 may be configured to receive an IP change notification sent by a host.
In this embodiment, an execution subject (e.g., cloud hosts 101, 102, 103 shown in fig. 1) receives an IP change notification sent by a host. Here, the reason for IP change includes, but is not limited to, user creation, binding, modification of the resilient network card or intranet IP thereon, and the like.
The IP change notification includes the MAC address of the network card whose IP has changed, where the network card may be a virtual network card, such as an elastic network card, and the elastic network card is a virtual network card that can be attached to a private network (VPC) type ECS instance, and can be migrated freely among multiple cloud hosts, and each elastic network card can bind multiple intranet IP addresses.
The determination module 502 may be configured to obtain updated metadata based on the MAC address of the network card.
In this embodiment, the execution main body obtains the updated metadata through the metadata service according to the MAC address of the network card and the access address metadata _ url provided by the updated metadata, where the updated metadata includes all IP addresses on the network card where the IP changes.
The metadata (metadata), also called intermediary data and relay data, is data (data about data) describing data, and is mainly information describing data attribute (property), and is used to support functions such as indicating storage location, history data, resource search, file record, and the like. The metadata service is started locally by nova, and can inject some extra information into the virtual machine, so that the virtual machine can have some customized configuration after creation.
In some optional implementations of this embodiment, the updated metadata is obtained by: and the host machine receives the IP change request, and stores the MAC address of the network card with the changed IP address and all the IP addresses on the network card as metadata to obtain updated metadata.
In this implementation, after storing all IP address information on the network card and the network card with changed IP, the host synchronizes this part of data as metadata to the service responsible for processing metadata, and the service stores the metadata according to its attributes and provides a data address metadata _ url for subsequent access. Here, the data storage form may be a form of recording data in a certain format in a computer internal or external storage medium, for example, a database, etc., in the prior art or in the future development, which is not limited in this application.
The publish module 503 may be configured to update the network configuration based on the updated metadata.
In this embodiment, the execution body compares the acquired updated metadata, that is, all IP addresses on the network card with changed IP addresses, with the data of the existing local network card, and executes a network configuration instruction, for example, IP rule add (add routing rule), IP route add (add static routing), etc., to update the network configuration.
Those skilled in the art will appreciate that the information interaction device 500 described above also includes some other well-known structures, such as a processor, memory, etc., which are not shown in fig. 5 in order to not unnecessarily obscure embodiments of the present disclosure.
Referring now to FIG. 6, a schematic diagram of an electronic device (e.g., the server of FIG. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure. It should be noted that the computer readable medium of the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving an IP change notification sent by a host machine, wherein the IP change notification comprises an MAC address of a network card with changed IP; acquiring updated metadata based on the MAC address of the network card, wherein the updated metadata comprises all IP addresses of the network card; and updating the network configuration according to the updated metadata.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a receiving module, an obtaining module, and an updating module. The names of these modules do not in some cases constitute a limitation on the module itself, for example, a receiving module may also be described as a "module that receives IP change notifications sent by a host".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (12)

1. A method of IP address management, the method comprising:
receiving an IP change notification sent by a host machine, wherein the IP change notification comprises an MAC address of a network card with changed IP; acquiring updated metadata based on the MAC address of the network card, wherein the updated metadata comprises all IP addresses of the network card;
and updating the network configuration according to the updated metadata.
2. The method of claim 1, the updated metadata being obtained by:
a host machine receives an IP change request;
and storing the MAC address of the network card with the changed IP address and all the IP addresses on the network card as metadata to obtain updated metadata.
3. The method of claim 1, wherein receiving the IP change notification sent by the host comprises:
and receiving the IP change notification sent by the host machine through the currently running daemon.
4. The method of claim 3, the daemon including an Application Programming Interface (API) available for invocation, and the receiving, by the currently running daemon, the IP change notification sent by the host comprises:
and receiving the IP change notification sent by the host machine through an Application Programming Interface (API) which can be called by the currently running daemon.
5. The method according to any one of claims 3-4, further comprising: and running the daemon when the cloud host is started.
6. An IP address management apparatus, the apparatus comprising:
the receiving module is configured to receive an IP change notification sent by a host, wherein the IP change notification comprises an MAC address of a network card with changed IP;
the acquisition module is configured to acquire updated metadata based on the MAC address of the network card, wherein the updated metadata comprises all IP addresses of the network card;
and the updating module is configured to update the network configuration according to the updated metadata.
7. The apparatus of claim 6, the updated metadata obtained by:
a host machine receives an IP change request;
and storing the MAC address of the network card with the changed IP address and all the IP addresses on the network card as metadata to obtain updated metadata.
8. The apparatus of claim 6, the receiving module further configured to:
and receiving the IP change notification sent by the host machine through the currently running daemon.
9. The apparatus of claim 6, the daemon comprising an Application Programming Interface (API) available for invocation, and the receiving, by the daemon currently running, the IP change notification sent by the host comprises:
and receiving the IP change notification sent by the host machine through an Application Programming Interface (API) which can be called by the currently running daemon.
10. The apparatus of any of claims 7-8, further comprising:
and running the daemon when the cloud host is started.
11. An electronic device, comprising:
one or more processors;
storage means having one or more programs stored thereon which, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201911201067.0A 2019-11-29 2019-11-29 IP address management method and device Active CN112887440B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911201067.0A CN112887440B (en) 2019-11-29 2019-11-29 IP address management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911201067.0A CN112887440B (en) 2019-11-29 2019-11-29 IP address management method and device

Publications (2)

Publication Number Publication Date
CN112887440A true CN112887440A (en) 2021-06-01
CN112887440B CN112887440B (en) 2023-03-24

Family

ID=76038578

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911201067.0A Active CN112887440B (en) 2019-11-29 2019-11-29 IP address management method and device

Country Status (1)

Country Link
CN (1) CN112887440B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114466011A (en) * 2022-01-29 2022-05-10 苏州浪潮智能科技有限公司 Metadata service request method, device, equipment and medium
WO2023193402A1 (en) * 2022-04-07 2023-10-12 广州市保伦电子有限公司 Method for acquiring ip address of host on basis of virtualbox, and background server

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475704A (en) * 2013-09-06 2013-12-25 中国科学院计算技术研究所 Method for virtual node configuration for virtual cluster application
CN103731514A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Virtual network management method
US20170019304A1 (en) * 2014-02-27 2017-01-19 Institute Of Acoustics, Chinese Academy Of Sciences Method and system for virtualizing network cards on network processing platform
CN106790736A (en) * 2016-11-17 2017-05-31 上海斐讯数据通信技术有限公司 A kind of autosynchronous method of IP address of terminal and cloud terminal management system
CN106899477A (en) * 2017-03-09 2017-06-27 北京百悟科技有限公司 The construction method and device of physical machine in cloud computing platform
CN107357630A (en) * 2017-07-13 2017-11-17 郑州云海信息技术有限公司 A kind of method, apparatus and storage medium for realizing that virtual machine is synchronous
CN109684035A (en) * 2018-12-17 2019-04-26 武汉烽火信息集成技术有限公司 A kind of adaptive virtual machine and host communication means and system
CN109768871A (en) * 2017-11-09 2019-05-17 阿里巴巴集团控股有限公司 Configure method, host and the storage medium of multiple Microsoft Loopback Adapters

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475704A (en) * 2013-09-06 2013-12-25 中国科学院计算技术研究所 Method for virtual node configuration for virtual cluster application
CN103731514A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Virtual network management method
US20170019304A1 (en) * 2014-02-27 2017-01-19 Institute Of Acoustics, Chinese Academy Of Sciences Method and system for virtualizing network cards on network processing platform
CN106790736A (en) * 2016-11-17 2017-05-31 上海斐讯数据通信技术有限公司 A kind of autosynchronous method of IP address of terminal and cloud terminal management system
CN106899477A (en) * 2017-03-09 2017-06-27 北京百悟科技有限公司 The construction method and device of physical machine in cloud computing platform
CN107357630A (en) * 2017-07-13 2017-11-17 郑州云海信息技术有限公司 A kind of method, apparatus and storage medium for realizing that virtual machine is synchronous
CN109768871A (en) * 2017-11-09 2019-05-17 阿里巴巴集团控股有限公司 Configure method, host and the storage medium of multiple Microsoft Loopback Adapters
CN109684035A (en) * 2018-12-17 2019-04-26 武汉烽火信息集成技术有限公司 A kind of adaptive virtual machine and host communication means and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
很少更新了: "ip route / ip rule /iptables 配置策略路由", 《简书》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114466011A (en) * 2022-01-29 2022-05-10 苏州浪潮智能科技有限公司 Metadata service request method, device, equipment and medium
CN114466011B (en) * 2022-01-29 2023-08-04 苏州浪潮智能科技有限公司 Metadata service request method, device, equipment and medium
WO2023193402A1 (en) * 2022-04-07 2023-10-12 广州市保伦电子有限公司 Method for acquiring ip address of host on basis of virtualbox, and background server

Also Published As

Publication number Publication date
CN112887440B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
US10560538B2 (en) Integrated user interface for consuming services across different distributed networks
US11178207B2 (en) Software version control without affecting a deployed container
EP3335408B1 (en) System and method for identifying, indexing, and navigating to deep states of mobile applications
US9292319B2 (en) Global computing interface
CN104885055B (en) Application data synchronization method and device
CN111279309A (en) Container deployment based on environmental requirements
US10866884B2 (en) Stateless injected script debugging
JP2018045704A (en) Opening unsupported file types through remoting sessions
CN110780930B (en) Method and device for starting Android system, electronic equipment and storage medium
US10055393B2 (en) Distributed version control of orchestration templates
US10558710B2 (en) Sharing server conversational context between multiple cognitive engines
CN112887440B (en) IP address management method and device
EP3740869B1 (en) Automated distribution of models for execution on a non-edge device and an edge device
US10693939B2 (en) Providing modified protocol responses
US11681585B2 (en) Data migration for a shared database
US20210160202A1 (en) Managing and executing serverless function command sets in a messaging service
CN112948018A (en) Dynamic library loading method, device, equipment and medium for small program
US9606775B2 (en) Developing rich internet application
CN112491940A (en) Request forwarding method and device of proxy server, storage medium and electronic equipment
WO2022199324A1 (en) Run-time communications protocol parameter adjustment in containerized applications
US10901698B2 (en) Command tool development using a description file
WO2024025532A1 (en) Secure token for screen sharing
CN115102748A (en) Vulnerability detection method and device, storage medium and electronic equipment
CN114186156A (en) Access method, device, medium and equipment for sub-application

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