By Alain Francois
Major cloud providers mainly offer two types of IP addresses for your cloud instances or network, Public IP and Elastic IP (EIP). Elastic IPs are the most popular when you want your instance to be reachable with the same address all the time (even if the instance is restarted).
An EIP is a NAT IP address located in the Internet gateway of Alibaba Cloud and mapped to the associated cloud resource through NAT. An EIP allows you to migrate IP addresses to Alibaba Cloud with insignificant changes to the system architecture. After an instance is released, its associated EIP is retained so that you can bind it later to another resource. An EIP can be associated with an Elastic Compute Service (ECS) instance, an internal-facing Server Load Balancer (SLB) instance, a secondary elastic network interface (ENI), a NAT gateway, or a high-availability virtual IP address (HAVIP) in the same region. The ECS instance and internal-facing SLB instance must be deployed in a virtual private cloud (VPC).
Some requirements must be fulfilled to associate an Elastic IP to an ECS instance:
You need an Alibaba Cloud account to purchase an Elastic IP (EIP). If you don't have an account yet, you can get a coupon to create one during the March Mega Sale. Log in to the panel and go to the Elastic IP service:
Let‘s create an EIP:
You must purchase the EIP in the same region as your instance:
Confirm your order:
After purchasing your EIP, you can see your EIP:
After your EIP has been purchased, you can create an ECS instance.
After purchasing the EIP, you need to create an ECS instance without a Public IP. It is required to bind an EIP to an ECS. Go to Elastic Compute Service (ECS):
On the left panel, scroll to Instances & Images and select Instances to create a new ECS instance:
Before you start, we recommend using a Linux ECS instance with
root privileges and a minimum of 4GB RAM and 2vCPU cores for basic comfortable operations. We will create a Pay-As-You-Go instance with 2 vCPU and 4 GB memory:
You can select the operating system and define the disk size:
Select the VPC that will be used for your instance and the Security Group. Note: You must not assign a public IP:
Configure if you will access your ECS with a password or a public key:
In the next step, select the default resource group:
You will see a review of your ECS configuration and order. There is a remark saying we didn't assign a public IP:
Now, you can see your new instance:
Log into your console and install a web service to check if the Elastic IP is working. You can follow our guide on the installation of a LEMP server.
Finally, you can see your ECS with the private IP only:
As stated previously, you can attach an EIP to some resources. You can directly attach the IP to the instance via the ECS itself. Stay on the list of the ECS and click on the three dots to open the menu:
Go to the VPC service and EIP. This is the best way to see the other EIP association possibilities besides ECS:
You can see the different options offered for an EIP association. Select the ECS type. All the ECS instances detected will be listed so you can select the new ECS:
The EIP is assigned now:
Go to the ECS and see if the binding is effective:
The EIP is attached to the ECS instance. Open your browser and enter the EIP to access the Nginx default page
Public IP vs. Elastic IP: What Is the Best Choice?
When hosting your services on the cloud, you need your services to be reachable. However, depending on some requirements, you need to be careful about the type of IP you need to assign. Major cloud providers offer some types of IP addresses that you can assign to your cloud instances, such as the Public IP and the Elastic IP (EIP).
Alibaba Cloud Accelerates BRB's Strategy to Support Financial Inclusion in the Philippines
How to Install Jenkins with Docker and Secure It with Let's Encrypt on an Alibaba ECS Instance
606 posts | 102 followersFollow
Alibaba Clouder - October 25, 2018
Alibaba Cloud Community - February 9, 2022
Marketplace - February 21, 2019
Alibaba Clouder - November 19, 2019
Alibaba Clouder - April 22, 2019
Alibaba Clouder - February 14, 2020
606 posts | 102 followersFollow
An independent public IP resource that decouples ECS and public IP resources, allowing you to flexibly manage public IP resources.Learn More
An online computing service that offers elastic and secure virtual cloud servers to cater all your cloud hosting needs.Learn More
High Performance Computing (HPC) and AI technology helps scientific research institutions to perform viral gene sequencing, conduct new drug research and development, and shorten the research and development cycle.Learn More
Deploy custom Alibaba Cloud solutions for business-critical scenarios with Quick Start templates.Learn More
More Posts by Alibaba Cloud Community