Easily set multiple public IPs for a single cloud server using a NAT gateway

Abstract: Background In applications, users sometimes ask how to make a single cloud server have multiple public IPs. How to operate it specifically, with a NAT gateway, this is not a problem. Process for configuring multiple public IP addresses on a single cloud host 1. Configure multiple network cards for an ECS instance. 2. Create a NAT gateway.

Background

In applications, users sometimes ask how to make a single cloud server have multiple public IPs.
How to operate it specifically, with a NAT gateway, this is not a problem.

Process for configuring multiple public IP addresses on a single cloud host

1. Configure multiple network cards for an ECS instance.
2. Create a NAT gateway. The NAT gateway must be in the same VPC as the ECS.
3. Bind multiple elastic public IPs to the NAT gateway, or use NAT to share bandwidth packages.
4. Create a DNAT entry so that multiple elastic public network EIPs (and ports) are mapped to multiple private network IPs (and ports) of the ECS instance.

Operation steps

The schematic diagram of this operation is as follows:

First, bind multiple network cards to the VPC ECS (ECS1). Currently, each VPC ECS can have up to 2 NICs by default, and you can apply for the amount of bound NICs in a work order. For details on how to configure multiple NICs, please refer to Elastic NICs in Alibaba Cloud's official documentation. This operation is to enable VPC ECS to have two network cards. The network card details and private network IP addresses are shown in the following figure.



Create a NAT gateway and bind two elastic public IPs to the NAT gateway, external IP-1=47.xx.xx.71 and external IP-2=47.xx.xx.202.
Create DNAT entries, map external IP-1 to private network IP=172.16.1.190, and map external IP-2 to private network IP=172.16.1.194.


verify

Log in to ECS, check the IP address, and enable the service to display "this is for multiple IPs test".


Browsers visit external IP-1 and external IP-2 respectively to view the returned results. Verification succeeded.


Original link: https://yq.aliyun.com/articles/562556?spm=a2c41.11181499.0.0

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326165267&siteId=291194637
Recommended