[go: up one dir, main page]

HK40090849B - Virtual private cloud communication method, virtual private cloud communication configuration method, and related apparatuses - Google Patents

Virtual private cloud communication method, virtual private cloud communication configuration method, and related apparatuses Download PDF

Info

Publication number
HK40090849B
HK40090849B HK62023079295.9A HK62023079295A HK40090849B HK 40090849 B HK40090849 B HK 40090849B HK 62023079295 A HK62023079295 A HK 62023079295A HK 40090849 B HK40090849 B HK 40090849B
Authority
HK
Hong Kong
Prior art keywords
address
vpc
gateway
message
private network
Prior art date
Application number
HK62023079295.9A
Other languages
Chinese (zh)
Other versions
HK40090849A (en
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 HK40090849A publication Critical patent/HK40090849A/en
Publication of HK40090849B publication Critical patent/HK40090849B/en

Links

Description

虚拟私有云通信及配置方法以及相关装置Virtual Private Cloud Communication and Configuration Methods and Related Devices

技术领域Technical Field

本申请涉及云技术领域,特别涉及一种虚拟私有云通信及配置方法以及相关装置。This application relates to the field of cloud technology, and in particular to a virtual private cloud communication and configuration method and related apparatus.

背景技术Background Technology

随着云技术的发展,存在两个或多个虚拟私有网络(Virtual Private Cloud,VPC)之间通信的诉求,但由于私网地址规划等原因,若需要通信的VPC之间存在私网地址重叠,则会造成VPC之间不能通信。With the development of cloud technology, there is a need for communication between two or more Virtual Private Clouds (VPCs). However, due to reasons such as private network address planning, if the private network addresses of the VPCs that need to communicate overlap, it will cause the VPCs to be unable to communicate.

发明内容Summary of the Invention

为解决现有技术的问题,本发明实施例提供一种虚拟私有云通信及配置方法以及相关装置,能有效解决云上的VPC之间因私网地址重叠而不能通信的技术问题。To address the problems of existing technologies, embodiments of the present invention provide a virtual private cloud communication and configuration method and related apparatus, which can effectively solve the technical problem that VPCs in the cloud cannot communicate due to overlapping private network addresses.

第一方面,本申请提供一种虚拟私有云VPC通信的配置方法,在该方法中,具有相同私网地址段的第一虚拟私有云VPC和第二VPC通过第三VPC进行通信,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,该方法包括以下步骤:将第一VPC内的私网地址与第一地址进行绑定,其中,第一地址为归属于第三VPC的私网地址段的地址,将第二VPC内的私网地址与第二地址进行绑定,其中,第二地址为归属于第三VPC的私网地址段的地址,第一地址与第二地址不相同,将第一VPC发送至第二VPC的报文的源地址配置为第一地址,目的地址配置为第二地址。In one aspect, this application provides a configuration method for Virtual Private Cloud (VPC) communication. In this method, a first VPC and a second VPC with the same private network address range communicate through a third VPC. The private network address range of the third VPC is different from that of the first VPC and the second VPC. The method includes the following steps: binding the private network address in the first VPC to a first address, wherein the first address is an address belonging to the private network address range of the third VPC; binding the private network address in the second VPC to a second address, wherein the second address is an address belonging to the private network address range of the third VPC; the first address and the second address are different; configuring the source address of the message sent from the first VPC to the second VPC as the first address and the destination address as the second address.

通过第三VPC的桥接,第一VPC通过访问与第二VPC绑定的第二地址来访问第二VPC,且第二VPC通过访问与第一VPC绑定的第一地址来访问第一VPC,可以在第一VPC和第二VPC在私网地址段重叠的情况下实现第一VPC与第二VPC之间的通信。Through the bridging of the third VPC, the first VPC accesses the second VPC by accessing the second address bound to the second VPC, and the second VPC accesses the first VPC by accessing the first address bound to the first VPC. This enables communication between the first VPC and the second VPC even when their private network address ranges overlap.

根据第一方面的一种可能的实现方式,上述配置方法还包括在第三VPC上配置路由规则的步骤,第三VPC上的路由规则包括:将目的地址为第一地址的报文转发到第一VPC,将目的地址为第二地址的报文转发到第二VPC。According to one possible implementation of the first aspect, the above configuration method further includes the step of configuring routing rules on the third VPC, wherein the routing rules on the third VPC include: forwarding packets with a destination address of the first address to the first VPC, and forwarding packets with a destination address of the second address to the second VPC.

通过配置路由规则,可使得第三VPC转发第一VPC与第二VPC之间的报文,实现桥接。By configuring routing rules, the third VPC can forward packets between the first and second VPCs, thus achieving bridging.

根据第一方面的一种可能的实现方式,上述配置方法还包括以下步骤:在第一VPC中配置第一网关,以及在第二VPC中配置第二网关,其中,将第一网关的私网地址配置为第一地址,将第二网关的私网地址配置为第二地址,在第一网关上配置第一报文处理规则,第一报文处理规则包括:将出报文的源地址由第一VPC内的地址转换为第一地址,将入报文的目的地址由第一地址转换为第一VPC内的地址,在第二网关上配置第二报文处理规则,第二报文处理规则包括:将出报文的源地址由第二VPC内的地址转换为第二地址,将入报文的目的地址由第二地址转换为第二VPC内的地址。According to one possible implementation of the first aspect, the above configuration method further includes the following steps: configuring a first gateway in a first VPC and configuring a second gateway in a second VPC, wherein the private network address of the first gateway is configured as a first address and the private network address of the second gateway is configured as a second address; configuring a first packet processing rule on the first gateway, the first packet processing rule including: converting the source address of outgoing packets from the address in the first VPC to the first address and converting the destination address of incoming packets from the first address to the address in the first VPC; configuring a second packet processing rule on the second gateway, the second packet processing rule including: converting the source address of outgoing packets from the address in the second VPC to the second address and converting the destination address of incoming packets from the second address to the address in the second VPC.

通过配置报文处理规则,第一网关将第一VPC内的地址和第一地址绑定,第二网关将第二VPC内的地址和第二地址绑定,从而使得第一VPC通过访问第二地址来访问第二VPC,并使得第二VPC通过访问第一地址来访问第一VPC。By configuring message processing rules, the first gateway binds the address in the first VPC to the first address, and the second gateway binds the address in the second VPC to the second address. This allows the first VPC to access the second VPC by accessing the second address, and the second VPC to access the first VPC by accessing the first address.

根据第一方面的一种可能的实现方式,该配置方法还包括配置路由规则的步骤,具体地,在第一VPC的路由器上配置路由规则,第一VPC的路由器上的路由规则包括:将目的地址为第二地址的报文转发到第一网关,将目的地址为第一VPC内的地址的报文转发到第一VPC的子网,在第二VPC的路由器上配置路由规则,第二VPC的路由器上的路由规则包括:将目的地址为第一地址的报文转发到第二网关,将目的地址为第二VPC内的地址的报文转发到第一VPC的子网。According to one possible implementation of the first aspect, the configuration method further includes the step of configuring routing rules. Specifically, routing rules are configured on the router of the first VPC, and the routing rules on the router of the first VPC include: forwarding packets with a destination address of the second address to the first gateway, and forwarding packets with a destination address within the first VPC to the subnet of the first VPC. Routing rules are also configured on the router of the second VPC, and the routing rules on the router of the second VPC include: forwarding packets with a destination address of the first address to the second gateway, and forwarding packets with a destination address within the second VPC to the subnet of the first VPC.

通过配置路由规则,可以使得第一VPC的路由器可以将报文在第一网关和第一VPC内的子网之间进行转发,并使得第二VPC的路由器可以将报文在第二网关和第二VPC的子网之间进行转发。By configuring routing rules, the router in the first VPC can forward packets between the first gateway and the subnets within the first VPC, and the router in the second VPC can forward packets between the second gateway and the subnets of the second VPC.

根据第一方面的其他可能的实现方式,第一VPC内的地址包括远程接入到第一VPC的云下数据中心的子网中的地址。According to other possible implementations of the first aspect, the addresses within the first VPC include addresses in the subnet of the on-premises data center that remotely accesses the first VPC.

根据第一方面的其他可能的实现方式,第一VPC内的地址包括第一VPC的子网中的地址。According to other possible implementations of the first aspect, the addresses within the first VPC include the addresses within the subnets of the first VPC.

第二方面,本申请提供一种虚拟私有云VPC通信的配置方法,该方法用于具有相同私网地址段的第一虚拟私有云VPC和第二VPC通过第三VPC进行通信,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,该方法包括以下步骤:在第一VPC中配置第一网关,以及在第二VPC中配置第二网关,其中,为第一网关配置第一地址,为第二网关配置第二地址,第一地址和第二地址归属于第三VPC的私网地址段,第一地址以及第二地址不相同,在第一网关上配置第一报文处理规则,在第二网关上配置第二报文处理规则,其中,第一报文处理规则包括:将出报文的源地址由第一VPC内的地址转换为第一地址,将入报文的目的地址由第一地址转换为第一VPC内的地址,第二报文处理规则包括:将出报文的源地址由第二VPC内的地址转换为第二地址,将入报文的目的地址由第二地址转换为第二VPC内的地址,在第一VPC的路由器上配置第一路由规则,在第二VPC的路由器上配置第二路由规则,在第三VPC的路由器上配置第三路由规则,其中,第一路由规则包括:将目的地址为第二地址的报文路由至第一网关,第二路由规则包括:将目的地址为第一地址的报文路由至第二网关,第三路由规则包括:将目的地址为第一地址的报文路由至第一VPC中的第一网关,将目的地址为第二地址的报文路由至第二VPC中的第二网关。Secondly, this application provides a configuration method for Virtual Private Cloud (VPC) communication. This method is used for communication between a first VPC and a second VPC with the same private network address range via a third VPC. The private network address range of the third VPC is different from that of the first and second VPCs. The method includes the following steps: configuring a first gateway in the first VPC and configuring a second gateway in the second VPC, wherein a first address is configured for the first gateway, and a second address is configured for the second gateway. The first and second addresses belong to the private network address range of the third VPC, and the first and second addresses are different. A first message processing rule is configured on the first gateway, and a second message processing rule is configured on the second gateway. The first message processing rule includes: converting the source address of outgoing messages from an address within the first VPC to a first... The first routing rule converts the destination address of incoming packets from the first address to an address within the first VPC. The second packet processing rule includes: converting the source address of outgoing packets from an address within the second VPC to the second address, and converting the destination address of incoming packets from the second address to an address within the second VPC. The first routing rule is configured on the router of the first VPC, the second routing rule is configured on the router of the second VPC, and the third routing rule is configured on the router of the third VPC. The first routing rule includes: routing packets with a destination address of the second address to the first gateway. The second routing rule includes: routing packets with a destination address of the first address to the second gateway within the first VPC, and routing packets with a destination address of the second address to the second gateway within the second VPC.

通过第三VPC的桥接,第一VPC通过访问与第二VPC绑定的第二地址来访问第二VPC,且第二VPC通过访问与第一VPC绑定的第一地址来访问第一VPC,可以在第一VPC和第二VPC在私网地址段重叠的情况下实现第一VPC与第二VPC之间的通信。Through the bridging of the third VPC, the first VPC accesses the second VPC by accessing the second address bound to the second VPC, and the second VPC accesses the first VPC by accessing the first address bound to the first VPC. This enables communication between the first VPC and the second VPC even when their private network address ranges overlap.

根据第二方面的一种可能的实现方式,上述方法还包括以下步骤:配置第一VPC与第三VPC的连接关系,以及配置第二VPC与第三VPC的连接关系。According to one possible implementation of the second aspect, the above method further includes the following steps: configuring the connection relationship between the first VPC and the third VPC, and configuring the connection relationship between the second VPC and the third VPC.

具体地,可通过配置第一VPC中的第一网关连接第三VPC中的路由器,配置第二VPC中的第二网关连接第三VPC中的路由器,从而使得第一VPC和第二VPC分别与第三VPC连接,且第三VPC通过与第一VPC绑定的第一地址对第一VPC进行寻址,通过与第二VPC绑定的第二地址对第二VPC进行寻址。Specifically, the router in the third VPC can be connected to the first gateway in the first VPC, and the router in the third VPC can be connected to the second gateway in the second VPC. This allows the first VPC and the second VPC to be connected to the third VPC respectively, and the third VPC addresses the first VPC through the first address bound to the first VPC, and addresses the second VPC through the second address bound to the second VPC.

第三方面,本申请提供一种虚拟私有云VPC通信方法,该方法用于具有相同私网地址段的第一虚拟私有云VPC和第二VPC通过第三VPC进行通信,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,该方法包括以下步骤:第一VPC发送报文,报文的源地址为第一地址,目的地址为第二地址,第一地址和第二地址均为归属于第三VPC的私网地址段的地址,第一VPC内的私网地址与第一地址绑定,第二VPC内的私网地址与第二地址绑定,第三VPC接收报文,根据预先设置的路由规则将报文转发到第二VPC,其中第三VPC的路由规则包括:将目的地址为第二地址的报文转发到第二VPC。Thirdly, this application provides a Virtual Private Cloud (VPC) communication method. This method is used for a first VPC and a second VPC with the same private network address range to communicate through a third VPC. The private network address range of the third VPC is different from that of the first VPC and the second VPC. The method includes the following steps: the first VPC sends a message with a source address of a first address and a destination address of a second address. Both the first address and the second address belong to the private network address range of the third VPC. The private network address in the first VPC is bound to the first address, and the private network address in the second VPC is bound to the second address. The third VPC receives the message and forwards it to the second VPC according to a pre-set routing rule. The routing rule of the third VPC includes forwarding messages with a destination address of the second address to the second VPC.

通过第三VPC的桥接,第一VPC通过访问与第二VPC绑定的第二地址来访问第二VPC,且第二VPC通过访问与第一VPC绑定的第一地址来访问第一VPC,可以在第一VPC和第二VPC在私网地址段重叠的情况下实现第一VPC与第二VPC之间的通信。Through the bridging of the third VPC, the first VPC accesses the second VPC by accessing the second address bound to the second VPC, and the second VPC accesses the first VPC by accessing the first address bound to the first VPC. This enables communication between the first VPC and the second VPC even when their private network address ranges overlap.

根据第三方面的一种可能的实现方式,路由规则还包括:将目的地址为第一地址的报文转发到第一VPC,此时,上述方法还包括以下步骤:第二VPC发送响应报文,响应报文的源地址为第二地址,目的地址为第一地址,第三VPC接收响应报文,根据路由规则将响应报文转发到第一VPC。According to one possible implementation of the third aspect, the routing rule also includes: forwarding the packet with the destination address as the first address to the first VPC. In this case, the above method also includes the following steps: the second VPC sends a response packet with the source address as the second address and the destination address as the first address; the third VPC receives the response packet and forwards the response packet to the first VPC according to the routing rule.

通过设置路由规则,可使得第二VPC反馈的应答报文通过第三VPC转发到第一VPC,从而实现应答。By setting routing rules, the response message from the second VPC can be forwarded to the first VPC through the third VPC, thus achieving the response.

第四方面,本申请提供一种虚拟私有云VPC通信方法,第一VPC和第二VPC通过第三VPC进行通信,第一VPC与第二VPC具有相同的私网地址段,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,第一VPC设置有第一网关,第二VPC设置有第二网关,第一网关配置有第一地址,第二网关配置有第二地址,第一地址和第二地址均归属于第三VPC的私网地址段,第一地址与第二地址不相同,该方法包括以下步骤:第一VPC的路由器接收第一设备发送的报文,其中,报文的源地址为第一设备的私网地址,目的地址为第二地址,第一VPC的路由器根据第一路由规则将报文转发至第一网关,第一网关将报文的源地址修改为第一地址,将修改后的报文转发到第三VPC的路由器,其中,第三VPC的路由器设置有第三路由规则,第一路由规则包括:目的地址属于第三VPC的私网地址段的报文需要转发至第一网关,第三路由规则包括:目的地址为第二地址的报文需要转发至第二VPC的第二网关。Fourthly, this application provides a Virtual Private Cloud (VPC) communication method. A first VPC and a second VPC communicate through a third VPC. The first VPC and the second VPC share the same private network address range, while the private network address range of the third VPC is different from that of the first and second VPCs. The first VPC is equipped with a first gateway, and the second VPC is equipped with a second gateway. The first gateway is configured with a first address, and the second gateway is configured with a second address. Both the first and second addresses belong to the private network address range of the third VPC, but the first address and the second address are different. The method includes the following steps: the first VPC's routing... The router receives a message sent by the first device, wherein the source address of the message is the private network address of the first device and the destination address is the second address. The router of the first VPC forwards the message to the first gateway according to the first routing rule. The first gateway modifies the source address of the message to the first address and forwards the modified message to the router of the third VPC. The router of the third VPC is configured with a third routing rule. The first routing rule includes: messages whose destination address belongs to the private network address range of the third VPC need to be forwarded to the first gateway. The third routing rule includes: messages whose destination address is the second address need to be forwarded to the second gateway of the second VPC.

通过第三VPC的桥接,第一VPC通过访问与第二VPC绑定的第二地址来访问第二VPC,且第二VPC通过访问与第一VPC绑定的第一地址来访问第一VPC,可以在第一VPC和第二VPC在私网地址段重叠的情况下实现第一VPC与第二VPC之间的通信。Through the bridging of the third VPC, the first VPC accesses the second VPC by accessing the second address bound to the second VPC, and the second VPC accesses the first VPC by accessing the first address bound to the first VPC. This enables communication between the first VPC and the second VPC even when their private network address ranges overlap.

在第四方面的一种可能的实现方式中,第一设备可以是第一VPC的第一子网中的第一虚拟机,也可以是与第一VPC通过远程通信隧道连接的第一云下数据中心的第二子网中的物理机或虚拟机,第二设备可以是第二VPC的第三子网中的第二虚拟机,也可以是与第二VPC通过远程通信隧道连接的第二云下数据中心的第四子网中的物理机或虚拟机,In one possible implementation of the fourth aspect, the first device can be a first virtual machine in a first subnet of a first VPC, or a physical machine or virtual machine in a second subnet of a first on-premises data center connected to the first VPC via a remote communication tunnel. The second device can be a second virtual machine in a third subnet of a second VPC, or a physical machine or virtual machine in a fourth subnet of a second on-premises data center connected to the second VPC via a remote communication tunnel.

在第四方面的一种可能的实现方式中,上述方法还包括以下步骤:第二网关接收第三VPC的路由器转发的报文,将接收到的报文的目的地址修改为第二设备的地址,并将修改后的报文发送至第二VPC的路由器,第二VPC的路由器根据第二路由规则将接收到的报文转发到第二设备所在的子网,第二路由规则包括:目的地址属于第二地址的报文需要转发到第二设备所在的子网。In one possible implementation of the fourth aspect, the above method further includes the following steps: the second gateway receives a packet forwarded by the router of the third VPC, modifies the destination address of the received packet to the address of the second device, and sends the modified packet to the router of the second VPC. The router of the second VPC forwards the received packet to the subnet where the second device is located according to the second routing rules. The second routing rules include: packets whose destination address belongs to the second address need to be forwarded to the subnet where the second device is located.

通过第二网关的报文修改和转发,并且经过第二VPC的路由器的转发之后,该报文可到达第二设备所在的子网,使得第二设备可以接收到该报文。After the message is modified and forwarded by the second gateway, and then forwarded by the router of the second VPC, the message can reach the subnet where the second device is located, so that the second device can receive the message.

第五方面,本申请提供一种虚拟私有云VPC通信的配置装置,具有相同私网地址段的第一虚拟私有云VPC和第二VPC通过第三VPC进行通信,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,该装置包括以下模块:地址绑定模块,用于将第一VPC内的私网地址与第一地址进行绑定,其中,第一地址为归属于第三VPC的私网地址段的地址,用于将第二VPC内的私网地址与第二地址进行绑定,其中,第二地址为归属于第三VPC的私网地址段的地址,第一地址与第二地址不相同,地址配置模块,用于将第一VPC发送至第二VPC的报文的源地址配置为第一地址,目的地址配置为第二地址,以及将第二VPC发送至第一VPC的报文的源地址配置为第二地址,目的地址配置为第一地址。Fifthly, this application provides a configuration device for Virtual Private Cloud (VPC) communication. A first VPC and a second VPC with the same private network address range communicate through a third VPC. The private network address range of the third VPC is different from that of the first VPC and the second VPC. The device includes the following modules: an address binding module, used to bind a private network address in the first VPC to a first address, wherein the first address is an address belonging to the private network address range of the third VPC; and a module for binding a private network address in the second VPC to a second address, wherein the second address is an address belonging to the private network address range of the third VPC; the first address and the second address are different; and an address configuration module, used to configure the source address of a message sent from the first VPC to the second VPC as the first address and the destination address as the second address, and to configure the source address of a message sent from the second VPC to the first VPC as the second address and the destination address as the first address.

第五方面或第五方面任意一种实现方式是第一方面或第一方面任意一种实现方式对应的装置实现,第一方面或第一方面任意一种实现方式中的描述适用于第五方面或第五方面任意一种实现方式,在此不再赘述。The fifth aspect or any implementation thereof is a device implementation corresponding to the first aspect or any implementation thereof. The description in the first aspect or any implementation thereof applies to the fifth aspect or any implementation thereof, and will not be repeated here.

第六方面,本申请提供一种虚拟私有云VPC通信的配置装置,具有相同私网地址段的第一虚拟私有云VPC和第二VPC通过第三VPC进行通信,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,该装置包括:网关配置模块,用于在第一VPC中配置第一网关,以及在第二VPC中配置第二网关,地址配置模块,用于为第一网关配置第一地址,为第二网关配置第二地址,第一地址和第二地址归属于第三VPC的私网地址段,第一地址以及第二地址不相同,地址绑定模块,用于在第一网关上配置第一报文处理规则,在第二网关上配置第二报文处理规则,其中,第一报文处理规则包括:将出报文的源地址由第一VPC内的地址转换为第一地址,并将修改后的出报文发送至第三VPC的路由器,将入报文的目的地址由第一地址转换为第一VPC内的地址,并将修改后的入报文发送至第一VPC的路由器,第二报文处理规则包括:将出报文的源地址由第二VPC内的地址转换为第二地址,并将修改后的出报文发送至第三VPC的路由器,将入报文的目的地址由第二地址转换为第二VPC内的地址,并将修改后的入报文发送至第二VPC的路由器,路由规则配置模块,用于在第一VPC的路由器上配置第一路由规则,在第二VPC的路由器上配置第二路由规则,在第三VPC的路由器上配置第三路由规则,其中,第一路由规则包括:将目的地址为第二地址的报文路由至第一网关,第二路由规则包括:将目的地址为第一地址的报文路由至第二网关,第三路由规则包括:将目的地址为第一地址的报文路由至第一VPC中的第一网关,将目的地址为第二地址的报文路由至第二VPC中的第二网关。Sixthly, this application provides a configuration device for Virtual Private Cloud (VPC) communication. A first VPC and a second VPC with the same private network address range communicate through a third VPC. The private network address range of the third VPC is different from that of the first VPC and the second VPC. The device includes: a gateway configuration module for configuring a first gateway in the first VPC and a second gateway in the second VPC; an address configuration module for configuring a first address for the first gateway and a second address for the second gateway, wherein the first address and the second address belong to the private network address range of the third VPC and are different; and an address binding module for configuring a first packet processing rule on the first gateway and a second packet processing rule on the second gateway. The first packet processing rule includes: converting the source address of outgoing packets from the address in the first VPC to the first address and sending the modified outgoing packets to the router of the third VPC; and converting the destination address of incoming packets from the first address to... The first routing rule configuration module is used to configure a first routing rule on the router of the first VPC, a second routing rule on the router of the second VPC, and a third routing rule on the router of the third VPC. The first routing rule includes routing packets with a destination address of the second address to the first gateway. The second routing rule includes routing packets with a destination address of the first address to the second gateway. The third routing rule includes routing packets with a destination address of the first address to the first gateway in the first VPC and routing packets with a destination address of the second address to the second gateway in the second VPC.

第六方面或第六方面任意一种实现方式是第二方面或第二方面任意一种实现方式对应的装置实现,第二方面或第二方面任意一种实现方式中的描述适用于第六方面或第六方面任意一种实现方式,在此不再赘述。The sixth aspect or any implementation thereof is a device implementation corresponding to the second aspect or any implementation thereof. The description in the second aspect or any implementation thereof applies to the sixth aspect or any implementation thereof, and will not be repeated here.

第七方面,本申请提供一种虚拟私有云VPC通信系统,包括第一虚拟私有云VPC、第二VPC以及第三VPC,第一VPC和第二VPC具有相同私网地址段,第一VPC和第二VPC通过第三VPC进行通信,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,第一VPC,用于发送报文,报文的源地址为第一地址,目的地址为第二地址,第一地址和第二地址均为归属于第三VPC的私网地址段的地址,第一VPC内的私网地址与第一地址绑定,第二VPC内的私网地址与第二地址绑定,第三VPC,用于接收报文,根据预先设置的路由规则将报文转发到第二VPC,其中第三VPC的路由规则包括:将目的地址为第二地址的报文转发到第二VPC。Seventhly, this application provides a Virtual Private Cloud (VPC) communication system, including a first VPC, a second VPC, and a third VPC. The first VPC and the second VPC have the same private network address range. The first VPC and the second VPC communicate through the third VPC. The private network address range of the third VPC is different from that of the first VPC and the second VPC. The first VPC is used to send messages. The source address of the message is a first address, and the destination address is a second address. Both the first address and the second address belong to the private network address range of the third VPC. The private network addresses in the first VPC are bound to the first address, and the private network addresses in the second VPC are bound to the second address. The third VPC is used to receive messages and forward messages to the second VPC according to pre-set routing rules. The routing rules of the third VPC include: forwarding messages with the destination address of the second address to the second VPC.

第七方面或第七方面任意一种实现方式是第三方面或第三方面任意一种实现方式对应的系统实现,第三方面或第三方面任意一种实现方式中的描述适用于第七方面或第七方面任意一种实现方式,在此不再赘述。The seventh aspect or any implementation of the seventh aspect is the system implementation corresponding to the third aspect or any implementation of the third aspect. The description in the third aspect or any implementation of the third aspect applies to the seventh aspect or any implementation of the seventh aspect, and will not be repeated here.

第八方面,本申请提供一种虚拟私有云VPC通信系统,包括第一虚拟私有云VPC、第二VPC以及第三VPC,第一VPC和第二VPC通过第三VPC进行通信,第一VPC与第二VPC具有相同的私网地址段,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,第一VPC设置有第一网关,第二VPC设置有第二网关,第一网关配置有第一地址,第二网关配置有第二地址,第一地址和第二地址均归属于第三VPC的私网地址段,第一地址与第二地址不相同,其中,第一VPC的路由器,用于接收第一设备发送的报文,其中,报文的源地址为第一设备的私网地址,目的地址为第二地址,第一VPC的路由器,还用于根据第一路由规则将报文转发至第一网关,第一网关,用于将报文的源地址修改为第一地址,将修改后的报文转发到第三VPC的路由器,其中,第三VPC的路由器设置有第三路由规则,第一路由规则包括:目的地址属于第三VPC的私网地址段的报文需要转发至第一网关,第三路由规则包括:目的地址为第二地址的报文需要转发至第二VPC的第二网关。Eighthly, this application provides a Virtual Private Cloud (VPC) communication system, including a first VPC, a second VPC, and a third VPC. The first VPC and the second VPC communicate through the third VPC. The first VPC and the second VPC share the same private network address range. The private network address range of the third VPC is different from that of the first VPC and the second VPC. The first VPC is equipped with a first gateway, and the second VPC is equipped with a second gateway. The first gateway is configured with a first address, and the second gateway is configured with a second address. Both the first address and the second address belong to the private network address range of the third VPC. The first address and the second address are different. The router in the first VPC is used to receive packets sent by the first device, where the source address of the packet is the private network address of the first device and the destination address is the second address. The router in the first VPC is also used to forward the packets to the first gateway according to the first routing rules. The first gateway is used to modify the source address of the packet to the first address and forward the modified packet to the router in the third VPC. The router in the third VPC is configured with third routing rules. The first routing rules include: packets whose destination address belongs to the private network address range of the third VPC need to be forwarded to the first gateway. The third routing rules include: packets whose destination address is the second address need to be forwarded to the second gateway of the second VPC.

第八方面或第八方面任意一种实现方式是第四方面或第四方面任意一种实现方式对应的系统实现,第四方面或第四方面任意一种实现方式中的描述适用于第八方面或第八方面任意一种实现方式,在此不再赘述。The eighth aspect or any implementation of the eighth aspect is the system implementation corresponding to the fourth aspect or any implementation of the fourth aspect. The description in the fourth aspect or any implementation of the fourth aspect applies to the eighth aspect or any implementation of the eighth aspect, and will not be repeated here.

第九方面,本申请提供一种虚拟私有云VPC通信系统,包括第一虚拟私有云VPC、第二VPC以及第三VPC,第一VPC和第二VPC通过第三VPC进行通信,第一VPC与第二VPC具有相同的私网地址段,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,第一VPC设置有与第三VPC连接的第一网关,第二VPC设置有与第三VPC连接的第二网关,第一网关配置有第一地址,第二网关配置有第二地址,第一地址和第二地址均归属于第三VPC的私网地址段,第一地址与第二地址不相同,其中,第一VPC的第一子网中的第一虚拟机,用于发送报文至第一子网的交换机,其中,报文的源地址为第一虚拟机在第一子网中的私网地址,目的地址为第二地址,第一子网的交换机,用于发送报文至第一VPC的路由器,第一VPC的路由器,用于接收报文,将报文转发至第一网关,第一网关,用于接收报文,将报文的源地址修改为第一地址,将修改后的报文转发到第三VPC的路由器,第三VPC的路由器,用于接收报文,将报文转发至第二网关,第二网关,用于接收报文,将接收到的报文的目的地址修改为第二VPC的第二子网中的第二虚拟机在第二子网中的私网地址,并将修改后的报文发送至第二VPC的路由器,第二VPC的路由器,用于接收报文,将报文转发到第二子网中的交换机,第二子网中的交换机,用于接收报文,将报文发送至第二虚拟机。Ninthly, this application provides a Virtual Private Cloud (VPC) communication system, including a first VPC, a second VPC, and a third VPC. The first VPC and the second VPC communicate through the third VPC. The first VPC and the second VPC share the same private network address range. The private network address range of the third VPC is different from that of the first VPC and the second VPC. The first VPC is configured with a first gateway connected to the third VPC, and the second VPC is configured with a second gateway connected to the third VPC. The first gateway is configured with a first address, and the second gateway is configured with a second address. Both the first address and the second address belong to the private network address range of the third VPC, but the first address and the second address are different. A first virtual machine in a first subnet of the first VPC is used to send packets to the switch of the first subnet. The source address of the packet is the address of the first virtual machine in the first subnet. The private network address in the first subnet has a destination address of the second address. The switch in the first subnet sends packets to the router in the first VPC. The router in the first VPC receives packets and forwards them to the first gateway. The first gateway receives packets, modifies the source address of the packets to the first address, and forwards the modified packets to the router in the third VPC. The router in the third VPC receives packets and forwards them to the second gateway. The second gateway receives packets, modifies the destination address of the received packets to the private network address of the second virtual machine in the second subnet of the second VPC, and sends the modified packets to the router in the second VPC. The router in the second VPC receives packets and forwards them to the switch in the second subnet. The switch in the second subnet receives packets and sends them to the second virtual machine.

第十方面,本申请提供一种虚拟私有云VPC通信系统,包括第一虚拟私有云VPC、第二VPC以及第三VPC,第一VPC和第二VPC通过第三VPC进行通信,第一VPC与第二VPC具有相同的私网地址段,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,第一VPC设置有与第一云下数据中心远程连接的第一远程连接网关以及与第三VPC连接的第一网关,第二VPC设置有与第二云下数据中心远程连接的第二远程连接网关以及与第三VPC连接的第二网关,第一网关配置有第一地址,第二网关配置有第二地址,第一地址和第二地址均归属于第三VPC的私网地址段,第一地址与第二地址不相同,其中,第一远程连接网关,用于接收第一云下数据中心的第一子网中的第一设备发送的报文,并将报文发送至第一VPC的路由器,其中,报文的源地址为第一设备在第一子网中的私网地址,目的地址为第二地址,第一VPC的路由器,用于接收报文,将报文转发至第一网关,第一网关,用于接收报文,将报文的源地址修改为第一地址,将修改后的报文转发到第三VPC的路由器,第三VPC的路由器,用于接收报文,将报文转发至第二网关,第二网关,用于接收报文,将接收到的报文的目的地址修改为第二云下数据中心的第二子网中的第二设备在第二子网中的私网地址,并将修改后的报文发送至第二VPC的路由器,第二VPC的路由器,用于接收报文,将报文转发到第二远程连接网关,第二远程连接网关,用于接收报文,将报文发送至第二云下数据中心的第二子网中的第二设备。Tenthly, this application provides a Virtual Private Cloud (VPC) communication system, including a first VPC, a second VPC, and a third VPC. The first VPC and the second VPC communicate through the third VPC. The first VPC and the second VPC share the same private network address range, while the private network address range of the third VPC is different from that of the first VPC and the second VPC. The first VPC is equipped with a first remote connection gateway for remote connection to a first on-premises data center and a first gateway for connection to the third VPC. The second VPC is equipped with a second remote connection gateway for remote connection to a second on-premises data center and a second gateway for connection to the third VPC. The first gateway is configured with a first address, and the second gateway is configured with a second address. Both the first address and the second address belong to the private network address range of the third VPC, but the first address and the second address are different. The first remote connection gateway is used to receive a first address from the first subnet of the first on-premises data center. The device sends a message and forwards it to the router of the first VPC. The source address of the message is the private network address of the first device in the first subnet, and the destination address is the second address. The router of the first VPC receives the message and forwards it to the first gateway. The first gateway receives the message, modifies the source address of the message to the first address, and forwards the modified message to the router of the third VPC. The router of the third VPC receives the message and forwards it to the second gateway. The second gateway receives the message, modifies the destination address of the received message to the private network address of the second device in the second subnet of the second cloud data center, and sends the modified message to the router of the second VPC. The router of the second VPC receives the message and forwards it to the second remote connection gateway. The second remote connection gateway receives the message and sends it to the second device in the second subnet of the second cloud data center.

第十一方面,本申请提供一种虚拟私有云VPC通信系统,包括第一虚拟私有云VPC、第二VPC以及第三VPC,第一VPC和第二VPC通过第三VPC进行通信,第一VPC与第二VPC具有相同的私网地址段,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,第一VPC设置有第一网关,第二VPC设置有第二网关,第一网关配置有第一地址,第二网关配置有第二地址,第一地址和第二地址均归属于第三VPC的私网地址段,第一VPC的路由器和第二VPC的路由器分别与第三VPC的路由器连接,第一地址与第二地址不相同,其中,第一VPC的第一子网中的第一虚拟机,用于发送报文至第一子网的交换机,其中,报文的源地址为第一虚拟机在第一子网中的私网地址,目的地址为第二地址,第一子网的交换机,用于发送报文至第一网关,第一网关,用于将报文的源地址修改为第一地址,将修改后的报文发送至第一VPC的路由器,第一VPC的路由器,用于接收报文,将报文转发至第三VPC的路由器,第三VPC的路由器,用于接收报文,将报文转发到第二VPC的路由器,第二VPC的路由器,用于接收报文,将报文转发至第二网关,第二网关,用于接收报文,将接收到的报文的目的地址修改为第二VPC的第二子网中的第二虚拟机在第二子网中的私网地址,并将修改后的报文发送至第二子网的交换机,第二子网的交换机,用于接收报文,将报文发送至第二虚拟机。Eleventhly, this application provides a Virtual Private Cloud (VPC) communication system, including a first VPC, a second VPC, and a third VPC. The first VPC and the second VPC communicate through the third VPC. The first VPC and the second VPC share the same private network address range, while the private network address range of the third VPC is different from that of the first VPC and the second VPC. The first VPC is equipped with a first gateway, and the second VPC is equipped with a second gateway. The first gateway is configured with a first address, and the second gateway is configured with a second address. Both the first address and the second address belong to the private network address range of the third VPC. The routers of the first VPC and the second VPC are respectively connected to the router of the third VPC. The first address and the second address are different. A first virtual machine in a first subnet of the first VPC is used to send packets to the switch of the first subnet. The source address of the message is the private network address of the first virtual machine in the first subnet, and the destination address is the second address. The switch of the first subnet is used to send the message to the first gateway. The first gateway is used to modify the source address of the message to the first address and send the modified message to the router of the first VPC. The router of the first VPC is used to receive the message and forward the message to the router of the third VPC. The router of the third VPC is used to receive the message and forward the message to the router of the second VPC. The router of the second VPC is used to receive the message and forward the message to the second gateway. The second gateway is used to receive the message, modify the destination address of the received message to the private network address of the second virtual machine in the second subnet of the second VPC, and send the modified message to the switch of the second subnet. The switch of the second subnet is used to receive the message and send the message to the second virtual machine.

第十二方面,本申请提供一种计算设备,包括至少一个存储器和至少一个处理器,至少一个存储器用于存储程序指令,至少一个处理器执行程序指令,以执行实现第一方面及其任一种可能的实现方式的方法。In a twelfth aspect, this application provides a computing device including at least one memory and at least one processor, wherein the at least one memory is used to store program instructions and the at least one processor executes the program instructions to perform a method for implementing the first aspect and any possible implementation thereof.

第十三方面,本申请提供一种计算设备,包括至少一个存储器和至少一个处理器,至少一个存储器用于存储程序指令,至少一个处理器执行程序指令,以执行实现第二方面及其任一种可能的实现方式的方法。In a thirteenth aspect, this application provides a computing device including at least one memory and at least one processor, wherein the at least one memory is used to store program instructions and the at least one processor executes the program instructions to perform a method for implementing the second aspect and any possible implementation thereof.

第十四方面,本申请提供了一种非瞬态的可读存储介质,所述非瞬态的可读存储介质被计算设备执行时,所述计算设备执行前述第一方面或第一方面的任意可能的实现方式中提供的方法。该存储介质中存储了程序。该存储介质包括但不限于易失性存储器,例如随机访问存储器,非易失性存储器,例如快闪存储器、硬盘(英文:hard disk drive,缩写:HDD)、固态硬盘(英文:solid state drive,缩写:SSD)。In a fourteenth aspect, this application provides a non-transient readable storage medium, which, when executed by a computing device, performs the method provided in the first aspect or any possible implementation thereof. The storage medium stores a program. The storage medium includes, but is not limited to, volatile memory, such as random access memory, and non-volatile memory, such as flash memory, hard disk drive (HDD), and solid-state drive (SSD).

第十五方面,本申请还提供了一种非瞬态的可读存储介质,所述非瞬态的可读存储介质被计算设备执行时,所述计算设备执行前述第二方面或第二方面的任意可能的实现方式中提供的方法。该存储介质中存储了程序。该存储介质包括但不限于易失性存储器,例如随机访问存储器,非易失性存储器,例如快闪存储器、硬盘(英文:hard disk drive,缩写:HDD)、固态硬盘(英文:solid state drive,缩写:SSD)。In a fifteenth aspect, this application also provides a non-transient readable storage medium, which, when executed by a computing device, performs the method provided in the second aspect or any possible implementation thereof. The storage medium stores a program. The storage medium includes, but is not limited to, volatile memory, such as random access memory, and non-volatile memory, such as flash memory, hard disk drive (HDD), and solid-state drive (SSD).

第十六方面,本申请提供了一种计算设备程序产品,所述计算设备程序产品包括计算机指令,在被计算设备执行时,所述计算设备执行前述第一方面或第一方面的任意可能的实现方式中提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第一方面或第一方面的任意可能的实现方式中提供的方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。In a sixteenth aspect, this application provides a computing device program product comprising computer instructions that, when executed by a computing device, enable the computing device to perform the methods provided in the first aspect or any possible implementation thereof. The computer program product may be a software installation package, which can be downloaded and executed on a computing device when the methods provided in the first aspect or any possible implementation thereof are required.

第十七方面,本申请还提供了另一种计算设备程序产品,所述计算设备程序产品包括计算机指令,在被计算设备执行时,所述计算设备执行前述第二方面或第二方面的任意可能的实现方式中提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第二方面或第二方面的任意可能的实现方式中提供的方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。In a seventeenth aspect, this application also provides another computing device program product, which includes computer instructions that, when executed by a computing device, enable the computing device to perform the methods provided in the second aspect or any possible implementation thereof. This computer program product may be a software installation package, which can be downloaded and executed on a computing device when the methods provided in the second aspect or any possible implementation thereof are required.

第十八方面,本申请还一种虚拟私有云VPC通信的配置方法,具有相同私网地址段的第一VPC和第二VPC通过第三VPC进行通信,第三VPC的私网地址段与第一VPC、第二VPC的私网地址段均不相同,该方法包括以下步骤:为第一VPC中的用户提供第一配置页面,第一配置页面提示第一VPC中的用户在第一VPC中创建第一网关,并提示第一VPC中的用户输入第一网关需要连接的第三VPC的信息,以及第一网关在第三VPC中的第一地址,为第二VPC中的用户提供第二配置页面,第二配置页面提示第二VPC中的用户在第二VPC中创建第二网关,并提示第二VPC中的用户输入第二网关需要连接的第三VPC的信息,以及第二网关在第三VPC中的第二地址,第一地址与第二地址归属于第三VPC的私网地址段,第一地址以及第二地址不相同,根据第一配置页面的信息,创建第一网关,根据第二配置页面的信息,创建第二网关。Eighteenthly, this application also provides a configuration method for Virtual Private Cloud (VPC) communication, in which a first VPC and a second VPC with the same private network address range communicate through a third VPC, wherein the private network address range of the third VPC is different from that of the first VPC and the second VPC. The method includes the following steps: providing a first configuration page to a user in the first VPC, the first configuration page prompting the user in the first VPC to create a first gateway in the first VPC, and prompting the user in the first VPC to enter the information of the third VPC to which the first gateway needs to connect, and the first address of the first gateway in the third VPC; providing a second configuration page to a user in the second VPC, the second configuration page prompting the user in the second VPC to create a second gateway in the second VPC, and prompting the user in the second VPC to enter the information of the third VPC to which the second gateway needs to connect, and the second address of the second gateway in the third VPC, wherein the first address and the second address belong to the private network address range of the third VPC, and the first address and the second address are different; creating a first gateway according to the information of the first configuration page; and creating a second gateway according to the information of the second configuration page.

根据第十八方面的一种可能的实现方式,VPC通信的配置方法还包括以下步骤:在第一网关上配置第一报文处理规则,在第二网关上配置第二报文处理规则,其中,第一报文处理规则包括:将出报文的源地址由第一VPC内的地址转换为第一地址,将入报文的目的地址由第一地址转换为第一VPC内的地址,第二报文处理规则包括:将出报文的源地址由第二VPC内的地址转换为第二地址,将入报文的目的地址由第二地址转换为第二VPC内的地址,在第一VPC的路由器上配置第一路由规则,在第二VPC的路由器上配置第二路由规则,在第三VPC的路由器上配置第三路由规则,其中,第一路由规则包括:将目的地址为第二地址的报文路由至第一网关,第二路由规则包括:将目的地址为第一地址的报文路由至第二网关,第三路由规则包括:将目的地址为第一地址的报文路由至第一VPC中的第一网关,将目的地址为第二地址的报文路由至第二VPC中的第二网关。According to one possible implementation of aspect eighteen, the configuration method for VPC communication further includes the following steps: configuring a first message processing rule on a first gateway, configuring a second message processing rule on a second gateway, wherein the first message processing rule includes: converting the source address of outgoing messages from an address within the first VPC to a first address, and converting the destination address of incoming messages from a first address to an address within the first VPC; the second message processing rule includes: converting the source address of outgoing messages from an address within the second VPC to a second address, and converting the destination address of incoming messages from a second address to an address within the second VPC; configuring a first routing rule on a router of the first VPC, configuring a second routing rule on a router of the second VPC, and configuring a third routing rule on a router of the third VPC, wherein the first routing rule includes: routing messages with a destination address of the second address to the first gateway; the second routing rule includes: routing messages with a destination address of the first address to the second gateway; and the third routing rule includes: routing messages with a destination address of the first address to the first gateway in the first VPC, and routing messages with a destination address of the second address to the second gateway in the second VPC.

附图说明Attached Figure Description

图1是一种VPC通信系统的系统结构示意图;Figure 1 is a schematic diagram of the system architecture of a VPC communication system;

图2是根据本发明实施例的VPC通信系统的系统结构示意图;Figure 2 is a schematic diagram of the system structure of a VPC communication system according to an embodiment of the present invention;

图3是根据本发明实施例的VPC通信系统的另一系统结构示意图;Figure 3 is a schematic diagram of another system structure of the VPC communication system according to an embodiment of the present invention;

图4是根据本发明实施例的VPC通信的设置方法的流程图;Figure 4 is a flowchart of a VPC communication setup method according to an embodiment of the present invention;

图5a-5g示出控制平台提供的VPC设置界面;Figures 5a-5g show the VPC settings interface provided by the control platform;

图6示出根据本发明实施例的VPC通信系统的系统结构示意图;Figure 6 shows a schematic diagram of the system structure of a VPC communication system according to an embodiment of the present invention;

图7示出根据本发明实施例的VPC通信系统的另一系统结构示意图;Figure 7 shows another system structure diagram of the VPC communication system according to an embodiment of the present invention;

图8示出根据本发明实施例的VPC通信系统的另一系统结构示意图;Figure 8 shows another system structure diagram of the VPC communication system according to an embodiment of the present invention;

图9是根据本发明实施例的VPC通信系统的另一系统结构示意图;Figure 9 is a schematic diagram of another system structure of the VPC communication system according to an embodiment of the present invention;

图10示出根据本发明实施例的配置装置的装置结构示意图;Figure 10 shows a schematic diagram of the configuration device according to an embodiment of the present invention;

图11示出根据本发明实施例的计算设备的装置结构示意图。Figure 11 shows a schematic diagram of the device structure of a computing device according to an embodiment of the present invention.

具体实施方式Detailed Implementation

首先,本发明实施例涉及的名词解释如下:First, the terms used in the embodiments of this invention are explained as follows:

云上数据中心:提供公有云业务的数据中心。Cloud Data Center: A data center that provides public cloud services.

云下数据中心:提供非公有云业务的数据中心,云下数据中心提供本地部署业务的情况下,云下数据中心包括多个物理机(physical machine),云下数据中心提供私有云业务的情况下,云下数据中心包括多个虚拟机。On-premises data centers: Data centers that provide non-public cloud services. When an on-premises data center provides local deployment services, it includes multiple physical machines. When an on-premises data center provides private cloud services, it includes multiple virtual machines.

公有云业务:即基础设施即服务(Infrastructure as a Service,IaaS)是指把公有云业务提供方提供的基础设施作为一种服务通过互联网对外提供。在这种服务模型中,用户不用自己构建一个数据中心,而是通过租用的方式来使用服务器、存储和网络等基础设施。公有云业务通过提供虚拟环境(例如虚拟机)实现,公有云的核心属性是多用户共享云基础设施且用户之间隔离。Public cloud services, or Infrastructure as a Service (IaaS), refer to providing public cloud infrastructure as a service via the internet. In this service model, users do not build their own data centers but instead rent infrastructure such as servers, storage, and networks. Public cloud services are implemented by providing virtual environments (such as virtual machines). The core attribute of public cloud is that multiple users share cloud infrastructure while maintaining isolation between users.

非公有云业务:单个用户专属的基础设施,例如为私有云业务和本地部署业务。Non-public cloud services: Infrastructure dedicated to a single user, such as private cloud services and on-premises deployment services.

私有云(Private Clouds)业务:单个用户拥有服务器、存储和网络等基础设施,并可以完全控制此基础设施,私有云业务通过提供虚拟环境(例如虚拟机)实现,私有云业务的核心属性是单用户独享基础设施。Private Clouds: A single user owns the infrastructure, including servers, storage, and networks, and has complete control over this infrastructure. Private cloud services are implemented by providing virtual environments (such as virtual machines). The core attribute of private cloud services is that each user has exclusive access to the infrastructure.

本地部署(On-premises)业务:单个用户在本地自建服务器、存储和网络等基础设施,该用户独享该自建的基础设施,本地部署业务通过物理机(physical machine)实现。On-premises services: A single user builds their own infrastructure, such as servers, storage, and networks, locally. The user has exclusive access to this self-built infrastructure. On-premises services are implemented through physical machines.

私网地址:不能在互联网寻址,只能在局域网中寻址的IP地址,私网地址被禁止出现在互联网中。Private IP address: An IP address that cannot be addressed on the Internet and can only be addressed within a local area network. Private IP addresses are prohibited from appearing on the Internet.

私网地址是一段保留的IP地址,私网地址的分类、网段以及数量如下表所示:A private IP address is a reserved range of IP addresses. The categories, subnets, and quantities of private IP addresses are shown in the table below:

私网地址分类Private network address classification 网段network segment 可用私网地址数量Number of available private network addresses A类私网地址Class A private network address 192.168.0.0/16192.168.0.0/16 65,53265,532 B类私网地址Class B private network address 172.16.0.0/12172.16.0.0/12 1,048,5721,048,572 C类私网地址Class C private network address 10.0.0.0/810.0.0.0/8 16,777,21216,777,212

虚拟私有网络(Virtual Private Cloud,VPC):VPC设置于公有云中,VPC是公有云业务的用户在云上数据中心的虚拟网络,每个VPC均可独立组网,VPC之间逻辑隔离,因此不同VPC中的子网的私网网段可以完全一样。Virtual Private Cloud (VPC): VPCs are set up in the public cloud. A VPC is a virtual network in the cloud data center for users of public cloud services. Each VPC can be networked independently and is logically isolated from other VPCs. Therefore, the private network segments of subnets in different VPCs can be exactly the same.

具体而言,每个VPC都有一个独立的隧道号。一个VPC内的虚拟机之间的报文对应有相同的隧道标识,然后送到物理网络上进行传输。不同VPC内的虚拟机因为所在的隧道标识不同,本身处于两个不同的路由平面,所以不同VPC内的虚拟机无法进行通信,天然地实现了逻辑隔离。Specifically, each VPC has a unique tunnel number. Packets between virtual machines within a VPC share the same tunnel identifier and are then transmitted over the physical network. Virtual machines in different VPCs, because they reside in different tunnels and operate on two different routing planes, cannot communicate with each other, thus naturally achieving logical isolation.

隧道标识可例如为虚拟局域网标识(Virtual Local Area NetworkIdentification,VLAN ID)或虚拟网络标识(Virtual Network ID,VNI)。Tunnel identifiers can be, for example, Virtual Local Area Network Identification (VLAN ID) or Virtual Network ID (VNI).

首先请参见图1,图1是一种VPC通信系统的系统结构示意图,如图1所示,VPC通信系统包括云上数据中心10和客户端7,客户端7通过互联网8访问云上数据中心10。Please refer to Figure 1 first. Figure 1 is a schematic diagram of the system structure of a VPC communication system. As shown in Figure 1, the VPC communication system includes a cloud data center 10 and a client 7. The client 7 accesses the cloud data center 10 through the Internet 8.

图1所示的云上数据中心10为逻辑示意图,云上数据中心10为公有云用户提供VPC1和VPC2,VPC1包括路由器1和子网1,VPC1的私网网段是192.168.0.0/16,子网1的私网网段是192.168.0.0/24,虚拟机(virtual machine,VM)1和VM2设置于子网1内,VM1的私网地址是192.168.0.2,VM2的私网地址是192.168.0.3,VM1和VM2与交换机1连接,路由器1与交换机1连接。Figure 1 shows a logical schematic diagram of the cloud data center 10. The cloud data center 10 provides VPC1 and VPC2 for public cloud users. VPC1 includes router 1 and subnet 1. The private network segment of VPC1 is 192.168.0.0/16, and the private network segment of subnet 1 is 192.168.0.0/24. Virtual machines (VMs) 1 and VM2 are set up in subnet 1. The private network address of VM1 is 192.168.0.2, and the private network address of VM2 is 192.168.0.3. VM1 and VM2 are connected to switch 1, and router 1 is connected to switch 1.

值得注意的是,子网1的私网网段是VPC1的私网网段的子集,VPC1除包括子网1之外,还可以包括其他子网,例如私网网段是192.168.1.0/24的子网,或者是私网网段是192.168.2.0/24的子网。路由器1用于转发不同子网之间通信的报文。It is worth noting that the private network segment of subnet 1 is a subset of the private network segment of VPC1. VPC1 can include other subnets besides subnet 1, such as a subnet with a private network segment of 192.168.1.0/24 or a subnet with a private network segment of 192.168.2.0/24. Router 1 is used to forward packets for communication between different subnets.

并且,VPC2包括路由器2和子网2,VPC1的私网网段是192.168.0.0/16,子网2的私网网段是192.168.0.0/24,子网2内设置有VM3和VM4,VM3的私网地址是192.168.0.2,VM4的私网地址是192.168.0.3,VM3和VM4与交换机2连接,路由器2与交换机2连接。Furthermore, VPC2 includes Router 2 and Subnet 2. The private network segment of VPC1 is 192.168.0.0/16, and the private network segment of Subnet 2 is 192.168.0.0/24. VM3 and VM4 are configured in Subnet 2. The private network address of VM3 is 192.168.0.2, and the private network address of VM4 is 192.168.0.3. VM3 and VM4 are connected to Switch 2, and Router 2 is connected to Switch 2.

其中,子网1和子网2具有相同的私网网段,即子网1和子网2私网地址重叠。Subnet 1 and subnet 2 share the same private network segment, meaning their private network addresses overlap.

类似地,子网2的私网网段是VPC2的私网网段的子集,VPC2除包括子网1之外,还可以包括其他子网,例如私网网段是192.168.1.0/24的子网,或者是私网网段是192.168.2.0/24的子网。路由器2用于转发不同子网之间通信的报文。Similarly, the private network segment of subnet 2 is a subset of the private network segment of VPC2. VPC2 can include other subnets besides subnet 1, such as the subnet with a private network segment of 192.168.1.0/24, or the subnet with a private network segment of 192.168.2.0/24. Router 2 is used to forward packets for communication between different subnets.

客户端7通过互联网8访问控制平台6,控制平台6提供VPC配置界面,客户端7通过互联网访问VPC配置界面,在VPC配置界面上输入VPC的配置信息,控制平台6根据配置信息在云上数据中心10配置VPC,具体地,可配置VPC中的各功能模块,例如可创建或删除VPC,在VPC中创建或删除虚拟机,配置VPC中的路由器的路由规则等,控制平台6可根据配置信息对VPC进行全生命周期管理。在客户端7看来,云上数据中心10提供了逻辑隔离的VPC1和VPC2,客户端7可通过远程桌面登陆VPC1的VM1或VM2,也可以登陆VPC2的VM3和VM4,VPC1和VPC2之间逻辑隔离,互不干扰。Client 7 accesses control platform 6 via the Internet 8. Control platform 6 provides a VPC configuration interface. Client 7 accesses the VPC configuration interface via the Internet and enters the VPC configuration information. Control platform 6 configures the VPC in cloud data center 10 according to the configuration information. Specifically, it can configure various functional modules in the VPC, such as creating or deleting VPCs, creating or deleting virtual machines in VPCs, and configuring routing rules for routers in VPCs. Control platform 6 can perform full lifecycle management of VPCs based on the configuration information. From the client 7's perspective, cloud data center 10 provides logically isolated VPC1 and VPC2. Client 7 can log in to VM1 or VM2 in VPC1 via remote desktop, and can also log in to VM3 and VM4 in VPC2. VPC1 and VPC2 are logically isolated and do not interfere with each other.

客户端7例如为具有上网功能手机、个人电脑、个人数字助理或瘦客户端等终端设备,用户通过操作客户端7操作云数据中心10中的虚拟机。Client 7 is a terminal device such as a mobile phone, personal computer, personal digital assistant or thin client with Internet access. Users operate virtual machines in cloud data center 10 by operating client 7.

如图1所示,VM1和VM2设置在VPC1的子网1中,VM1在VPC1的子网1中设置有私网地址192.168.0.2,VM2在VPC1的子网1中设置有私网地址192.168.0.3,VM1通过交换机1与VM2通信。VM3和VM4设置在VPC2的子网2中,VM3在VPC2的子网2中设置有私网地址192.168.0.2,VM4在VPC2的子网2中设置有私网地址192.168.0.3,VM3通过交换机2与VM4通信。As shown in Figure 1, VM1 and VM2 are configured in subnet 1 of VPC1. VM1 has a private network address of 192.168.0.2 in subnet 1 of VPC1, and VM2 has a private network address of 192.168.0.3 in subnet 1 of VPC1. VM1 communicates with VM2 through switch 1. VM3 and VM4 are configured in subnet 2 of VPC2. VM3 has a private network address of 192.168.0.2 in subnet 2 of VPC2, and VM4 has a private network address of 192.168.0.3 in subnet 2 of VPC2. VM3 communicates with VM4 through switch 2.

举例而言,用户操作客户端7登陆VM1,在VM1中输入互联网控制报文协议(Internet Control Message Protocol,ICMP)命令:“ping 192.168.1.3”,该命令用于控制VM1发出IP报文至VM2,以测试VM1与VM2是否互通,而在本实施例中,由于VM1和VM2设置在同一个VPC1中,因此,VM1会获取到VM2的应答。For example, a user operates client 7 to log in to VM1 and enters the Internet Control Message Protocol (ICMP) command "ping 192.168.1.3" in VM1. This command is used to control VM1 to send IP packets to VM2 to test whether VM1 and VM2 can communicate with each other. In this embodiment, since VM1 and VM2 are set in the same VPC1, VM1 will receive a response from VM2.

但是,如图1所示,由于VPC1和VPC2之间是逻辑隔离的,因此,VPC1中的虚拟机与VPC2中的虚拟机不能互通,具体地,客户端7登陆VM1,可在VM1中输入ICMP命令:“ping192.168.0.3”,该命令用于测试VM1与VM4是否互通,而在本实施例中,由于VM1和VM4设置在不同VPC中,因此,VM1不会获取到VM4的应答。However, as shown in Figure 1, since VPC1 and VPC2 are logically isolated, the virtual machines in VPC1 and VPC2 cannot communicate with each other. Specifically, when client 7 logs into VM1, it can enter the ICMP command "ping 192.168.0.3" in VM1. This command is used to test whether VM1 and VM4 can communicate with each other. However, in this embodiment, since VM1 and VM4 are set in different VPCs, VM1 will not receive a response from VM4.

在企业上云的应用场景下,由于部门之间业务隔离的需要,可通过VPC实现业务隔离,例如VPC1属于研发部,VPC2属于财务部,在图1所示的逻辑架构中,研发部内部的VM可以相互通信,财务部内部的VM也可以相互通信,但是研发部的VM与财务部的VM不能通信。通过将不同部门的VM设置在不同的VPC中,可有效实现数据隔离。In enterprise cloud application scenarios, due to the need for business isolation between departments, VPCs can be used to achieve business isolation. For example, VPC1 belongs to the R&D department, and VPC2 belongs to the finance department. In the logical architecture shown in Figure 1, VMs within the R&D department can communicate with each other, and VMs within the finance department can also communicate with each other, but VMs in the R&D department and VMs in the finance department cannot communicate. By setting VMs of different departments in different VPCs, data isolation can be effectively achieved.

然而,在实际应用中,研发部的VM与财务部的VM在某些情况下是需要通信的,例如研发部的VM需要从财务部的VM获取研发部的财务数据,若二者完全隔离,则不能达到从财务部的VM获取财务数据的目的。However, in practical applications, the VMs of the R&D department and the VMs of the finance department need to communicate in certain situations. For example, the VM of the R&D department needs to obtain the financial data of the R&D department from the VM of the finance department. If the two are completely isolated, the purpose of obtaining financial data from the VM of the finance department cannot be achieved.

因此,在一些实现方式中,将路由器1和路由器2连接,使得VPC1和VPC2能够通信,但是在图1所示的场景中,子网1和子网2的私网地址段重叠,即便路由器1和路由器2相连,子网1和子网2也不能通信,举例而言,VM1与VM3通信,VM1构造IP报文,其源IP地址和目的IP地址均为192.168.0.2,该IP报文到达交换机1,会被交换机1拦截并根据其目的IP地址发送至VM1,或者直接被VM1的操作系统拦截,因此该IP报文不能到达子网2。Therefore, in some implementations, router 1 and router 2 are connected so that VPC1 and VPC2 can communicate. However, in the scenario shown in Figure 1, the private network address ranges of subnet 1 and subnet 2 overlap. Even if router 1 and router 2 are connected, subnet 1 and subnet 2 cannot communicate. For example, when VM1 communicates with VM3, VM1 constructs an IP packet with both its source IP address and destination IP address being 192.168.0.2. When this IP packet arrives at switch 1, it will be intercepted by switch 1 and sent to VM1 according to its destination IP address, or it will be directly intercepted by VM1's operating system. Therefore, this IP packet cannot reach subnet 2.

为解决上述技术问题,本发明实施例提供一种VPC通信系统,请参见图2,图2是根据本发明实施例的VPC通信系统的系统结构示意图,如图2所示,具有相同私网地址段的VPC1和VPC2通过VPC3进行通信,VPC3的私网地址段与VPC1、VPC2的私网地址段均不相同,其中,VPC1内的私网地址与10.0.0.9进行绑定,其中,10.0.0.9为归属于VPC3的私网地址段的地址,VPC2内的私网地址与10.0.0.10进行绑定,其中,10.0.0.10为归属于第三VPC的私网地址段的地址,将VPC1发送至VPC2的报文的源地址配置为10.0.0.9,目的地址配置为10.0.0.10,该报文由VPC发送至VPC3,并经VPC3转发在VPC2,。To solve the above-mentioned technical problems, this invention provides a VPC communication system. Please refer to Figure 2, which is a schematic diagram of the system structure of the VPC communication system according to an embodiment of the invention. As shown in Figure 2, VPC1 and VPC2, which have the same private network address range, communicate through VPC3. The private network address range of VPC3 is different from that of VPC1 and VPC2. The private network address within VPC1 is bound to 10.0.0.9, where 10.0.0.9 belongs to the private network address range of VPC3. The private network address within VPC2 is bound to 10.0.0.10, where 10.0.0.10 belongs to the private network address range of the third VPC. The source address of a message sent from VPC1 to VPC2 is configured as 10.0.0.9, and the destination address is configured as 10.0.0.10. This message is sent from VPC1 to VPC3 and then forwarded by VPC3 to VPC2.

通过VPC3的桥接,VPC1通过访问与VPC2绑定的10.0.0.10来访问VPC2,可以在VPC1和VPC2在私网地址段重叠的情况下实现通信。Through the bridging of VPC3, VPC1 can access VPC2 by accessing 10.0.0.10, which is bound to VPC2, enabling communication between VPC1 and VPC2 even when their private network address ranges overlap.

为进一步清楚说明,以下请参见图3,图3是根据本发明实施例的VPC通信系统的另一系统结构示意图,图,3是图2的一种具体实现方式,在本实施例中,通过控制平台6在VPC1和VPC2之间设置VPC3,并设置VPC3具有与VPC1以及VPC2的私网地址不重叠的私有网段,并在VPC1中设置与VPC3连接的网关1,其中,网关1设置有VPC3的第一私网地址,在VPC2中设置与VPC3连接的网关2,网关2设置有VPC3的第二私网地址,通过设置VPC1、VPC2、VPC3的路由器的路由规则,以及网关1和网关2的报文处理规则,将VPC1的VM1与网关1绑定,将VPC2的VM3与网关2绑定,使得VM1通过访问VPC3的第二私网地址与VM3通信,而VM3通过访问VPC3的第一私网地址与VM1通信。To further clarify, please refer to Figure 3. Figure 3 is a schematic diagram of another system structure of the VPC communication system according to an embodiment of the present invention. Figure 3 is a specific implementation of Figure 2. In this embodiment, VPC3 is set between VPC1 and VPC2 through the control platform 6, and VPC3 is set to have a private network segment that does not overlap with the private network addresses of VPC1 and VPC2. Gateway 1 connected to VPC3 is set in VPC1, wherein gateway 1 is set with the first private network address of VPC3. Gateway 2 connected to VPC3 is set in VPC2, and gateway 2 is set with the second private network address of VPC3. By setting the routing rules of the routers of VPC1, VPC2, and VPC3, as well as the message processing rules of gateway 1 and gateway 2, VM1 of VPC1 is bound to gateway 1, and VM3 of VPC2 is bound to gateway 2, so that VM1 communicates with VM3 by accessing the second private network address of VPC3, and VM3 communicates with VM1 by accessing the first private network address of VPC3.

其中,控制平台6可根据配置信息在云上数据中心10进行上述网关创建和规则配置,且该配置信息由客户端7输入至控制平台6提供的VPC配置界面中。The control platform 6 can create the aforementioned gateway and configure rules in the cloud data center 10 according to the configuration information, and the configuration information is input by the client 7 into the VPC configuration interface provided by the control platform 6.

在其他实施例中,控制平台6也可自动生成上述配置信息,并进行上述配置。In other embodiments, the control platform 6 may also automatically generate the above configuration information and perform the above configuration.

具体地:Specifically:

控制平台6根据配置信息可将VPC3的私网网段(例如10.0.0.0/24)的一个私网地址10.0.0.9分配给网关1,将VPC3的私网网段(例如10.0.0.0/24)的另一个私网地址10.0.0.10分配给网关2,并设置网关1与VPC3的路由器3连接,设置网关2与VPC3的路由器3连接,控制平台6分别对路由器及网关进行配置,使得:Based on the configuration information, control platform 6 can assign one private network address (10.0.0.9) from the private network segment of VPC3 (e.g., 10.0.0.0/24) to gateway 1, and assign another private network address (10.0.0.10) from the same segment to gateway 2. It also configures gateway 1 to connect to router 3 of VPC3, and gateway 2 to connect to router 3 of VPC3. Control platform 6 configures the routers and gateways respectively to achieve the following:

路由器1设置有:Router 1 is configured with:

路由规则1:路由器1接收到的报文的目的IP地址是VPC3的私有网段10.0.0.0/24时,将该IP报文转发至网关1;Routing rule 1: When router 1 receives a packet whose destination IP address is the private network segment 10.0.0.0/24 of VPC3, it forwards the IP packet to gateway 1;

路由规则2:路由器1接收到的报文的目的IP地址是子网1的私有网段192.168.0.0/24时,将该报文转发至子网1。Routing rule 2: When router 1 receives a packet whose destination IP address is the private network segment 192.168.0.0/24 of subnet 1, it forwards the packet to subnet 1.

网关1设置有:Gateway 1 is configured with:

报文处理规则1:网关1接收到的出报文的源IP地址为VM1在子网1的私网地址192.168.0.2时,将192.168.0.2转换为网关1在VPC3的私网地址10.0.0.9,并将修改后的出报文发送至VPC3的路由器3;Message processing rule 1: When the source IP address of the outgoing message received by gateway 1 is the private network address 192.168.0.2 of VM1 in subnet 1, 192.168.0.2 is converted to the private network address 10.0.0.9 of gateway 1 in VPC3, and the modified outgoing message is sent to router 3 of VPC3;

报文处理规则2:网关1接收到的入报文的目的IP地址为网关1在VPC3的私网地址10.0.0.9时,将10.0.0.9转换为VM1在子网1的私网地址192.168.0.2,并将修改后的入报文发送至VPC1的路由器1。Message processing rule 2: When the destination IP address of the incoming message received by gateway 1 is 10.0.0.9, which is the private network address of gateway 1 in VPC3, 10.0.0.9 is converted to 192.168.0.2, which is the private network address of VM1 in subnet 1, and the modified incoming message is sent to router 1 of VPC1.

其中,出报文是指网关1从路由器1接收到的报文,入报文是至网关1从路由器3接收到的报文。Outgoing messages refer to messages received by gateway 1 from router 1, while incoming messages are messages received by gateway 1 from router 3.

路由器3设置有:Router 3 has the following settings:

路由规则5:路由器3接收到的报文的目的IP地址是网关2在VPC3的私网地址10.0.0.10时,将该IP报文转发至网关2;Routing rule 5: If the destination IP address of a packet received by router 3 is gateway 2's private network address 10.0.0.10 in VPC3, then router 3 shall forward the IP packet to gateway 2.

路由规则6:路由器3接收到的报文的目的IP地址是网关1在VPC3的私网地址10.0.0.9时,将该报文转发至子网1。Routing rule 6: If the destination IP address of a packet received by router 3 is gateway 1 in VPC3's private network address 10.0.0.9, then the packet will be forwarded to subnet 1.

网关2设置有:Gateway 2 is configured with:

报文处理规则3:在网关2接收到的入报文的目的IP地址是网关2在VPC3的私网地址10.0.0.10时,将10.0.0.10转换为VM3在子网2的私网地址192.168.0.2,并将修改后的入报文发送至路由器2;Message processing rule 3: When the destination IP address of the incoming message received by gateway 2 is 10.0.0.10, the destination IP address of gateway 2 in VPC3 is converted to 192.168.0.2, the destination IP address of VM3 in subnet 2, and the modified incoming message is sent to router 2.

报文处理规则4:在网关2接收到的出报文的源IP地址为VM3在子网2的私网地址192.168.0.2时,将192.168.0.2转换为网关2在VPC3的私网地址10.0.0.10。Message processing rule 4: When the source IP address of the outgoing message received by gateway 2 is 192.168.0.2, the private network address of VM3 in subnet 2, 192.168.0.2 will be converted to the private network address of gateway 2 in VPC3, 10.0.0.10.

其中,出报文是指网关2从路由器2接收到的报文,入报文是至网关2从路由器3接收到的报文。Outgoing messages refer to messages received by gateway 2 from router 2, while incoming messages are messages received by gateway 2 from router 3.

路由器2设置有:Router 2 is configured with:

路由规则3:在路由器2接收到的报文的目的IP地址是是VPC3的私有网段10.0.0.0/24时,将该报文转发至网关2;Routing rule 3: When the destination IP address of a packet received by router 2 is the private network segment 10.0.0.0/24 of VPC3, forward the packet to gateway 2;

路由规则4:在路由器2接收到的报文的目的IP地址是子网2的私有网段192.168.0.0/24时,将该报文转发至子网1。Routing rule 4: When the destination IP address of a packet received by router 2 is the private network segment 192.168.0.0/24 of subnet 2, forward the packet to subnet 1.

值得注意的是,网关1可以有两个私网地址,一个私网地址归属于VPC1,用于对设置于第一VPC内的网关的内部设置和管理,另一个地址归属于VPC3(例如为上述的10.0.0.9),用于对外进行通信,本专利申请涉及对外通信,因此,没有特殊说明情况下,本专利申请中的网关1的私网地址均指网关1归属于VPC3的私网地址,类似地,网关2也可以有两个私网地址,于此不作赘述。It is worth noting that Gateway 1 can have two private network addresses. One private network address belongs to VPC1 and is used for the internal settings and management of the gateway set up in the first VPC. The other address belongs to VPC3 (for example, 10.0.0.9 mentioned above) and is used for external communication. This patent application involves external communication. Therefore, unless otherwise specified, the private network address of Gateway 1 in this patent application refers to the private network address of Gateway 1 belonging to VPC3. Similarly, Gateway 2 can also have two private network addresses, which will not be elaborated here.

以下将结合图4对上述网关和路由器的对应规则的设置方法进行具体说明,图4是根据本发明实施例的VPC通信的设置方法的流程图,其中,该方法由控制平台6执行,该方法包括以下步骤:The following will describe in detail the method for setting the corresponding rules of the gateway and router as shown in Figure 4. Figure 4 is a flowchart of the VPC communication setting method according to an embodiment of the present invention. The method is executed by the control platform 6 and includes the following steps:

步骤S101:在VPC1创建网关1。Step S101: Create Gateway 1 in VPC1.

具体可结合图5a,图5a示出VPC1设置界面1,在该界面中,用户需输入网关名称(网关1)、网关所在的VPC(VPC1)、网关要连接的VPC(VPC3)以及网关在要连接的VPC的私网地址10.0.0.9。For details, refer to Figure 5a, which shows the VPC1 settings interface 1. In this interface, the user needs to enter the gateway name (gateway 1), the VPC where the gateway is located (VPC1), the VPC to which the gateway needs to connect (VPC3), and the private network address of the VPC to which the gateway needs to connect, 10.0.0.9.

步骤S102:配置网关1的报文处理规则。Step S102: Configure the message processing rules for gateway 1.

结合图5b,图5b示出VPC1设置界面2,在该界面中,用户输入创建的网关1的报文处理规则,图5b所示的报文处理规则即图2所示的网关1的报文处理规则1和报文处理规则2。Referring to Figure 5b, which shows the VPC1 settings interface 2, the user inputs the message processing rules for the created gateway 1. The message processing rules shown in Figure 5b are the same as message processing rule 1 and message processing rule 2 for gateway 1 shown in Figure 2.

其中报文处理规则1包括源网络地址转换(Source net address translation,SNAT)规则,报文处理规则2包括目的网络地址转换(Destination net addresstranslation,DNAT)规则。Message processing rule 1 includes source network address translation (SNAT) rules, and message processing rule 2 includes destination network address translation (DNAT) rules.

步骤S103:配置VPC1的路由规则。Step S103: Configure routing rules for VPC1.

结合图5c,图5c示出VPC1设置界面3,在该界面中,用户输入路由器1的路由规则,即图2所示的路由规则1和路由规则2。Referring to Figure 5c, which shows the VPC1 settings interface 3, the user enters the routing rules of router 1, namely routing rule 1 and routing rule 2 shown in Figure 2.

步骤S104:在VPC2创建网关2。Step S104: Create Gateway 2 in VPC2.

具体可结合图5d,图5d示出VPC2设置界面1,在该界面中,用户需输入网关名称(网关2)、网关所在的VPC(VPC2)、网关要连接的VPC(VPC3)以及网关在要连接的VPC的私网地址10.0.0.10。For details, please refer to Figure 5d, which shows the VPC2 settings interface 1. In this interface, the user needs to enter the gateway name (gateway 2), the VPC where the gateway is located (VPC2), the VPC to which the gateway needs to connect (VPC3), and the private network address of the VPC to which the gateway needs to connect, 10.0.0.10.

步骤S105:配置网关2的报文处理规则。Step S105: Configure the message processing rules for gateway 2.

结合图5e,图5e示出VPC2设置界面2,在该界面中,用户输入创建的网关2的报文处理规则,图5e所示的报文处理规则即图2所示的网关2的报文处理规则3和报文处理规则4。Referring to Figure 5e, which shows the VPC2 settings interface 2, the user inputs the message processing rules for the created gateway 2. The message processing rules shown in Figure 5e are the same as the message processing rules 3 and 4 of gateway 2 shown in Figure 2.

步骤S107:配置VPC2的路由规则。Step S107: Configure routing rules for VPC2.

结合图5f,图5f示出VPC2设置界面3,在该界面中,用户输入路由器2的路由规则,即图2所示的路由规则3和路由规则4。Referring to Figure 5f, which shows the VPC2 settings interface 3, the user enters the routing rules of router 2, namely routing rule 3 and routing rule 4 shown in Figure 2.

步骤S107:配置VPC2的路由规则。Step S107: Configure routing rules for VPC2.

结合图5g,图5g示出VPC3设置界面,在该界面中,用户输入路由器3的路由规则,即图2所示的路由规则5和路由规则6。Referring to Figure 5g, which shows the VPC3 settings interface, the user enters the routing rules for router 3, namely routing rule 5 and routing rule 6 shown in Figure 2.

其中,步骤S101-S107之间的顺序可根据需要调整,如可先执行创建网关2的步骤,再执行创建网关1的步骤,本发明实施例对此不作限定。The order of steps S101-S107 can be adjusted as needed. For example, the step of creating gateway 2 can be performed first, followed by the step of creating gateway 1. This embodiment of the invention does not limit this.

值得注意的是,上述配置信息由用户通过操作客户端7输入至控制平台6提供的VPC配置界面,并由控制平台6发送至控制平台6,控制平台6根据配置信息配置VPC1和VPC2。It is worth noting that the above configuration information is input by the user through the operation client 7 to the VPC configuration interface provided by the control platform 6, and then sent by the control platform 6 to the control platform 6. The control platform 6 configures VPC1 and VPC2 according to the configuration information.

控制平台6运行上述配置方法之后,可在云上数据中心10实现图2所示的VPC通信系统。After the control platform 6 runs the above configuration method, the VPC communication system shown in Figure 2 can be implemented in the cloud data center 10.

进一步地,请参见图6,图6示出根据本发明实施例的VPC通信的方法的数据交互图,该方法是基于图3所示的VPC通信系统,其具体示出VM1跨VPC访问VM3时的报文流向。Further, please refer to Figure 6, which shows a data interaction diagram of a VPC communication method according to an embodiment of the present invention. The method is based on the VPC communication system shown in Figure 3, and specifically shows the message flow when VM1 accesses VM3 across VPCs.

如图6所示,根据本发明实施例的VPC通信的方法包括以下步骤:As shown in Figure 6, the VPC communication method according to an embodiment of the present invention includes the following steps:

步骤1:VM1构造IP报文1并将IP报文1发送至交换机1。Step 1: VM1 constructs IP packet 1 and sends IP packet 1 to switch 1.

IP报文1的IP头的源IP地址是VM1在子网1的私网地址192.168.0.2,目的IP地址是网关2在子网3的私网地址10.0.0.10,IP报文1的数据部分携带有请求信息。The source IP address of IP packet 1 is 192.168.0.2, the private network address of VM1 in subnet 1, and the destination IP address is 10.0.0.10, the private network address of gateway 2 in subnet 3. The data portion of IP packet 1 carries request information.

值得注意的是,VM1根据业务需要,可以提前查询获取10.0.0.10与VM3的对应关系,例如可以向第二VPC查询10.0.0.10与VM3的对应关系,也可以向控制平台6查询到10.0.0.10与VM3的对应关系。It is worth noting that VM1 can query the correspondence between 10.0.0.10 and VM3 in advance according to business needs. For example, it can query the correspondence between 10.0.0.10 and VM3 from the second VPC, or it can query the correspondence between 10.0.0.10 and VM3 from the control platform 6.

步骤2:交换机1转发IP报文1至路由器1。Step 2: Switch 1 forwards IP packet 1 to router 1.

交换机1接收IP报文1后,确认IP报文1的目的IP地址不属于子网1,将IP报文1发送至路由器1进行跨网段报文传输。After receiving IP packet 1, switch 1 confirms that the destination IP address of IP packet 1 does not belong to subnet 1, and sends IP packet 1 to router 1 for cross-network segment packet transmission.

步骤3:路由器1根据路由规则1转发IP报文1。Step 3: Router 1 forwards IP packet 1 according to routing rule 1.

路由器1接收IP报文1后,根据IP报文1的目的IP地址(10.0.0.10)匹配路由规则1,根据路由规则1将IP报文1发送至网关1。After receiving IP packet 1, router 1 matches the destination IP address (10.0.0.10) with routing rule 1 and sends IP packet 1 to gateway 1 according to routing rule 1.

步骤4:网关1根据报文处理规则1修改IP报文1的源IP地址并发送修改后的IP报文1至路由器3。Step 4: Gateway 1 modifies the source IP address of IP packet 1 according to packet processing rule 1 and sends the modified IP packet 1 to router 3.

网关1从路由器1接收IP报文1后,由于IP报文1来自路由器1,因此确认IP报文1为出报文,根据IP报文1的源IP地址匹配报文处理规则1,将IP报文1的源IP地址从192.168.0.2修改为10.0.0.9,并将修改后的IP报文1发送至路由器3。After receiving IP packet 1 from router 1, gateway 1 confirms that IP packet 1 is an outgoing packet because it comes from router 1. According to the packet processing rule 1, the source IP address of IP packet 1 is matched and modified from 192.168.0.2 to 10.0.0.9. The modified IP packet 1 is then sent to router 3.

步骤5:路由器3根据路由规则5转发IP报文1至网关2。Step 5: Router 3 forwards IP packet 1 to gateway 2 according to routing rule 5.

路由器3接收IP报文1后,根据IP报文1的目的IP地址(10.0.0.10)匹配路由规则5,将IP报文1转发至网关2。After receiving IP packet 1, router 3 matches the destination IP address (10.0.0.10) with routing rule 5 and forwards IP packet 1 to gateway 2.

步骤6:网关2根据报文处理规则3修改IP报文1的目的IP地址并发送修改后的IP报文1至路由器2。Step 6: Gateway 2 modifies the destination IP address of IP packet 1 according to packet processing rule 3 and sends the modified IP packet 1 to router 2.

网关2接收从路由器3接收IP报文1后,由于IP报文1来自路由器3,因此确认IP报文1是入报文,根据IP报文1的目的地址匹配报文处理规则3,将IP报文1的目的IP地址从10.0.0.10修改为192.168.0.2,并将修改后的IP报文1发送至路由器2。After receiving IP packet 1 from router 3, gateway 2 confirms that IP packet 1 is an incoming packet since it comes from router 3. Based on the destination address of IP packet 1 and matching packet processing rule 3, gateway 2 modifies the destination IP address of IP packet 1 from 10.0.0.10 to 192.168.0.2 and sends the modified IP packet 1 to router 2.

步骤7:路由器2根据路由规则4转发修改后的IP报文1至交换机2。Step 7: Router 2 forwards the modified IP packet 1 to switch 2 according to routing rule 4.

路由器2根据IP报文1的目的IP地址192.168.0.2匹配路由规则4,将IP报文1发送至子网2,而交换机2设置于子网2中,具体地,是将IP报文1发送至子网2的交换机2。Router 2 matches routing rule 4 based on the destination IP address 192.168.0.2 of IP packet 1 and sends IP packet 1 to subnet 2. Switch 2 is set up in subnet 2, specifically, it is the switch that sends IP packet 1 to subnet 2.

步骤8:交换机2将IP报文1发送至VM3。Step 8: Switch 2 sends IP packet 1 to VM3.

交换机2根据IP报文1的目的IP地址192.168.0.2将IP报文1发送至VM3。Switch 2 sends IP packet 1 to VM3 based on the destination IP address 192.168.0.2 of IP packet 1.

步骤9:VM3构造并发送IP报文2至交换机2。Step 9: VM3 constructs and sends IP packet 2 to switch 2.

IP报文2是IP报文1的应答报文。IP packet 2 is a response message to IP packet 1.

VM3接收IP报文1之后,从IP报文1的数据部分获取请求信息,根据请求信息产生应答信息,并构造IP报文2,具体地,VM3将IP报文1的源IP地址10.0.0.9设置为IP报文2的目的IP地址,将IP报文1的目的IP地址192.168.0.2设置为IP报文2的源IP地址,将应答信息设置于IP报文2的数据部分,将IP报文2发送至交换机2。After receiving IP packet 1, VM3 obtains the request information from the data portion of IP packet 1, generates response information based on the request information, and constructs IP packet 2. Specifically, VM3 sets the source IP address 10.0.0.9 of IP packet 1 to the destination IP address of IP packet 2, sets the destination IP address 192.168.0.2 of IP packet 1 to the source IP address of IP packet 2, sets the response information in the data portion of IP packet 2, and sends IP packet 2 to switch 2.

步骤10:交换机2转发IP报文2至路由器2。Step 10: Switch 2 forwards IP packet 2 to router 2.

交换机2接收IP报文2后,确认IP报文2的目的IP地址10.0.0.9不属于子网1(192.168.0.0/24),将IP报文2发送至路由器2进行跨网段报文传输。After receiving IP packet 2, switch 2 confirms that the destination IP address 10.0.0.9 of IP packet 2 does not belong to subnet 1 (192.168.0.0/24), and sends IP packet 2 to router 2 for cross-network segment packet transmission.

步骤11:路由器2根据路由规则3转发IP报文2。Step 11: Router 2 forwards IP packet 2 according to routing rule 3.

路由器2接收IP报文2后,根据IP报文2的目的IP地址(10.0.0.9)匹配路由规则3,根据路由规则3将IP报文2发送至网关2。After receiving IP packet 2, router 2 matches the destination IP address (10.0.0.9) of IP packet 2 with routing rule 3, and sends IP packet 2 to gateway 2 according to routing rule 3.

步骤12:网关2根据报文处理规则4修改IP报文2的源IP地址并发送修改后的IP报文2至路由器3。Step 12: Gateway 2 modifies the source IP address of IP packet 2 according to packet processing rule 4 and sends the modified IP packet 2 to router 3.

网关2从路由器2接收IP报文2后,由于IP报文2来自路由器2,因此确认IP报文2为出报文,根据IP报文2的源IP地址匹配报文处理规则4,将IP报文2的源IP地址从192.168.0.2修改为10.0.0.10,并将修改后的IP报文2发送至路由器3。After receiving IP packet 2 from router 2, gateway 2 confirms that IP packet 2 is an outgoing packet because it comes from router 2. According to the packet processing rule 4, it modifies the source IP address of IP packet 2 from 192.168.0.2 to 10.0.0.10 and sends the modified IP packet 2 to router 3.

步骤13:路由器3根据路由规则6转发IP报文2至网关1。Step 13: Router 3 forwards IP packet 2 to gateway 1 according to routing rule 6.

路由器3接收IP报文2后,根据IP报文2的目的IP地址(10.0.0.9)匹配路由规则6,将IP报文2转发至网关1。After receiving IP packet 2, router 3 matches the destination IP address (10.0.0.9) with routing rule 6 and forwards IP packet 2 to gateway 1.

步骤14:网关1根据报文处理规则2修改IP报文2的目的IP地址并发送修改后的IP报文2至路由器1。Step 14: Gateway 1 modifies the destination IP address of IP packet 2 according to packet processing rule 2 and sends the modified IP packet 2 to router 1.

网关1接收从路由器3接收IP报文2后,由于IP报文2来自路由器3,因此确认IP报文2是入报文,根据IP报文2的目的地址匹配报文处理规则2,将IP报文2的目的IP地址从10.0.0.9修改为192.168.0.2,并将修改后的IP报文2发送至路由器1。After receiving IP packet 2 from router 3, gateway 1 confirms that IP packet 2 is an incoming packet since it comes from router 3. Based on the destination address of IP packet 2 and matching packet processing rule 2, gateway 1 modifies the destination IP address of IP packet 2 from 10.0.0.9 to 192.168.0.2 and sends the modified IP packet 2 to router 1.

步骤15:路由器1根据路由规则2转发修改后的IP报文2至交换机1。Step 15: Router 1 forwards the modified IP packet 2 to switch 1 according to routing rule 2.

路由器1根据IP报文2的目的IP地址192.168.0.2匹配路由规则2,将IP报文2发送至子网1,而交换机1设置于子网1中,具体地,是将IP报文2发送至子网1的交换机1。Router 1 matches routing rule 2 based on the destination IP address 192.168.0.2 of IP packet 2 and sends IP packet 2 to subnet 1. Switch 1 is set up in subnet 1, specifically, it is the switch that sends IP packet 2 to subnet 1.

步骤16:交换机1将IP报文2发送至VM1。Step 16: Switch 1 sends IP packet 2 to VM1.

交换机1根据IP报文2的目的IP地址192.168.0.2将IP报文2发送至VM1。Switch 1 sends IP packet 2 to VM1 based on the destination IP address 192.168.0.2 of IP packet 2.

VM1接收到IP报文2后,根据IP报文2的源IP地址10.0.0.10和目的IP地址192.168.0.2确认IP报文2是IP报文1的应答报文(由于IP报文2的源IP地址和目的IP地址与IP报文1相比是倒置的),VM1从IP报文2的数据部分获取应答信息,从而完成VM1与VM2之间的通信过程。After receiving IP packet 2, VM1 confirms that IP packet 2 is a response packet to IP packet 1 based on the source IP address 10.0.0.10 and destination IP address 192.168.0.2 (since the source IP address and destination IP address of IP packet 2 are reversed compared to IP packet 1). VM1 obtains the response information from the data part of IP packet 2, thereby completing the communication process between VM1 and VM2.

综上,通过在云上数据中心10配置网关1-2以及VPC3,并对VPC1-3的路由器及网关1-2进行配置,可使得VM1和VM3在私网地址相同的情况下也能够实现通信。In summary, by configuring gateways 1-2 and VPC3 in cloud data center 10, and configuring the routers and gateways 1-2 in VPC1-3, VM1 and VM3 can communicate even when they have the same private network address.

举例而言,本发明实施例适用于以下场景,即VPC3作为企业内部的大网,而VPC1和VPC2作为企业内部小网,VPC1例如为财务部的虚拟网络,VPC2例如为研发部的虚拟网络,VPC3例如为企业的IT管理部的虚拟网络,当VPC1与VPC2私网地址重叠时,可向控制平台申请VPC3的私网地址,例如VPC1申请到VPC3的私网地址1,VPC2申请到VPC3的私网地址2,通过网关将VPC1中的虚拟机与私网地址1绑定,通过网关将VPC2中的虚拟机与私网地址2绑定,VPC1的虚拟机可通过访问私网地址2来访问VPC2的虚拟机,VPC2的虚拟机可通过访问私网地址1来访问VPC1的虚拟机,从而解决企业内部不同VPC私网地址重叠而造成不能相互通信的技术问题。For example, the embodiments of the present invention are applicable to the following scenario: VPC3 serves as the large network within an enterprise, while VPC1 and VPC2 serve as smaller networks within the enterprise. VPC1 is, for example, the virtual network of the finance department, VPC2 is, for example, the virtual network of the R&D department, and VPC3 is, for example, the virtual network of the enterprise's IT management department. When the private network addresses of VPC1 and VPC2 overlap, a private network address of VPC3 can be requested from the control platform. For example, VPC1 requests private network address 1 of VPC3, and VPC2 requests private network address 2 of VPC3. The virtual machines in VPC1 are bound to private network address 1 through the gateway, and the virtual machines in VPC2 are bound to private network address 2 through the gateway. The virtual machines in VPC1 can access the virtual machines in VPC2 by accessing private network address 2, and the virtual machines in VPC2 can access the virtual machines in VPC1 by accessing private network address 1. This solves the technical problem of the inability to communicate with each other caused by the overlap of private network addresses of different VPCs within the enterprise.

值得注意的是,VPC1、VPC2以及VPC3可以属于不同的用户,不同的用户根据各自的账号登陆各自的VPC,当VPC1与VPC3需要建立连接时,VPC1的用户可在控制平台输入VPC3的用户的账号,控制平台根据VPC3的用户账号发送请求至VPC3的设置界面,VPC3的用户可通过操作VPC3的设置界面确认是否接受请求,在接受请求的情况下,控制平台才会在VPC1与VPC3之间建立连接,而VPC2和VPC3建立连接的情况也是类似的。It is worth noting that VPC1, VPC2, and VPC3 can belong to different users. Different users log in to their respective VPCs using their own accounts. When VPC1 and VPC3 need to establish a connection, the user of VPC1 can enter the user's account in the control platform. The control platform sends a request to the VPC3 settings interface based on the VPC3 user's account. The user of VPC3 can confirm whether to accept the request through the VPC3 settings interface. Only if the request is accepted will the control platform establish a connection between VPC1 and VPC3. The connection establishment process between VPC2 and VPC3 is similar.

在其他实施例中,在VPC1、VPC2以及VPC3属于相同的用户的情况下,该用户通过一个账号即可登录VPC1、VPC2以及VPC3,此时控制平台无需发送请求。In other embodiments, if VPC1, VPC2, and VPC3 belong to the same user, that user can log in to VPC1, VPC2, and VPC3 with a single account, and the control platform does not need to send a request.

其中,用户可向控制平台注册账号,并通过账号在控制平台提供的付费页面中购买VPC。Users can register an account with the control platform and purchase VPCs through the paid page provided by the control platform.

以下请参见图7,图7示出根据本发明实施例的VPC通信系统的另一系统结构示意图,在本实施例中,相对于图2所示实施例而言,网关1也可以与VPC1的其他子网中的VM绑定,网关2也可以与VPC2的其他子网中的VM绑定,如图7所示,VPC1中还设置有子网3(192.168.1.0/24),且子网3中设置有VM5,VM5的私网地址是192.168.1.2,VPC2中还设置有子网4(192.168.1.0/24),且子网4中设置有VM6,VM5的私网地址也是192.168.1.2。Please refer to Figure 7 below. Figure 7 shows another system structure diagram of the VPC communication system according to an embodiment of the present invention. In this embodiment, compared with the embodiment shown in Figure 2, gateway 1 can also be bound to VMs in other subnets of VPC1, and gateway 2 can also be bound to VMs in other subnets of VPC2. As shown in Figure 7, VPC1 also has a subnet 3 (192.168.1.0/24), and a VM5 is set in subnet 3. The private network address of VM5 is 192.168.1.2. VPC2 also has a subnet 4 (192.168.1.0/24), and a VM6 is set in subnet 4. The private network address of VM5 is also 192.168.1.2.

此时,若VM5需要和VM6通信,则可以在路由器1中增置路由规则7:目的IP地址属于192.168.1.0/24的报文转发至子网3,在路由器2中增置路由规则8:目的IP地址属于192.168.1.0/24的报文转发至子网4,并为网关1分配VPC3的私网地址(例如为10.0.0.11),为网关1设置报文处理规则5:出报文的源IP地址是192.168.1.2时,将源IP地址修改为10.0.0.11,设置报文处理规则6:入报文的目的IP地址是10.0.0.11时,将目的IP地址修改为192.168.1.2。If VM5 needs to communicate with VM6, then in router 1, add routing rule 7: forward packets with a destination IP address of 192.168.1.0/24 to subnet 3. In router 2, add routing rule 8: forward packets with a destination IP address of 192.168.1.0/24 to subnet 4. Assign a private network address of VPC3 to gateway 1 (e.g., 10.0.0.11). Set packet processing rule 5 for gateway 1: when the source IP address of an outgoing packet is 192.168.1.2, change the source IP address to 10.0.0.11. Set packet processing rule 6: when the destination IP address of an incoming packet is 10.0.0.11, change the destination IP address to 192.168.1.2.

为网关2分配VPC3的私网地址(例如为10.0.0.12),为网关2设置报文处理规则7:出报文的源IP地址是192.168.1.2时,将源IP地址修改为10.0.0.12,并将修改后的出报文发送至路由器3,设置报文处理规则8:入报文的目的IP地址是10.0.0.12时,将目的IP地址修改为192.168.1.2。Assign a private network address of VPC3 to gateway 2 (e.g., 10.0.0.12). Configure packet processing rule 7 for gateway 2: when the source IP address of an outgoing packet is 192.168.1.2, change the source IP address to 10.0.0.12 and send the modified outgoing packet to router 3. Configure packet processing rule 8: when the destination IP address of an incoming packet is 10.0.0.12, change the destination IP address to 192.168.1.2.

为路由器3设置路由规则9:目的IP地址是10.0.0.12时,将报文发送至网关2,设置路由规则10:目的IP地址是10.0.0.11时,将报文发送至网关1。Configure routing rule 9 for router 3: when the destination IP address is 10.0.0.12, send the packet to gateway 2. Configure routing rule 10: when the destination IP address is 10.0.0.11, send the packet to gateway 1.

基于以上配置,VM5可构造源IP地址是192.168.1.2,目的IP地址是10.0.0.12的IP报文,以与以上实施例类似的通信方式将该IP报文经由路由器1、网关1、路由器3、网关2以及路由器2发送至VM6,且VM6返回的用于应答的IP报文也可经由路由器2、网关2、路由器3、网关1以及路由器1发送至VM1。Based on the above configuration, VM5 can construct an IP packet with a source IP address of 192.168.1.2 and a destination IP address of 10.0.0.12, and send the IP packet to VM6 via Router 1, Gateway 1, Router 3, Gateway 2 and Router 2 in a communication manner similar to the above embodiments. The IP packet returned by VM6 for response can also be sent to VM1 via Router 2, Gateway 2, Router 3, Gateway 1 and Router 1.

因此,在本发明实施例中,通过对网关和路由器设置不同的规则,可使得VPC1与VPC2中具有相同私网地址段的不同子网互通。Therefore, in this embodiment of the invention, by setting different rules for the gateway and the router, different subnets with the same private network address range in VPC1 and VPC2 can communicate with each other.

进一步,本发明实施例也可以实现云下数据中心之间在私网地址重叠的情况下进行通信,请参见图8,图8示出根据本发明实施例的VPC通信系统的另一系统结构示意图,图8在图3所示的实施例的基础上增设云下数据中心21-22,云下数据中心21包括子网5,子网5中设置有物理机(Pysical machine,PM)1和PM2,云下数据中心22包括子网6,子网6中设置有物理机(Pysical machine,PM)3和PM4,子网5通过远程连接网关3接入VPC1的远程连接网关1,子网6通过远程连接网关4接入VPC2的远程连接网关2,其中,远程连接网关3和远程连接网关1之间形成远程通信隧道,远程连接网关4和远程连接网关2之间形成远程通信隧道,IP报文可在远程通信隧道中传输,且传输过程中IP报文保持不变。Furthermore, embodiments of the present invention can also enable communication between on-premises data centers when private network addresses overlap. Please refer to Figure 8, which shows another system structure diagram of the VPC communication system according to an embodiment of the present invention. Figure 8 adds on-premises data centers 21-22 to the embodiment shown in Figure 3. On-premises data center 21 includes subnet 5, in which physical machines (PM) 1 and PM2 are configured. On-premises data center 22 includes subnet 6, in which physical machines (PM) 3 and PM4 are configured. Subnet 5 is connected to the remote connection gateway 1 of VPC1 through remote connection gateway 3, and subnet 6 is connected to the remote connection gateway 2 of VPC2 through remote connection gateway 4. A remote communication tunnel is formed between remote connection gateway 3 and remote connection gateway 1, and a remote communication tunnel is formed between remote connection gateway 4 and remote connection gateway 2. IP packets can be transmitted in the remote communication tunnels, and the IP packets remain unchanged during transmission.

值得注意的是,VPC1的远程连接网关1和VPC2的远程连接网关2可由控制平台6根据配置信息进行配置,且该配置信息由用户操作客户端7输入至控制平台6。It is worth noting that the remote connection gateway 1 of VPC1 and the remote connection gateway 2 of VPC2 can be configured by the control platform 6 according to the configuration information, and the configuration information is input to the control platform 6 by the user operation client 7.

远程通信网关举例而言可以是虚拟私有网络(Virtual private network,VPN)网关,或者是专线网关。For example, a remote communication gateway can be a Virtual Private Network (VPN) gateway or a leased line gateway.

如图8所示,子网5和子网6的私网地址重叠,PM1需与PM3通信,则可以在路由器1中增置路由规则11:目的IP地址属于192.168.2.0/24的报文转发至远程连接网关1,在路由器2中增置路由规则12:目的IP地址属于192.168.2.0/24的报文转发至远程连接网关2,并为网关1分配VPC3的私网地址(例如为10.0.0.13),为网关1设置报文处理规则9:出报文的源IP地址是192.168.2.2时,将源IP地址修改为10.0.0.13,设置报文处理规则10:入报文的目的IP地址是10.0.0.13时,将目的IP地址修改为192.168.2.2。As shown in Figure 8, the private network addresses of subnets 5 and 6 overlap. PM1 needs to communicate with PM3. Therefore, we can add routing rule 11 to router 1: forward packets with a destination IP address of 192.168.2.0/24 to remote connection gateway 1. In router 2, we can add routing rule 12: forward packets with a destination IP address of 192.168.2.0/24 to remote connection gateway 2. We can also assign a private network address of VPC3 (e.g., 10.0.0.13) to gateway 1. We can set packet processing rule 9 for gateway 1: when the source IP address of an outgoing packet is 192.168.2.2, change the source IP address to 10.0.0.13. We can also set packet processing rule 10: when the destination IP address of an incoming packet is 10.0.0.13, change the destination IP address to 192.168.2.2.

为网关2分配VPC3的私网地址(例如为10.0.0.14),为网关2设置报文处理规则11:出报文的源IP地址是192.168.2.2时,将源IP地址修改为10.0.0.14,并将修改后的出报文发送至路由器3,设置报文处理规则12:入报文的目的IP地址是10.0.0.14时,将目的IP地址修改为192.168.2.2,并将修改后的入报文发送至路由器2。Assign a private network address of VPC3 to gateway 2 (e.g., 10.0.0.14). Configure packet processing rule 11 for gateway 2: when the source IP address of an outgoing packet is 192.168.2.2, change the source IP address to 10.0.0.14 and send the modified outgoing packet to router 3. Configure packet processing rule 12: when the destination IP address of an incoming packet is 10.0.0.14, change the destination IP address to 192.168.2.2 and send the modified incoming packet to router 2.

为路由器3设置路由规则13:目的IP地址是10.0.0.14时,将报文发送至网关2,设置路由规则14:目的IP地址是10.0.0.13时,将报文发送至网关1。Configure routing rule 13 for router 3: when the destination IP address is 10.0.0.14, send the packet to gateway 2. Configure routing rule 14: when the destination IP address is 10.0.0.13, send the packet to gateway 1.

基于以上配置,PM1可构造源IP地址是192.168.2.2,目的IP地址是10.0.0.14的IP报文,该报文被交换机5转发到远程连接网关3,经远程通信隧道发送到远程连接网关1,并被远程连接网关1发送至路由器1后,以与以上实施例类似的通信方式将该IP报文经由路由器1、网关1、路由器3、网关2以及路由器2发送至远程连接网关2,并经远程通信隧道发送到远程连接网关4,从而到达子网6中的PM3。类似地,PM3返回的用于应答的IP报文也可发送至PM1。Based on the above configuration, PM1 can construct an IP packet with a source IP address of 192.168.2.2 and a destination IP address of 10.0.0.14. This packet is forwarded by switch 5 to remote connection gateway 3, sent to remote connection gateway 1 via a remote communication tunnel, and then sent by remote connection gateway 1 to router 1. Using a communication method similar to the above embodiment, the IP packet is then sent to remote connection gateway 2 via router 1, gateway 1, router 3, gateway 2, and router 2, and finally to remote connection gateway 4 via a remote communication tunnel, thus reaching PM3 in subnet 6. Similarly, the IP packet returned by PM3 for acknowledgment can also be sent to PM1.

值得注意的是,云下数据中心的PM也可以替换为VM,本发明实施例对此不作限定。It is worth noting that the PM in the on-premises data center can also be replaced with VM, and this embodiment of the invention does not limit this.

因此,在本发明其他实施例中,通过对网关和路由器设置不同的规则,可使得云下数据中心之间具有相同私网地址段的不同子网通过云上数据中心互通。Therefore, in other embodiments of the present invention, by setting different rules for gateways and routers, different subnets with the same private network address range between on-premises data centers can be interconnected through cloud data centers.

以下请参见图9,图9是根据本发明实施例的VPC通信系统的另一系统结构示意图,本实施例与图3所示的实施例相比,将网关1设置在子网1中,将网关2设置在子网2中,此时,网关1和网关2仅能支持子网1和子网2互通。Please refer to Figure 9 below. Figure 9 is a schematic diagram of another system structure of the VPC communication system according to an embodiment of the present invention. Compared with the embodiment shown in Figure 3, in this embodiment, gateway 1 is set in subnet 1 and gateway 2 is set in subnet 2. At this time, gateway 1 and gateway 2 can only support communication between subnet 1 and subnet 2.

具体而言,控制平台6根据配置信息可将VPC3的私网网段(例如10.0.0.0/24)的一个私网地址10.0.0.9分配给网关1,将VPC3的私网网段(例如10.0.0.0/24)的另一个私网地址10.0.0.10分配给网关2,并设置路由器1与路由器3连接,设置路由器2与路由器3连接。Specifically, the control platform 6 can assign one private network address 10.0.0.9 of the private network segment of VPC3 (e.g., 10.0.0.0/24) to gateway 1, assign another private network address 10.0.0.10 of the private network segment of VPC3 (e.g., 10.0.0.0/24) to gateway 2, and set up router 1 to connect with router 3, and set up router 2 to connect with router 3.

路由器1设置有:Router 1 is configured with:

路由规则1’:路由器1接收到的报文的目的IP地址是10.0.0.10的报文,将该报文转发至VPC3;Routing rule 1': Router 1 receives a packet whose destination IP address is 10.0.0.10 and forwards the packet to VPC3;

路由规则2’:路由器1接收到的报文的目的IP地址是10.0.0.9时,将该报文转发至网关1。Routing rule 2': When router 1 receives a packet whose destination IP address is 10.0.0.9, it forwards the packet to gateway 1.

网关1设置有:Gateway 1 is configured with:

报文处理规则1’:网关1接收到的出报文的源IP地址为VM1在子网1的私网地址192.168.0.2时,将192.168.0.2转换为网关1在VPC3的私网地址10.0.0.9,并将修改后的出报文发送至路由器1;Message processing rule 1': When the source IP address of the outgoing message received by gateway 1 is 192.168.0.2, the private network address of VM1 in subnet 1, 192.168.0.2 is converted to 10.0.0.9, the private network address of gateway 1 in VPC3, and the modified outgoing message is sent to router 1;

报文处理规则2’:网关1接收到的入报文的目的IP地址为网关1在VPC3的私网地址10.0.0.9时,将10.0.0.9转换为VM1在子网1的私网地址192.168.0.2,并将修改后的入报文发送至网关1。Message processing rule 2': When the destination IP address of the incoming message received by gateway 1 is 10.0.0.9, the gateway 1 will convert 10.0.0.9 to 192.168.0.2, the private network address of VM1 in subnet 1, and send the modified incoming message to gateway 1.

其中,出报文是指网关1从交换机1接收到的报文,入报文是至网关1从路由器1接收到的报文。Outgoing messages refer to messages received by gateway 1 from switch 1, while incoming messages are messages received by gateway 1 from router 1.

路由器2设置有:Router 2 is configured with:

路由规则5’:在路由器2接收到的报文的目的IP地址是10.0.0.9时,将该报文转发至VPC3;Routing rule 5': When the destination IP address of a packet received by router 2 is 10.0.0.9, forward the packet to VPC3;

路由规则6’:在路由器2接收到的报文的目的IP地址是10.0.0.10时,将该报文转发至网关2。Routing rule 6': When the destination IP address of a packet received by router 2 is 10.0.0.10, forward the packet to gateway 2.

网关2设置有:Gateway 2 is configured with:

报文处理规则3’:在网关2接收到的入报文的目的IP地址为10.0.0.10时,将10.0.0.10转换为192.168.0.2,将修改后的出报文发送至路由器2;Message processing rule 3': When the destination IP address of the incoming message received by gateway 2 is 10.0.0.10, 10.0.0.10 is converted to 192.168.0.2, and the modified outgoing message is sent to router 2;

报文处理规则4’:在网关2接收到的出报文的源IP地址为192.168.0.2时,将192.168.0.2转换为10.0.0.10,并将修改后的出报文发送至路由器1。Message processing rule 4': When the source IP address of the outgoing message received by gateway 2 is 192.168.0.2, 192.168.0.2 is converted to 10.0.0.10, and the modified outgoing message is sent to router 1.

其中,出报文是指网关2从交换机2接收到的报文,入报文是至网关1从路由器2接收到的报文。Outgoing messages refer to messages received by gateway 2 from switch 2, while incoming messages are messages received by gateway 1 from router 2.

路由器3设置有:Router 3 has the following settings:

路由规则3’:在路由器2接收到的报文的目的IP地址是10.0.0.10时,将该报文转发至路由器2;Routing rule 3': When the destination IP address of a packet received by router 2 is 10.0.0.10, forward the packet to router 2;

路由规则4’:在路由器2接收到的报文的目的IP地址是10.0.0.9时,将该报文转发至路由器1。Routing rule 4': When the destination IP address of a packet received by router 2 is 10.0.0.9, forward the packet to router 1.

当VM1需要跨VPC访问VM3时,VM1构造IP报文1’,IP报文1’的源IP地址是VM1在子网1的私网地址192.168.0.2,目的IP地址是网关2在子网3的私网地址10.0.0.10,IP报文1’的数据部分携带有请求信息。When VM1 needs to access VM3 across VPC, VM1 constructs IP packet 1'. The source IP address of IP packet 1' is VM1's private network address 192.168.0.2 in subnet 1, and the destination IP address is gateway 2's private network address 10.0.0.10 in subnet 3. The data part of IP packet 1' carries request information.

VM1将IP报文1’发送至交换机1,交换机1判断到IP报文1’的目的IP地址不属于子网1,将IP报文1’发送至网关1,网关1对IP报文1’匹配报文处理规则1’,将IP报文1的源IP地址从192.168.0.2转换为10.0.0.9,网关1将修改后的IP报文1’发送至路由器1,路由器1对IP报文1’匹配路由规则2’,将IP报文1’转发至VPC3的路由器3。VM1 sends IP packet 1' to switch 1. Switch 1 determines that the destination IP address of IP packet 1' does not belong to subnet 1, and sends IP packet 1' to gateway 1. Gateway 1 matches IP packet 1' with packet processing rule 1', and changes the source IP address of IP packet 1 from 192.168.0.2 to 10.0.0.9. Gateway 1 sends the modified IP packet 1' to router 1. Router 1 matches IP packet 1' with routing rule 2', and forwards IP packet 1' to router 3 of VPC3.

路由器3接收IP报文1’,对IP报文1’匹配路由规则3’,将IP报文1’转发至VPC2的路由器2。Router 3 receives IP packet 1', matches IP packet 1' with routing rule 3', and forwards IP packet 1' to router 2 in VPC2.

路由器2接收IP报文1’,对IP报文1’匹配路由规则6’,将IP报文1’转发至网关2。Router 2 receives IP packet 1', matches IP packet 1' with routing rule 6', and forwards IP packet 1' to gateway 2.

网关2接收IP报文1’,对IP报文1’匹配报文处理规则3’,将IP报文1的目的IP地址从10.0.0.10转换为192.168.0.2,网关2将IP报文1’发送至交换机2,交换机2将IP报文3发送至VM3。Gateway 2 receives IP packet 1', matches IP packet 1' with packet processing rule 3', changes the destination IP address of IP packet 1 from 10.0.0.10 to 192.168.0.2, and then sends IP packet 1' to switch 2. Switch 2 then sends IP packet 3 to VM3.

VM3根据IP报文1’的数据部分携带的请求信息产生应答信息,并构造IP报文2’,IP报文2’是IP报文1’的应答报文,IP报文2’的源IP地址是IP报文1’的目的IP地址192.168.0.2,目的IP地址是IP报文1’的源IP地址10.0.0.9,IP报文2’的数据部分携带有应答信息。VM3 generates a response message based on the request information carried in the data portion of IP packet 1', and constructs IP packet 2'. IP packet 2' is a response message to IP packet 1'. The source IP address of IP packet 2' is the destination IP address of IP packet 1' (192.168.0.2), and the destination IP address is the source IP address of IP packet 1' (10.0.0.9). The data portion of IP packet 2' carries the response information.

VM3发送IP报文2’至交换机2,交换机2判断到IP报文2’的目的IP地址不属于子网2,将IP报文2’发送至网关2。VM3 sends IP packet 2' to switch 2. Switch 2 determines that the destination IP address of IP packet 2' does not belong to subnet 2, and then sends IP packet 2' to gateway 2.

网关2对IP报文2’匹配报文处理规则4’,将IP报文2’的源IP地址从192.168.0.2转换为10.0.0.10,并将IP报文2’发送至路由器2。Gateway 2 matches IP packet 2' with packet processing rule 4', changes the source IP address of IP packet 2' from 192.168.0.2 to 10.0.0.10, and sends IP packet 2' to router 2.

路由器2对IP报文2’匹配路由规则5’,将IP报文2’转发到VPC3的路由器3。Router 2 matches IP packet 2' with routing rule 5' and forwards IP packet 2' to router 3 in VPC3.

路由器3接收IP报文2’,对IP报文2’匹配路由规则4’,将IP报文2’转发至VPC1的路由器1。Router 3 receives IP packet 2', matches IP packet 2' with routing rule 4', and forwards IP packet 2' to router 1 of VPC1.

路由器1接收IP报文2’,对IP报文2’匹配路由规则2’,将IP报文2’转发至网关1。Router 1 receives IP packet 2', matches IP packet 2' with routing rule 2', and forwards IP packet 2' to gateway 1.

网关1接收IP报文2’,对IP报文2’匹配报文处理规则2’,将IP报文2’的目的IP地址从10.0.0.9转换为192.168.0.2,并将IP报文2’发送至交换机1,交换机1将IP报文2’发送至VM1。Gateway 1 receives IP packet 2', matches IP packet 2' with packet processing rule 2', changes the destination IP address of IP packet 2' from 10.0.0.9 to 192.168.0.2, and sends IP packet 2' to switch 1. Switch 1 then sends IP packet 2' to VM1.

VM1获取IP报文6携带的应答信息,在VM1看来IP报文6来自10.0.0.10,IP报文6是IP报文1的应答报文。VM1 obtains the response information carried in IP packet 6. From VM1's perspective, IP packet 6 comes from 10.0.0.10 and is a response packet to IP packet 1.

综上,在本实施例中,虽然VM1和VM2的私网地址相同,但通过VPC3的桥接,可实现互访。In summary, in this embodiment, although VM1 and VM2 have the same private network address, they can access each other through the bridging of VPC3.

进一步,请参见图10,图10示出根据本发明实施例的配置装置的装置结构示意图,如图6所示,配置装置60包括第一配置模块601和第二配置模块602,其中,第一配置模块601用于执行上述实施例中创建网关的动作,第二配置模块603用于执行上述实施例中为网关和路由器设置规则的动作。Further, please refer to FIG10, which shows a schematic diagram of the device structure of the configuration device according to an embodiment of the present invention. As shown in FIG6, the configuration device 60 includes a first configuration module 601 and a second configuration module 602, wherein the first configuration module 601 is used to perform the action of creating a gateway in the above embodiment, and the second configuration module 603 is used to perform the action of setting rules for the gateway and router in the above embodiment.

其中,配置装置60可设置在控制平台6中。The configuration device 60 can be installed in the control platform 6.

以下请参见图11,图11示出根据本发明实施例的计算设备的装置结构示意图,如图11所示,计算设备可以包括处理单元421和通信接口422,处理单元421用于执行物理服务器上运行的操作系统以及各种软件程序所定义的功能,例如,用于实现控制平台6的功能。通信接口422用于与其他计算节点进行通信交互,其他设备可以是其它物理服务器,具体地,通信接口422可以是网络适配卡。可选地,该物理服务器还可以包括输入/输出接口423,输入/输出接口423连接有输入/输出设备,用于接收输入的信息,输出操作结果。输入/输出接口423可以为鼠标、键盘、显示器、或者光驱等。可选地,该物理服务器还可以包括辅助存储器424,一般也称为外存,辅助存储器424的存储介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如光盘)、或者半导体介质(例如固态硬盘)等。处理单元421可以有多种具体实现形式,例如处理单元421可以包括处理器4212和存储器4211,处理器4212根据存储器4211中存储的程序指令执行上述实施例中控制平台6的相关操作,处理器4212可以为中央处理器(CPU)或图像处理器(英文:graphics processing unit,GPU),处理器4212可以是单核处理器或多核处理器。处理单元421也可以单独采用内置处理逻辑的逻辑器件来实现,例如现场可编程门阵列(英文全称:Field Programmable Gate Array,缩写:FPGA)或数字信号处理器(英文:digital signal processor,DSP)等。Please refer to Figure 11 below. Figure 11 shows a schematic diagram of the device structure of a computing device according to an embodiment of the present invention. As shown in Figure 11, the computing device may include a processing unit 421 and a communication interface 422. The processing unit 421 is used to execute the functions defined by the operating system and various software programs running on the physical server, for example, to implement the functions of the control platform 6. The communication interface 422 is used to communicate and interact with other computing nodes. Other devices may be other physical servers. Specifically, the communication interface 422 may be a network adapter card. Optionally, the physical server may also include an input/output interface 423. The input/output interface 423 is connected to an input/output device for receiving input information and outputting operation results. The input/output interface 423 may be a mouse, keyboard, monitor, or optical drive, etc. Optionally, the physical server may also include an auxiliary storage 424, generally also called external storage. The storage medium of the auxiliary storage 424 may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., optical disc), or a semiconductor medium (e.g., solid-state drive), etc. The processing unit 421 can have various specific implementations. For example, the processing unit 421 may include a processor 4212 and a memory 4211. The processor 4212 executes the relevant operations of the control platform 6 in the above embodiments according to the program instructions stored in the memory 4211. The processor 4212 can be a central processing unit (CPU) or a graphics processing unit (GPU). The processor 4212 can be a single-core processor or a multi-core processor. The processing unit 421 can also be implemented using a logic device with built-in processing logic, such as a field-programmable gate array (FPGA) or a digital signal processor (DSP).

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

