Enabling the Internet to Access Private Networks Using a Cloud Connection and DNAT
Scenarios
- This practice provides detailed operations for the Internet outside the Chinese mainland to access private networks.
- DNAT rules are required so that ECSs in the VPCs in the Chinese mainland can provide services accessible from the Internet.
For details about the regions where cloud connections are available, see Region Availability.
Figure 1 shows an example.
In this practice, suppose that the VPC in CN East-Shanghai1 is the on-premises network.
The CIDR block of the Internet outside the Chinese mainland is 0.0.0.0/0.
Your account must have the permission for cross-border communication. If your account does not have the permission, you can ask the other user with the required permission to load the VPCs.
Procedure
- Create the following VPCs and ensure that the VPC CIDR blocks do not conflict with each other:
- VPC in CN East-Shanghai1: 172.16.36.0/24
- VPC in CN-Hong Kong: 192.168.120.0/24
For details, see Creating a VPC.
- Create a cloud connection.
- Create a cloud connection.
For details, see Creating a Cloud Connection.
- Load the VPCs.
For details, see Loading a Network Instance.
- Add custom CIDR blocks.
For details, see Adding Custom CIDR Blocks for a Cloud Connection.
When you load the VPC in CN-Hong Kong, you need to add the custom CIDR block 0.0.0.0/0.
You need to add the default route 0.0.0.0/0 to allow access from the NAT gateway.
- Buy a bandwidth package.
By default, a cloud connection provides 10 kbit/s of bandwidth for testing cross-region network connectivity. You need to buy a bandwidth package to ensure normal communication across regions.
For details, see Buying a Bandwidth Package.
- Assign an inter-region bandwidth.
For details, see Assigning an Inter-Region Bandwidth.
- Create a cloud connection.
- Buy an ECS in CN East-Shanghai1.
For details, see Purchasing an ECS.
Private IP address of the ECS in CN East-Shanghai1: 172.16.36.220
- Buy an EIP and configure a NAT gateway.
In CN-Hong Kong, buy an EIP and a public NAT gateway, and add a DNAT rule. Select Direct Connect/Cloud Connect when you add the DNAT rule.
For details, see Assigning an EIP and Binding It to an ECS and Adding a DNAT Rule.
Set the private IP address to 172.16.36.220 when you add the DNAT rule.
The DNAT rule enables the ECS to provide services accessible from the Internet.
Verification
Test network connectivity.
Ping the EIP bound to the DNAT rule and the port used by the EIP from any client on the Internet.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot