WO2015192583A1 - 一种互联网协议ip地址分配方法、装置、服务器和终端 - Google Patents

一种互联网协议ip地址分配方法、装置、服务器和终端 Download PDF

Info

Publication number
WO2015192583A1
WO2015192583A1 PCT/CN2014/090086 CN2014090086W WO2015192583A1 WO 2015192583 A1 WO2015192583 A1 WO 2015192583A1 CN 2014090086 W CN2014090086 W CN 2014090086W WO 2015192583 A1 WO2015192583 A1 WO 2015192583A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
virtual host
original
assigned
mac
Prior art date
Application number
PCT/CN2014/090086
Other languages
English (en)
French (fr)
Inventor
郭智敏
王良家
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2015192583A1 publication Critical patent/WO2015192583A1/zh

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

Definitions

  • the present invention relates to the field of Internet Protocol IP address allocation technologies, and in particular, to an Internet Protocol IP address allocation method, apparatus, server, and terminal.
  • a virtual host divides a real physical computer host into multiple logical storage units. Each unit has no physical entity, but each physical unit can work on the network like a real physical host, with a separate IP address and complete. Internet server features.
  • Virtual hosts are completely independent. From the outside world, each virtual host and a single host perform exactly the same. So this virtualized logical host is visually referred to as a virtual host.
  • Virtual hosts can be applied in the following scenarios:
  • Random IP scenarios - such as office virtual hosts used by individual users.
  • the IP address allocation method of the virtual host in the virtualized environment includes:
  • the virtual host control management module reserves a fixed IP address for the virtual host when creating the virtual host
  • DHCP mainly provides addresses and configuration parameters for hosts on the Internet.
  • DHCP has three mechanisms for assigning IP addresses:
  • DHCP assigns a permanent IP address to the client
  • DHCP assigns an IP address to the client that expires for a period of time (or the client can actively release the address);
  • the network administrator assigns an IP address to the client.
  • the administrator can send the specified IP address to the client through DHCP.
  • IP address When assigning IP to a virtual host, even if the DHCP service is used, only the static IP address of the virtual host can be set. Once the IP address is configured successfully, the address cannot be changed. If the agent is installed inside the virtual host, the agent needs to be updated at the same time. The virtual host is upgraded and the system is complicated.
  • An internet protocol IP address allocation method includes:
  • the original to-be-assigned IP address is a static IP address
  • determining, according to a correspondence between a MAC address of the pre-established virtual host and an original to-be-assigned IP address determining, corresponding to the first MAC address.
  • the steps of the first target IP address include:
  • the original to-be-assigned IP address is a dynamic IP address
  • determining, according to a correspondence between a MAC address of the pre-established virtual host and an original to-be-assigned IP address determining, corresponding to the first MAC address.
  • the steps of the first target IP address include:
  • the method further includes:
  • the method further includes:
  • An Internet Protocol IP address allocation apparatus includes a first receiving module, an address determining module, and an address assigning module, wherein:
  • the first receiving module is configured to: receive an address request message that is sent by the first virtual host to obtain an IP address, where the address request message carries a first medium access control MAC address of the first virtual host;
  • the address determining module is configured to: determine, according to a correspondence between a MAC address of the pre-established virtual host and an original to-be-assigned IP address, a first target IP address corresponding to the first MAC address, where the original destination is Assign the IP address to a static IP address or a dynamic IP address.
  • the address assignment module is configured to: assign the first target IP address to the first virtual host.
  • the address determining module when the original to-be-assigned IP address is a static IP address, the address determining module And determining, according to the corresponding relationship between the MAC address of the pre-established virtual host and the original to-be-assigned IP address, determining the first target IP address corresponding to the first MAC address:
  • the address determining module is configured to determine, according to the correspondence between the MAC address of the pre-established virtual host and the original to-be-assigned IP address, according to the following manner.
  • the device further includes a second receiving module and a deleting module, wherein:
  • the second receiving module is configured to: receive a delete request message requesting to delete the second virtual host, where the delete request message carries the second MAC address of the second virtual host;
  • the deleting module is configured to delete an entry corresponding to the second MAC address in the correspondence.
  • the apparatus further includes a third receiving module and an address modifying module, wherein:
  • the third receiving module is configured to: receive an address modification request message requesting to modify, in the corresponding relationship, a third original to-be-assigned IP address corresponding to the third MAC address to a fourth original to-be-assigned IP address;
  • the address modification module is configured to modify, according to the address modification request message, a third original to-be-assigned IP address corresponding to the third MAC address to the fourth original to-be-assigned IP address in the corresponding relationship. .
  • a server having at least one virtual host comprising the IP address allocating device of any of the above.
  • a terminal the terminal being provided with at least one virtual host, the terminal comprising the IP address allocation device according to any one of the above.
  • a computer program comprising program instructions that, when executed by an IP address assigning device, cause the IP address assigning device to perform the IP address allocation method.
  • the embodiment of the invention can flexibly allocate a dynamic or static IP address to the virtual host
  • the embodiment of the invention can modify the IP address assigned to the virtual host or release the virtual host occupied IP address after deleting the virtual host;
  • the embodiments of the present invention fully utilize the functions of the existing operating system DHCP service, and do not need to install an agent program inside the virtual host, which simplifies system complexity.
  • FIG. 1 is a schematic flowchart of an IP address allocation method according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of an IP address allocation apparatus according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of performing IP address allocation for a virtual host according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of an overall process for performing IP address allocation for a virtual host according to an embodiment of the present invention.
  • An embodiment of the present invention provides a method for allocating an IP address of an Internet protocol.
  • the method is as shown in FIG. 1 and includes:
  • Step 11 Receive an address request message sent by the first virtual host to obtain an IP address, where Carrying the first media access control MAC address of the first virtual host in the address request message;
  • Step 12 Determine, according to a correspondence between a MAC address of the pre-established virtual host and an original to-be-assigned IP address, a first target IP address corresponding to the first MAC address, where the original to-be-assigned IP address is static. IP address or dynamic IP address;
  • Step 13 Assign the first target IP address to the first virtual host.
  • the server or the computer terminal provided with the virtual host After receiving the address request message, the server or the computer terminal provided with the virtual host determines the first target IP address corresponding to the first MAC address of the first virtual host according to the pre-established correspondence, and the first target IP address is obtained. Assigned to the first virtual host.
  • the IP address here can be a static IP address or a dynamic IP address.
  • step 12 is specifically:
  • the first static IP address corresponding to the first MAC address is determined as the first target IP address.
  • step 12 is specifically:
  • a pre-established correspondence specifies one of the first dynamic IP addresses as the first target IP address.
  • the IP address occupied by the virtual host may be released after the virtual host is deleted. That is, the method further includes:
  • the second virtual host When the second virtual host needs to be deleted, the second virtual host is deleted in the corresponding relationship.
  • the MAC address and the IP address that has been assigned to the second virtual host, that is, the entry corresponding to the second MAC address is deleted in the corresponding relationship, and the IP address occupied by the deleted virtual host is released.
  • IP address assigned to the virtual host can also be modified in the embodiment of the present invention. That is, the method further includes:
  • the third virtual host After the IP address corresponding to the third MAC address is modified, the third virtual host restarts, and an IP address request message is sent. At this time, the process of assigning an IP address to the virtual host according to the foregoing may be the first The third virtual host determines the target IP address in the fourth original to-be-assigned IP address.
  • the embodiment of the invention further provides an Internet Protocol IP address allocation device, as shown in FIG. 2, the device includes:
  • the first receiving module 21 is configured to: receive an address request message that is sent by the first virtual host to obtain an IP address, where the address request message carries a first medium access control MAC address of the first virtual host;
  • the address determining module 22 is configured to: determine, according to a correspondence between a MAC address of the pre-established virtual host and an original to-be-assigned IP address, a first target IP address corresponding to the first MAC address, where the original Assign the IP address to a static IP address or a dynamic IP address.
  • the address allocation module 23 is configured to: allocate the first target IP address to the first virtual host.
  • the address determining module is specifically:
  • the address determining module is specifically:
  • the above IP address allocation device further includes:
  • the second receiving module 24 is configured to: receive a delete request message requesting to delete the second virtual host, where the delete request message carries the second MAC address of the second virtual host;
  • the deleting module 25 is configured to delete an entry corresponding to the second MAC address in the correspondence.
  • the above IP address allocation device further includes:
  • the third receiving module 26 is configured to: receive an address modification request message requesting to modify the third original to-be-assigned IP address corresponding to the third MAC address to the fourth original to-be-assigned IP address in the corresponding relationship;
  • the address modification module 27 is configured to modify, according to the address modification request message, the third original to-be-assigned IP address corresponding to the third MAC address to the fourth original to-be-assigned IP address in the corresponding relationship. .
  • a function of dynamically allocating an IP address in the DHCP technology is provided, and a system architecture for allocating an IP address to the virtual host is set, as shown in FIG. 3, including:
  • the virtual machine control management module is responsible for creating/modifying/deleting virtual hosts, allocating/recycling virtual host IP addresses (static IP or dynamic IP address segments), and synchronizing virtual host MAC and IP correspondences and rules to the DHCP service module;
  • the DHCP service module is configured to receive the virtual host IP address synchronization message of the virtual machine control management module, perform virtual host MAC and IP address correspondence and rule maintenance, respond to the virtual host request message, and assign an IP address to the virtual host;
  • the virtual host is responsible for requesting an IP address from the DHCP service module.
  • the virtual machine control management module reserves an IP address for the virtual host, and synchronizes the correspondence and rules of the virtual host MAC and IP to the DHCP. Service module
  • the virtual machine control management module assigns a dynamic IP address segment to the virtual host, and synchronizes the correspondence and rules of the virtual host MAC and the IP address segment to the DHCP service module.
  • the DHCP service module increases the correspondence and rules of the virtual host MAC and IP address/address segments
  • the virtual host sends an IP address request message to the DHCP service module.
  • the DHCP service module assigns an IP to the virtual host according to the correspondence and rules of the virtual host MAC and IP.
  • the virtual machine control management module synchronizes the correspondence and rules of the virtual host MAC and the new IP address/address segment to the DHCP service module;
  • the DHCP service module modifies the correspondence and rules of the virtual host MAC and IP address/address segment
  • the virtual host sends an IP address request message to the DHCP service module (in this case, the address request message is generally sent after the virtual host is restarted);
  • the DHCP service module assigns an IP to the virtual host according to the correspondence and rules of the virtual host MAC and IP.
  • the virtual machine control management module synchronizes the virtual host MAC that needs to be deleted to the DHCP service module
  • the DHCP service module deletes the correspondence and rules of the virtual host MAC and IP address/address segment.
  • the virtual machine control management module is mainly configured to: establish a correspondence between the virtual host MAC and the IP address, and the DHCP service module maintains different IP allocation rules, MAC and IP for each virtual host according to the corresponding relationship. Correspondence, and assign IP to the virtual host according to the policy to meet the diverse (static and dynamic) control management requirements for the virtual host IP in the virtualized environment.
  • the DHCP service module includes the first receiving module, the address determining module, and the address assigning module.
  • the embodiment of the present invention further provides a server, where the server has at least one virtual host, and the server includes any one of the foregoing.
  • the embodiment of the present invention further provides a terminal, where the terminal is provided with at least one virtual host, and the terminal includes the IP address allocation device according to any one of the above.
  • the system architecture of FIG. 3 When the system architecture of FIG. 3 is applied to a server or a terminal, when there are multiple virtual hosts, multiple virtual hosts need to run on one or more hosts of the server or the terminal; the virtual machine control management module and the DHCP service module are Physically, it can be set separately or in combination; the virtual machine control management module and the DHCP service module need to be connected through the management network of the server or terminal, such as the network management system; the DHCP service module and the virtual host are connected through the specific service network of the server or the terminal.
  • the virtual machine control management module connects to the host through the management network, manages the virtual host through the host control, and does not directly connect with the virtual host.
  • the embodiment of the invention can flexibly allocate a dynamic or static IP address to the virtual host
  • the embodiment of the invention can modify the IP address assigned to the virtual host or release the virtual host occupied IP address after deleting the virtual host;
  • the embodiments of the present invention fully utilize the functions of the existing operating system DHCP service, and do not need to install an agent program inside the virtual host, which simplifies system complexity.
  • the present invention has strong industrial applicability.

Landscapes

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

Abstract

一种互联网协议IP地址分配方法、装置、服务器和终端,其中,所述方法包括:接收第一虚拟主机发送的请求获取IP地址的地址请求消息,所述地址请求消息中携带所述第一虚拟主机的第一介质访问控制MAC地址;根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址,其中所述原始待分配IP地址为静态IP地址或动态IP地址;将所述第一目标IP地址分配给所述第一虚拟主机。上述技术方案能够为虚拟主机灵活分配动态或静态IP地址。

Description

一种互联网协议IP地址分配方法、装置、服务器和终端 技术领域
本发明涉及互联网协议IP地址分配技术领域,尤其涉及一种互联网协议IP地址分配方法、装置、服务器和终端。
背景技术
虚拟主机是把真实的物理电脑主机分割成多个逻辑存储单元,每个单元都没有物理实体,但是每一个物理单元都能像真实的物理主机一样在网络上工作,具有单独的IP地址以及完整的Internet服务器功能。
其关键在于,即使在同一台硬件、同一个操作系统上,运行着为多个用户打开的不同的服务器程式,也互不干扰。而各个用户拥有自己的一部分系统资源(互联网协议IP地址、文档存储空间、内存、中央处理器CPU时间等)。虚拟主机之间完全独立。在外界看来,每一台虚拟主机和一台单独的主机的表现完全相同。所以这种被虚拟化的逻辑主机被形象地称为虚拟主机。
虚拟主机可以应用在以下情景中:
固定IP场景——例如使用虚拟主机作为业务服务器、数据库服务器等;
随机IP场景——例如个人用户使用的办公虚拟主机等。
虚拟化环境下虚拟主机的IP地址分配方法包括:
虚拟主机控制管理模块在创建虚拟主机时,给虚拟主机预留分配固定的IP;
虚拟主机启动时,或者通过虚拟主机内部的代理程序,或者通过操作系统自带的动态主机配置协议DHCP服务,完成虚拟主机的静态IP设置。
其中,DHCP主要是为互联网上的主机提供地址和配置参数。DHCP有三种机制分配IP地址:
1.自动分配(Automatic Allocation):DHCP给客户端分配永久性的IP地址;
2.动态分配(Dynamic Allocation),DHCP给客户端分配过一段时间会过期的IP地址(或者客户端可以主动释放该地址);
3.手工配置(Manual Allocation),由网络管理员给客户端指定IP地址。管理员可以通过DHCP将指定的IP地址发给客户端。
三种地址分配方式中,只有动态分配可以重复使用客户端不再需要的地址。
在为虚拟主机分配IP时,即使通过DHCP服务,也只能设置虚拟主机静态IP,一旦配置IP地址成功,该地址不能改动,如果虚拟主机内部安装了代理程序,那么更新代理程序的同时需要进行虚拟主机的升级,系统复杂。
发明内容
本发明的目的是提供一种互联网协议IP地址分配方法、装置、服务器和终端,为虚拟主机灵活分配动态或静态IP地址。
为解决上述技术问题,采用如下技术方案:
一种互联网协议IP地址分配方法,包括:
接收第一虚拟主机发送的请求获取IP地址的地址请求消息,所述地址请求消息中携带所述第一虚拟主机的第一介质访问控制MAC地址;
根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址,其中所述原始待分配IP地址为静态IP地址或动态IP地址;
将所述第一目标IP地址分配给所述第一虚拟主机。
可选地,所述原始待分配IP地址为静态IP地址时,所述根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址的步骤包括:
根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一静态IP地址确定为所述第一目标IP地址。
可选地,所述原始待分配IP地址为动态IP地址时,所述根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址的步骤包括:
根据预先建立的虚拟主机MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一动态IP地址中的一个确定为所述第一目标IP地址。
可选地,该方法还包括:
接收请求删除第二虚拟主机的删除请求消息,所述删除请求消息中携带所述第二虚拟主机的第二MAC地址;
在所述对应关系中删除对应于所述第二MAC地址的条目。
可选地,该方法还包括:
接收请求在所述对应关系中将与第三MAC地址对应的第三原始待分配IP地址修改为第四原始待分配IP地址的地址修改请求消息;
根据所述地址修改请求消息,在所述对应关系中将与所述第三MAC地址对应的第三原始待分配IP地址修改为所述第四原始待分配IP地址。
一种互联网协议IP地址分配装置,包括第一接收模块、地址确定模块和地址分配模块,其中:
所述第一接收模块设置成:接收第一虚拟主机发送的请求获取IP地址的地址请求消息,所述地址请求消息中携带所述第一虚拟主机的第一介质访问控制MAC地址;
所述地址确定模块设置成:根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址,其中所述原始待分配IP地址为静态IP地址或动态IP地址;
所述地址分配模块设置成:将所述第一目标IP地址分配给所述第一虚拟主机。
可选地,所述原始待分配IP地址为静态IP地址时,所述地址确定模块 设置成按照如下方式根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址:
根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一静态IP地址确定为所述第一目标IP地址。
可选地,所述原始待分配IP地址为动态IP地址时,所述地址确定模块设置成按照如下方式根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址:
根据预先建立的虚拟主机MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一动态IP地址中的一个确定为所述第一目标IP地址。
可选地,该装置还包括第二接收模块和删除模块,其中:
所述第二接收模块设置成:接收请求删除第二虚拟主机的删除请求消息,所述删除请求消息中携带所述第二虚拟主机的第二MAC地址;
所述删除模块设置成:在所述对应关系中删除对应于所述第二MAC地址的条目。
可选地,该装置还包括第三接收模块和地址修改模块,其中:
所述第三接收模块设置成:接收请求在所述对应关系中将与第三MAC地址对应的第三原始待分配IP地址修改为第四原始待分配IP地址的地址修改请求消息;
所述地址修改模块设置成:根据所述地址修改请求消息,在所述对应关系中将与所述第三MAC地址对应的第三原始待分配IP地址修改为所述第四原始待分配IP地址。
一种服务器,所述服务器具有至少一个虚拟主机,所述服务器包括上述任一项所述的IP地址分配装置。
一种终端,所述终端设置有至少一个虚拟主机,所述终端包括上述任一项所述的IP地址分配装置。
一种计算机程序,包括程序指令,当该程序指令被IP地址分配装置执行时,使得该IP地址分配装置可执行所述的IP地址分配方法。
一种载有上述计算机程序的载体。
本发明实施例具有以下有益效果中的至少一项:
本发明实施例能够为虚拟主机灵活分配动态或静态IP地址;
本发明实施例能够修改已分配给虚拟主机的IP地址或在删除虚拟主机后,释放虚拟主机占用的IP地址;
本发明实施例充分利用了既有的操作系统DHCP服务的功能,同时不需要在虚拟主机内部安装代理程序,简化了系统复杂性。
附图概述
图1为本发明实施例提供的IP地址分配方法的流程示意图;
图2为本发明实施例提供的IP地址分配装置的结构示意图;
图3为本发明实施例提供的为虚拟主机进行IP地址分配的架构示意图;
图4为本发明实施例提供的为虚拟主机进行IP地址分配的整体流程示意图。
本发明的较佳实施方式
下面将结合附图及具体实施例进行详细描述。
本发明实施例提供了一种互联网协议IP地址分配方法,所述方法如图1所示,包括:
步骤11,接收第一虚拟主机发送的请求获取IP地址的地址请求消息,所 述地址请求消息中携带所述第一虚拟主机的第一介质访问控制MAC地址;
步骤12,根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址,其中所述原始待分配IP地址为静态IP地址或动态IP地址;
步骤13,将所述第一目标IP地址分配给所述第一虚拟主机。
当设置有虚拟主机的服务器或电脑终端等接收到地址请求消息后,根据预先建立的对应关系,确定与第一虚拟主机第一MAC地址对应的第一目标IP地址,将该第一目标IP地址分配给所述第一虚拟主机。这里的IP地址可以是静态IP地址或动态IP地址。
其中,所述原始待分配IP地址为静态IP地址时,步骤12具体为:
根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一静态IP地址确定为所述第一目标IP地址。
如果预先建立的对应关系中,虚拟主机的MAC地址对应于静态IP地址,则将与所述第一MAC地址对应的第一静态IP地址确定为所述第一目标IP地址。
当所述原始待分配IP地址为动态IP地址时,步骤12具体为:
根据预先建立的虚拟主机MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一动态IP地址中的一个确定为所述第一目标IP地址。
如果预先建立的对应关系中,虚拟主机的MAC地址对应于动态IP地址,也就是一个IP地址段,则在第一动态IP地址中指定一个作为第一目标IP地址。
在本发明实施例中,除了能够为虚拟主机灵活分配动态或静态IP地址外,还可以在删除虚拟主机后,释放虚拟主机占用的IP地址。即所述方法还包括:
接收请求删除第二虚拟主机的删除请求消息,所述删除请求消息中携带所述第二虚拟主机的第二MAC地址;
在所述对应关系中删除对应于所述第二MAC地址的条目。
当需要删除第二虚拟主机时,在对应关系中删除第二虚拟主机的第二 MAC地址以及已经分配给第二虚拟主机的IP地址,即在所述对应关系中删除对应于所述第二MAC地址的条目,此时释放掉已经删除的虚拟主机占用的IP地址。
另外,在本发明实施例中还可以修改已分配给虚拟主机的IP地址。即所述方法还包括:
接收请求在所述对应关系中将与第三MAC地址对应的第三原始待分配IP地址修改为第四原始待分配IP地址的地址修改请求消息;
根据所述地址修改请求消息,在所述对应关系中将与所述第三MAC地址对应的第三原始待分配IP地址修改为所述第四原始待分配IP地址。
当修改完与所述第三MAC地址对应的IP地址后,第三虚拟主机重启时,会发送IP地址请求消息,此时在根据之前所述的为虚拟主机分配IP地址的过程就可以为第三虚拟主机在第四原始待分配IP地址中确定目标IP地址。
在本发明实施例的上述过程中,不需要在虚拟主机内部安装代理程序,简化了系统复杂性。
本发明实施例还提供了一种互联网协议IP地址分配装置,所述装置如图2所示,包括:
第一接收模块21,设置成:接收第一虚拟主机发送的请求获取IP地址的地址请求消息,所述地址请求消息中携带所述第一虚拟主机的第一介质访问控制MAC地址;
地址确定模块22,设置成:根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址,其中所述原始待分配IP地址为静态IP地址或动态IP地址;
地址分配模块23,设置成:将所述第一目标IP地址分配给所述第一虚拟主机。
上述的IP地址分配装置,其中,所述原始待分配IP地址为静态IP地址时,所述地址确定模块具体为:
根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一静态IP地址确定为所述第一目标IP地址。
上述的IP地址分配装置,其中,所述原始待分配IP地址为动态IP地址时,所述地址确定模块具体为:
根据预先建立的虚拟主机MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一动态IP地址中的一个确定为所述第一目标IP地址。
上述的IP地址分配装置,还包括:
第二接收模块24,设置成:接收请求删除第二虚拟主机的删除请求消息,所述删除请求消息中携带所述第二虚拟主机的第二MAC地址;
删除模块25,设置成:在所述对应关系中删除对应于所述第二MAC地址的条目。
上述的IP地址分配装置,还包括:
第三接收模块26,设置成:接收请求在所述对应关系中将与第三MAC地址对应的第三原始待分配IP地址修改为第四原始待分配IP地址的地址修改请求消息;
地址修改模块27,设置成:根据所述地址修改请求消息,在所述对应关系中将与所述第三MAC地址对应的第三原始待分配IP地址修改为所述第四原始待分配IP地址。
另外,在本发明实施例中还提供了利用DHCP技术中动态分配IP地址的功能,设置了为虚拟主机分配IP地址的系统架构,如图3所示,包括:
虚机控制管理模块,负责虚拟主机的创建/修改/删除、虚拟主机IP地址的分配/回收(静态IP或动态IP地址段)、把虚拟主机MAC和IP对应关系和规则同步给DHCP服务模块;
DHCP服务模块,负责接收虚机控制管理模块的虚拟主机IP地址同步消息、进行虚拟主机MAC和IP地址对应关系和规则的维护、响应虚拟主机请求消息并给虚拟主机分配IP地址;
虚拟主机,负责向DHCP服务模块请求IP地址。
对应的整体工作流程如图4所示,当虚机控制管理模块创建虚拟主机时:
1.若虚拟主机IP管理策略为静态IP,则虚机控制管理模块给虚拟主机预留分配IP地址,并把虚拟主机MAC和IP的对应关系和规则,同步给DHCP 服务模块;
2.若虚拟主机IP管理策略为动态IP,则虚机控制管理模块给虚拟主机指定动态IP地址段,并把虚拟主机MAC和IP地址段的对应关系和规则,同步给DHCP服务模块;
3.DHCP服务模块增加虚拟主机MAC和IP地址/地址段的对应关系和规则;
4.虚拟主机向DHCP服务模块发送IP地址请求消息;
5.DHCP服务模块根据虚拟主机MAC和IP的对应关系和规则,给虚拟主机分配IP。
当虚机控制管理模块修改虚拟主机IP时:
1.虚机控制管理模块把虚拟主机MAC和新IP地址/地址段的对应关系和规则,同步给DHCP服务模块;
2.DHCP服务模块修改虚拟主机MAC和IP地址/地址段的对应关系和规则;
3.虚拟主机向DHCP服务模块发送IP地址请求消息(此时一般为虚拟主机重启后发送地址请求消息);
4.DHCP服务模块根据虚拟主机MAC和IP的对应关系和规则,给虚拟主机分配IP。
当虚机控制管理模块删除虚拟主机时:
1.虚机控制管理模块把需要删除的虚拟主机MAC同步给DHCP服务模块;
2.DHCP服务模块删除虚拟主机MAC和IP地址/地址段的对应关系和规则。
通过上述过程可以看出,虚机控制管理模块主要是设置成:建立虚拟主机MAC和IP地址的对应关系,由DHCP服务模块根据对应关系对各虚拟主机维护不同的IP分配规则、以及MAC和IP对应关系,并根据该策略给虚拟主机分配IP,以满足虚拟化环境下对虚拟主机IP的多样的(静态和动态)控制管理要求。其中,DHCP服务模块包括上述的第一接收模块、地址确定模块和地址分配模块。
考虑到虚拟主机可以应用在服务器上或是用户个人使用的电脑终端上,因此,本发明实施例还提供了一种服务器,所述服务器具有至少一个虚拟主机,所述服务器包括上述任一项所述的IP地址分配装置。
本发明实施例还提供了一种终端,所述终端设置有至少一个虚拟主机,所述终端包括上述任一项所述的IP地址分配装置。
当图3的系统架构应用在服务器或终端上时,当存在多个虚拟主机时,多个虚拟主机需要运行在服务器或终端的一个或多个主机上;虚机控制管理模块、DHCP服务模块在物理上可以分开设置,也可以合并设置;虚机控制管理模块、DHCP服务模块,需要通过服务器或终端的管理网络,例如网管系统连接;DHCP服务模块、虚拟主机通过服务器或终端的具体业务网络连接;虚机控制管理模块通过管理网络与主机连接,通过主机控制管理虚拟主机,而不直接和虚拟主机连接。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。
工业实用性
本发明实施例具有以下有益效果中的至少一项:
本发明实施例能够为虚拟主机灵活分配动态或静态IP地址;
本发明实施例能够修改已分配给虚拟主机的IP地址或在删除虚拟主机后,释放虚拟主机占用的IP地址;
本发明实施例充分利用了既有的操作系统DHCP服务的功能,同时不需要在虚拟主机内部安装代理程序,简化了系统复杂性。
因此本发明具有很强的工业实用性。

Claims (14)

  1. 一种互联网协议IP地址分配方法,包括:
    接收第一虚拟主机发送的请求获取IP地址的地址请求消息,所述地址请求消息中携带所述第一虚拟主机的第一介质访问控制MAC地址;
    根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址,其中所述原始待分配IP地址为静态IP地址或动态IP地址;
    将所述第一目标IP地址分配给所述第一虚拟主机。
  2. 如权利要求1所述的IP地址分配方法,其中,所述原始待分配IP地址为静态IP地址时,所述根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址的步骤包括:
    根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一静态IP地址确定为所述第一目标IP地址。
  3. 如权利要求1所述的IP地址分配方法,其中,所述原始待分配IP地址为动态IP地址时,所述根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址的步骤包括:
    根据预先建立的虚拟主机MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一动态IP地址中的一个确定为所述第一目标IP地址。
  4. 如权利要求1-3任一项所述的IP地址分配方法,该方法还包括:
    接收请求删除第二虚拟主机的删除请求消息,所述删除请求消息中携带所述第二虚拟主机的第二MAC地址;
    在所述对应关系中删除对应于所述第二MAC地址的条目。
  5. 如权利要求1-3任一项所述的IP地址分配方法,该方法还包括:
    接收请求在所述对应关系中将与第三MAC地址对应的第三原始待分配 IP地址修改为第四原始待分配IP地址的地址修改请求消息;
    根据所述地址修改请求消息,在所述对应关系中将与所述第三MAC地址对应的第三原始待分配IP地址修改为所述第四原始待分配IP地址。
  6. 一种互联网协议IP地址分配装置,包括第一接收模块、地址确定模块和地址分配模块,其中:
    所述第一接收模块设置成:接收第一虚拟主机发送的请求获取IP地址的地址请求消息,所述地址请求消息中携带所述第一虚拟主机的第一介质访问控制MAC地址;
    所述地址确定模块设置成:根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址,其中所述原始待分配IP地址为静态IP地址或动态IP地址;
    所述地址分配模块设置成:将所述第一目标IP地址分配给所述第一虚拟主机。
  7. 如权利要求6所述的IP地址分配装置,其中,所述原始待分配IP地址为静态IP地址时,所述地址确定模块设置成按照如下方式根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址:
    根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一静态IP地址确定为所述第一目标IP地址。
  8. 如权利要求6所述的IP地址分配装置,其中,所述原始待分配IP地址为动态IP地址时,所述地址确定模块设置成按照如下方式根据预先建立的虚拟主机的MAC地址与原始待分配IP地址之间的对应关系,确定与所述第一MAC地址对应的第一目标IP地址:
    根据预先建立的虚拟主机MAC地址与原始待分配IP地址之间的对应关系,将与所述第一MAC地址对应的第一动态IP地址中的一个确定为所述第一目标IP地址。
  9. 如权利要求6-8中任一项所述的IP地址分配装置,该装置还包括第二接收模块和删除模块,其中:
    所述第二接收模块设置成:接收请求删除第二虚拟主机的删除请求消息,所述删除请求消息中携带所述第二虚拟主机的第二MAC地址;
    所述删除模块设置成:在所述对应关系中删除对应于所述第二MAC地址的条目。
  10. 如权利要求6-8中任一项所述的IP地址分配装置,该装置还包括第三接收模块和地址修改模块,其中:
    所述第三接收模块设置成:接收请求在所述对应关系中将与第三MAC地址对应的第三原始待分配IP地址修改为第四原始待分配IP地址的地址修改请求消息;
    所述地址修改模块设置成:根据所述地址修改请求消息,在所述对应关系中将与所述第三MAC地址对应的第三原始待分配IP地址修改为所述第四原始待分配IP地址。
  11. 一种服务器,所述服务器包括至少一个虚拟主机,其中,所述服务器包括如权利要求6-10中任一项所述的IP地址分配装置。
  12. 一种终端,所述终端设置有至少一个虚拟主机,其中,所述终端包括如权利要求6-10中任一项所述的IP地址分配装置。
  13. 一种计算机程序,包括程序指令,当该程序指令被IP地址分配装置执行时,使得该IP地址分配装置可执行权利要求1-5中任一项所述的IP地址分配方法。
  14. 一种载有权利要求13所述计算机程序的载体。
PCT/CN2014/090086 2014-06-16 2014-10-31 一种互联网协议ip地址分配方法、装置、服务器和终端 WO2015192583A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410268512.6 2014-06-16
CN201410268512.6A CN105208137A (zh) 2014-06-16 2014-06-16 一种互联网协议ip地址分配方法、装置、服务器和终端

Publications (1)

Publication Number Publication Date
WO2015192583A1 true WO2015192583A1 (zh) 2015-12-23

Family

ID=54934806

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/090086 WO2015192583A1 (zh) 2014-06-16 2014-10-31 一种互联网协议ip地址分配方法、装置、服务器和终端

Country Status (2)

Country Link
CN (1) CN105208137A (zh)
WO (1) WO2015192583A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108810192A (zh) * 2018-07-20 2018-11-13 郑州云海信息技术有限公司 一种静态ip配置方法、装置、设备及可读存储介质
CN112688958A (zh) * 2020-12-30 2021-04-20 联想未来通信科技(重庆)有限公司 一种信息处理方法及电子设备
CN115834296A (zh) * 2023-02-16 2023-03-21 北京融为科技有限公司 一种数据传输方法、装置、电子设备和存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110177048B (zh) * 2019-05-28 2022-03-25 银联商务股份有限公司 一种虚拟私有云系统的高可用实现方法及装置
CN114172864B (zh) * 2020-08-21 2024-04-09 中国移动通信集团重庆有限公司 物联网终端地址分配方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247396A (zh) * 2008-02-20 2008-08-20 北大方正集团有限公司 一种分配ip地址的方法、装置及系统
CN102710814A (zh) * 2012-06-21 2012-10-03 奇智软件(北京)有限公司 虚拟机ip地址的控制方法及装置
CN102932498A (zh) * 2012-10-24 2013-02-13 广州杰赛科技股份有限公司 一种云计算平台的虚拟机ip资源管理方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247396A (zh) * 2008-02-20 2008-08-20 北大方正集团有限公司 一种分配ip地址的方法、装置及系统
CN102710814A (zh) * 2012-06-21 2012-10-03 奇智软件(北京)有限公司 虚拟机ip地址的控制方法及装置
CN102932498A (zh) * 2012-10-24 2013-02-13 广州杰赛科技股份有限公司 一种云计算平台的虚拟机ip资源管理方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108810192A (zh) * 2018-07-20 2018-11-13 郑州云海信息技术有限公司 一种静态ip配置方法、装置、设备及可读存储介质
CN112688958A (zh) * 2020-12-30 2021-04-20 联想未来通信科技(重庆)有限公司 一种信息处理方法及电子设备
CN115834296A (zh) * 2023-02-16 2023-03-21 北京融为科技有限公司 一种数据传输方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN105208137A (zh) 2015-12-30

Similar Documents

Publication Publication Date Title
US11418512B2 (en) Method for virtual machine to access physical server in cloud computing system, apparatus, and system
US10635496B2 (en) Thread pool management
US10701139B2 (en) Life cycle management method and apparatus
US9846591B2 (en) Method, device and system for migrating configuration information during live migration of virtual machine
US10666508B2 (en) Unified software defined networking configuration management over multiple hosting environments
CN109254831B (zh) 基于云管理平台的虚拟机网络安全管理方法
US8554890B2 (en) Method of deploying a production environment using a development environment
JP7135260B2 (ja) コンピュータ実施方法及びシステム
EP3261300A1 (en) Method and device for establishing link between virtual network functions
WO2015192583A1 (zh) 一种互联网协议ip地址分配方法、装置、服务器和终端
WO2021098819A1 (zh) 一种路由更新方法和用户集群
CN104506654B (zh) 云计算系统及动态主机配置协议服务器备份方法
CN111585887B (zh) 基于多个网络的通信方法、装置、电子设备及存储介质
US20180332006A1 (en) Application attachment based firewall management
EP3788772B1 (en) On-node dhcp implementation for virtual machines
KR20110083084A (ko) 가상화를 이용한 서버 운영 장치 및 방법
TW201426553A (zh) 虛擬機管理系統及方法
KR101493828B1 (ko) 가상머신 초기 설정 자동화 방법 및 가상머신 초기 설정 자동화 서비스 제공 방법
JP2015002424A (ja) アドレス割当装置、管理装置、アドレス割当プログラムおよび管理プログラム
CN103118115A (zh) 面向云计算用户的虚拟机管理方法及装置
JP2015103827A (ja) 管理装置、方法及びプログラム
US20060225125A1 (en) Terminal device login method and system
TW201518951A (zh) 用於雲端系統的控制中心部署方法
KR20230060941A (ko) 가상네트워크관리장치 및 가상네트워크관리장치의 동작 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14894937

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14894937

Country of ref document: EP

Kind code of ref document: A1