进一步地,在本发明其他实施例中,也可以使用容器来替换虚拟机,本发明实施例对此不作限定。Furthermore, in other embodiments of the present invention, containers may be used to replace virtual machines, and the embodiments of the present invention do not limit this.

本发明实施例还提供一种实现上述控制平台的功能的计算机程序产品,上述计算机程序产品均包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令用于执行前述任意一个方法实施例所述的方法流程。本领域普通技术人员可以理解,前述的存储介质包括:U盘、移动硬盘、磁碟、光盘、随机存储器(Random-Access Memory,RAM)、固态硬盘(Solid State Disk,SSD)或者非易失性存储器(non-volatile memory)等各种可以存储程序代码的非短暂性的(non-transitory)机器可读介质。This invention also provides a computer program product for implementing the functions of the aforementioned control platform. All of these computer program products include a computer-readable storage medium storing program code. The instructions included in the program code are used to execute the method flow described in any of the foregoing method embodiments. Those skilled in the art will understand that the aforementioned storage medium includes various non-transitory machine-readable media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, optical disks, random-access memory (RAM), solid-state drives (SSDs), or non-volatile memory.

需说明的是,以上描述的任意装置实施例都仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部进程来实现本实施例方案的目的。另外,本发明提供的装置实施例附图中,进程之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。It should be noted that any of the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the processes can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between processes indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本发明而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘,U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,主机,或者网络设备等)执行本发明各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware, and of course, it can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memory, special components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for the present invention, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, portable hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, host, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

所属领域的技术人员可以清楚地了解到,上述描述的系统、装置或单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art will clearly understand that the specific working process of the system, device or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims (22)

1.一种虚拟私有云VPC通信的配置方法,其特征在于,所述方法用于配置第一VPC和第二VPC通过企业网进行通信,所述第一VPC、所述第二VPC以及所述企业网设置在公有云中,所述方法包括:1. A method for configuring communication in a Virtual Private Cloud (VPC), characterized in that the method is used to configure a first VPC and a second VPC to communicate through an enterprise network, wherein the first VPC, the second VPC, and the enterprise network are located in a public cloud, and the method includes: 在所述第一VPC中配置连接到所述企业网的第一网关,以及在所述第二VPC中配置连接到所述企业网的第二网关,其中,所述第一网关设置有第一地址,所述第二网关设置有第二地址;Configure a first gateway connected to the enterprise network in the first VPC, and configure a second gateway connected to the enterprise network in the second VPC, wherein the first gateway is configured with a first address and the second gateway is configured with a second address; 在所述第一网关上配置第一报文处理规则,所述第一报文处理规则包括:将所述第一网关的出报文的源地址由所述第一VPC内的地址转换为所述第一地址,其中,所述第一网关的出报文为所述第一网关从所述第一VPC内部接收到的报文;Configure a first message processing rule on the first gateway. The first message processing rule includes: converting the source address of the outgoing message of the first gateway from the address in the first VPC to the first address, wherein the outgoing message of the first gateway is a message received by the first gateway from inside the first VPC. 在所述第二网关上配置第二报文处理规则,所述第二报文处理规则包括:将所述第二网关的入报文的目的地址由所述第二地址转换为所述第二VPC内的地址,其中,所述第二网关的入报文为所述第二网关从所述企业网接收到的报文;Configure a second message processing rule on the second gateway. The second message processing rule includes: converting the destination address of the incoming message of the second gateway from the second address to an address within the second VPC, wherein the incoming message of the second gateway is a message received by the second gateway from the enterprise network. 在所述企业网的路由器配置路由规则,所述企业网的路由器的路由规则包括:将目的地址为所述第二地址的报文转发到所述第二网关;Configure routing rules on the routers in the enterprise network. The routing rules of the routers in the enterprise network include: forwarding packets whose destination address is the second address to the second gateway; 其中,所述第一网关接收来自所述第一VPC的第一报文,其中所述第一报文的源地址为所述第一VPC内的地址,所述第一报文的目的地址为所述第二网关的第二地址,所述第一网关根据所述第一报文处理规则将所述第一报文的源地址从所述第一VPC内的地址转换为所述第一地址,并将修改后的第一报文发送至所述企业网的路由器;所述企业网的路由器接收所述第一报文,根据所述路由规则将所述第一报文转发到所述第二网关;所述第二网关接收所述第一报文,根据所述第二报文处理规则将所述第一报文的目的地址由所述第二地址转换为所述第二VPC内的地址,并发送修改后的第一报文至所述第二VPC,所述企业网的私网地址段与所述第一VPC的私网地址段不相同,所述企业网VPC的私网地址段与所述第二VPC的私网地址段不相同。In this process, the first gateway receives a first message from the first VPC, wherein the source address of the first message is an address within the first VPC, and the destination address of the first message is a second address of the second gateway. The first gateway converts the source address of the first message from the address within the first VPC to the first address according to the first message processing rules, and sends the modified first message to the router of the enterprise network. The router of the enterprise network receives the first message and forwards it to the second gateway according to the routing rules. The second gateway receives the first message, converts the destination address of the first message from the second address to an address within the second VPC according to the second message processing rules, and sends the modified first message to the second VPC. The private network address range of the enterprise network is different from the private network address range of the first VPC, and the private network address range of the enterprise network VPC is different from the private network address range of the second VPC. 2.根据权利要求1所述的方法,其特征在于,2. The method according to claim 1, characterized in that, 所述第一报文处理规则还包括:将所述第一网关的入报文的目的地址由所述第一地址转换为所述第一VPC内的地址,其中,所述第一网关的入报文为所述第一网关从所述企业网接收到的报文;The first message processing rule further includes: converting the destination address of the incoming message of the first gateway from the first address to an address within the first VPC, wherein the incoming message of the first gateway is a message received by the first gateway from the enterprise network; 所述第二报文处理规则还包括:将所述第二网关的出报文的源地址由所述第二VPC内的地址转换为所述第二地址,其中,所述第二网关的出报文为所述第二网关从所述第二VPC接收到的报文;The second message processing rule further includes: converting the source address of the outgoing message of the second gateway from the address within the second VPC to the second address, wherein the outgoing message of the second gateway is the message received by the second gateway from the second VPC; 所述路由规则包括:将目的地址为所述第一地址的报文转发到所述第一网关;The routing rule includes: forwarding packets whose destination address is the first address to the first gateway; 其中,所述第二网关接收来自所述第二VPC的第二报文,其中所述第二报文的源地址为所述第二VPC内的地址,所述第二报文的目的地址为所述第一网关的第一地址,所述第二网关根据所述第二报文处理规则将所述第二报文的源地址从所述第二VPC内的地址转换为所述第二地址,并将修改后的第二报文发送至所述企业网的路由器;所述企业网的路由器接收所述第二报文,根据所述路由规则将所述第二报文转发到所述第一网关;所述第一网关接收所述第二报文,根据所述第一报文处理规则将所述第二报文的目的地址由所述第一地址转换为所述第一VPC内的地址,并发送修改后的第二报文至所述第一VPC。In this process, the second gateway receives a second message from the second VPC, wherein the source address of the second message is an address within the second VPC, and the destination address of the second message is a first address of the first gateway. The second gateway converts the source address of the second message from the address within the second VPC to the second address according to the second message processing rules, and sends the modified second message to the router of the enterprise network. The router of the enterprise network receives the second message and forwards the second message to the first gateway according to the routing rules. The first gateway receives the second message, converts the destination address of the second message from the first address to the address within the first VPC according to the first message processing rules, and sends the modified second message to the first VPC. 3.根据权利要求1所述的方法,其特征在于,所述第一地址为私网地址网段中的第一私网地址,所述第二地址为所述私网地址网段中的第二私网地址。3. The method according to claim 1, wherein the first address is a first private network address in the private network address segment, and the second address is a second private network address in the private network address segment. 4.根据权利要求3所述的方法,其特征在于,所述私网地址网段包括192.168.0.0/16、172.16.0.0/12、以及10.0.0.0/8。4. The method according to claim 3, wherein the private network address segment includes 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8. 5.根据权利要求3所述的方法,其特征在于,所述第一网关的私网地址与所述第一VPC的子网和所述第二VPC的子网的私网地址段不相同,所述第二网关的私网地址与所述第一VPC的子网和所述第二VPC的子网的私网地址段不相同。5. The method according to claim 3, wherein the private network address of the first gateway is different from the private network address range of the subnet of the first VPC and the subnet of the second VPC, and the private network address of the second gateway is different from the private network address range of the subnet of the first VPC and the subnet of the second VPC. 6.根据权利要求1所述的方法,其特征在于,所述第一VPC中设置有第一子网,所述第二VPC设置有第二子网,所述第一子网和所述第二子网具有相同私网地址段,所述第一VPC内的地址为所述第一子网内的地址,所述第二VPC内的地址为所述第二子网内的地址。6. The method according to claim 1, wherein the first VPC is provided with a first subnet, the second VPC is provided with a second subnet, the first subnet and the second subnet have the same private network address range, the address in the first VPC is the address in the first subnet, and the address in the second VPC is the address in the second subnet. 7.根据权利要求6所述的方法,其特征在于,所述第一子网内设置有第一虚拟机,所述第二子网内设置有第二虚拟机。7. The method according to claim 6, wherein a first virtual machine is provided in the first subnet and a second virtual machine is provided in the second subnet. 8.根据权利要求1所述的方法,其特征在于,还包括:8. The method according to claim 1, characterized in that it further comprises: 在所述第一VPC的路由器上配置路由规则,所述第一VPC的路由器上的路由规则包括:将目的地址为所述第二地址的报文转发到所述第一网关;Configure routing rules on the router of the first VPC. The routing rules on the router of the first VPC include: forwarding packets with the destination address as the second address to the first gateway. 在所述第二VPC的路由器上配置路由规则,所述第二VPC的路由器上的路由规则包括:将目的地址为所述第一地址的报文转发到所述第二网关。Configure routing rules on the router of the second VPC. The routing rules on the router of the second VPC include: forwarding packets with the destination address as the first address to the second gateway. 9.根据权利要求1或2所述的方法,其特征在于,所述第一地址和所述第二地址为归属于所述企业网的私网地址。9. The method according to claim 1 or 2, wherein the first address and the second address are private network addresses belonging to the enterprise network. 10.根据权利要求9所述的方法,其特征在于,所述企业网通过所述公有云中的第三VPC实现。10. The method according to claim 9, wherein the enterprise network is implemented through a third VPC in the public cloud. 11.一种虚拟私有云VPC通信系统,其特征在于,包括:11. A Virtual Private Cloud (VPC) communication system, characterized in that it comprises: 控制平台,用于:Control platform, used for: 在第一VPC中配置连接到企业网的第一网关,以及在第二VPC中配置连接到所述企业网的第二网关,其中,所述第一网关设置有第一地址,所述第二网关设置有第二地址,其中所述第一VPC、所述第二VPC以及所述企业网设置在公有云中,所述企业网的私网地址段与所述第一VPC的私网地址段不相同,所述企业网VPC的私网地址段与所述第二VPC的私网地址段不相同;A first gateway connected to the enterprise network is configured in a first VPC, and a second gateway connected to the enterprise network is configured in a second VPC. The first gateway is set with a first address, and the second gateway is set with a second address. The first VPC, the second VPC, and the enterprise network are located in a public cloud. The private network address range of the enterprise network is different from that of the first VPC, and the private network address range of the enterprise network VPC is different from that of the second VPC. 在所述第一网关上配置第一报文处理规则,所述第一报文处理规则包括:将所述第一网关的出报文的源地址由所述第一VPC内的地址转换为所述第一地址,其中,所述第一网关的出报文为所述第一网关从所述第一VPC内部接收到的报文;Configure a first message processing rule on the first gateway. The first message processing rule includes: converting the source address of the outgoing message of the first gateway from the address in the first VPC to the first address, wherein the outgoing message of the first gateway is a message received by the first gateway from inside the first VPC. 在所述第二网关上配置第二报文处理规则,所述第二报文处理规则包括:将所述第二网关的入报文的目的地址由所述第二地址转换为所述第二VPC内的地址,其中,所述第二网关的入报文为所述第二网关从所述企业网接收到的报文;Configure a second message processing rule on the second gateway. The second message processing rule includes: converting the destination address of the incoming message of the second gateway from the second address to an address within the second VPC, wherein the incoming message of the second gateway is a message received by the second gateway from the enterprise network. 在所述企业网的路由器配置路由规则,所述企业网的路由器的路由规则包括:将目的地址为所述第二地址的报文转发到所述第二网关;Configure routing rules on the routers in the enterprise network. The routing rules of the routers in the enterprise network include: forwarding packets whose destination address is the second address to the second gateway; 所述第一网关,用于接收来自所述第一VPC的第一报文,其中所述第一报文的源地址为所述第一VPC内的地址,所述第一报文的目的地址为所述第二网关的第二地址,并根据所述第一报文处理规则将所述第一报文的源地址从所述第一VPC内的地址转换为所述第一地址,将修改后的第一报文发送至所述企业网的路由器;The first gateway is configured to receive a first message from the first VPC, wherein the source address of the first message is an address within the first VPC, the destination address of the first message is a second address of the second gateway, and convert the source address of the first message from the address within the first VPC to the first address according to the first message processing rules, and send the modified first message to the router of the enterprise network. 所述企业网的路由器,用于接收所述第一报文,根据所述路由规则将所述第一报文转发到所述第二网关;The router of the enterprise network is used to receive the first message and forward the first message to the second gateway according to the routing rules; 所述第二网关,用于接收所述第一报文,根据所述第二报文处理规则将所述第一报文的目的地址由所述第二地址转换为所述第二VPC内的地址,并发送修改后的第一报文至所述第二VPC。The second gateway is used to receive the first message, convert the destination address of the first message from the second address to an address within the second VPC according to the second message processing rules, and send the modified first message to the second VPC. 12.根据权利要求11所述的系统,其特征在于,12. The system according to claim 11, characterized in that, 所述第一报文处理规则还包括:将所述第一网关的入报文的目的地址由所述第一地址转换为所述第一VPC内的地址,其中,所述第一网关的入报文为所述第一网关从所述企业网接收到的报文;The first message processing rule further includes: converting the destination address of the incoming message of the first gateway from the first address to an address within the first VPC, wherein the incoming message of the first gateway is a message received by the first gateway from the enterprise network; 所述第二报文处理规则还包括:将所述第二网关的出报文的源地址由所述第二VPC内的地址转换为所述第二地址,其中,所述第二网关的出报文为所述第二网关从所述第二VPC接收到的报文;The second message processing rule further includes: converting the source address of the outgoing message of the second gateway from the address within the second VPC to the second address, wherein the outgoing message of the second gateway is the message received by the second gateway from the second VPC; 所述路由规则包括:将目的地址为所述第一地址的报文转发到所述第一网关;The routing rule includes: forwarding packets whose destination address is the first address to the first gateway; 其中,所述第二网关接收来自所述第二VPC的第二报文,其中所述第二报文的源地址为所述第二VPC内的地址,所述第二报文的目的地址为所述第一网关的第一地址,所述第二网关根据所述第二报文处理规则将所述第二报文的源地址从所述第二VPC内的地址转换为所述第二地址,并将修改后的第二报文发送至所述企业网的路由器;所述企业网的路由器接收所述第二报文,根据所述路由规则将所述第二报文转发到所述第一网关;所述第一网关接收所述第二报文,根据所述第一报文处理规则将所述第二报文的目的地址由所述第一地址转换为所述第一VPC内的地址,并发送修改后的第二报文至所述第一VPC。In this process, the second gateway receives a second message from the second VPC, wherein the source address of the second message is an address within the second VPC, and the destination address of the second message is a first address of the first gateway. The second gateway converts the source address of the second message from the address within the second VPC to the second address according to the second message processing rules, and sends the modified second message to the router of the enterprise network. The router of the enterprise network receives the second message and forwards the second message to the first gateway according to the routing rules. The first gateway receives the second message, converts the destination address of the second message from the first address to the address within the first VPC according to the first message processing rules, and sends the modified second message to the first VPC. 13.根据权利要求11所述的系统,其特征在于,所述第一地址为私网地址网段中的第一私网地址,所述第二地址为所述私网地址网段中的第二私网地址。13. The system according to claim 11, wherein the first address is a first private network address in the private network address segment, and the second address is a second private network address in the private network address segment. 14.根据权利要求13所述的系统,其特征在于,所述私网地址网段包括192.168.0.0/16、172.16.0.0/12、以及10.0.0.0/8。14. The system according to claim 13, wherein the private network address segments include 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8. 15.根据权利要求13所述的系统,其特征在于,所述第一网关的私网地址与所述第一VPC的子网和所述第二VPC的子网的私网地址段不相同,所述第二网关的私网地址与所述第一VPC的子网和所述第二VPC的子网的私网地址段不相同。15. The system according to claim 13, wherein the private network address of the first gateway is different from the private network address range of the subnet of the first VPC and the subnet of the second VPC, and the private network address of the second gateway is different from the private network address range of the subnet of the first VPC and the subnet of the second VPC. 16.根据权利要求11所述的系统,其特征在于,所述第一VPC中设置有第一子网,所述第二VPC设置有第二子网,所述第一子网和所述第二子网具有相同私网地址段,所述第一VPC内的地址为所述第一子网内的地址,所述第二VPC内的地址为所述第二子网内的地址。16. The system according to claim 11, wherein the first VPC is provided with a first subnet, the second VPC is provided with a second subnet, the first subnet and the second subnet have the same private network address range, the address in the first VPC is the address in the first subnet, and the address in the second VPC is the address in the second subnet. 17.根据权利要求16所述的系统,其特征在于,所述第一子网内设置有第一虚拟机,所述第二子网内设置有第二虚拟机。17. The system according to claim 16, wherein a first virtual machine is provided in the first subnet and a second virtual machine is provided in the second subnet. 18.根据权利要求11所述的系统,其特征在于,还包括:18. The system according to claim 11, characterized in that it further comprises: 在所述第一VPC的路由器上配置路由规则,所述第一VPC的路由器上的路由规则包括:将目的地址为所述第二地址的报文转发到所述第一网关;Configure routing rules on the router of the first VPC. The routing rules on the router of the first VPC include: forwarding packets with the destination address as the second address to the first gateway. 在所述第二VPC的路由器上配置路由规则,所述第二VPC的路由器上的路由规则包括:将目的地址为所述第一地址的报文转发到所述第二网关。Configure routing rules on the router of the second VPC. The routing rules on the router of the second VPC include: forwarding packets with the destination address as the first address to the second gateway. 19.根据权利要求11所述的系统,其特征在于,所述第一地址和所述第二地址为为归属于所述企业网的私网地址。19. The system according to claim 11, wherein the first address and the second address are private network addresses belonging to the enterprise network. 20.根据权利要求19所述的系统,其特征在于,所述企业网通过所述公有云中的第三VPC实现。20. The system according to claim 19, wherein the enterprise network is implemented through a third VPC in the public cloud. 21.一种计算设备,其特征在于,包括至少一个存储器和至少一个处理器,所述至少一个存储器用于存储程序指令,所述至少一个处理器执行所述程序指令,以执行上述权利要求1至10任一项所述的方法。21. A computing device, characterized in that it comprises at least one memory and at least one processor, the at least one memory being used to store program instructions, the at least one processor executing the program instructions to perform the method according to any one of claims 1 to 10. 22.一种非瞬态的可读存储介质,所述非瞬态的可读存储介质被计算设备执行时,所述计算设备执行上述权利要求1至10任一项所述的方法。22. A non-transient readable storage medium, wherein when executed by a computing device, the computing device performs the method according to any one of claims 1 to 10.
HK62023079295.9A 2019-12-31 2020-09-04 Virtual private cloud communication method, virtual private cloud communication configuration method, and related apparatuses HK40090849B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911424858.X 2019-12-31

Publications (2)

Publication Number Publication Date
HK40090849A HK40090849A (en) 2023-11-24
HK40090849B true HK40090849B (en) 2024-06-28

Family

ID=

Similar Documents

Publication Publication Date Title
CN115699699B (en) Virtual private cloud and cloud data center communication and configuration method and related device
CN112470436B (en) Systems, methods, and computer-readable media for providing multi-cloud connectivity
JP7413415B2 (en) Communication method, gateway, and management method and device in a hybrid cloud environment
CN109451084B (en) A service access method and device
CN109561171B (en) Configuration method and device of virtual private cloud service
CN106533890B (en) A message processing method, device and system
CN108449282A (en) A kind of load-balancing method and its device
CN107113241B (en) Route determination method, network configuration method and related device
CN109617906B (en) A hybrid cloud access method and device
US20170359198A1 (en) Non-transitory computer-readable storage medium, communication control method, and communication control device
CN116599900A (en) Cloud environment access method and device
HK40090849B (en) Virtual private cloud communication method, virtual private cloud communication configuration method, and related apparatuses
HK40090849A (en) Virtual private cloud communication method, virtual private cloud communication configuration method, and related apparatuses
CN114448667B (en) Data transmission method, device and equipment
WO2020181733A1 (en) Vpc-based multi-data center intercommunication method and related device
WO2024037619A1 (en) Cloud computing technology-based virtual instance creation method and cloud management platform
CN115665026A (en) Cluster networking method and device
WO2015117380A1 (en) Method, device and system for remote desktop protocol gateway to conduct routing and switching
WO2024165025A1 (en) Virtual instance configuration method based on public cloud, and cloud management platform
HK40077329A (en) Virtual private cloud and non-public cloud data center communication method, virtual private cloud and non-public cloud data center communication configuration method, and related apparatuses
WO2025191356A1 (en) Data processing method, apparatus, device, storage medium and program product
CN116915585A (en) Software-defined wide area network networking method, device, electronic equipment and storage medium