Elastic IP addresses

An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. An Elastic IP address is allocated to your AWS account, and is yours until you release it. By using an Elastic IP address, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account. Alternatively, you can specify the Elastic IP address in a DNS record for your domain, so that your domain points to your instance. For more information, see the documentation for your domain registrar , or Set up dynamic DNS on your Amazon Linux instance .

An Elastic IP address is a public IPv4 address, which is reachable from the internet. If your instance does not have a public IPv4 address, you can associate an Elastic IP address with your instance to enable communication with the internet. For example, this allows you to connect to your instance from your local computer.

Elastic IP address pricing

Elastic ip address basics, work with elastic ip addresses, elastic ip address quota.

AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page .

The following are the basic characteristics of an Elastic IP address:

An Elastic IP address is static; it does not change over time.

An Elastic IP address is for use in a specific Region only, and cannot be moved to a different Region.

An Elastic IP address comes from Amazon's pool of IPv4 addresses, or from a custom IPv4 address pool that you have brought to your AWS account.

To use an Elastic IP address, you first allocate one to your account, and then associate it with your instance or a network interface.

When you associate an Elastic IP address with an instance, it is also associated with the instance's primary network interface. When you associate an Elastic IP address with a network interface that is attached to an instance, it is also associated with the instance.

When you associate an Elastic IP address with an instance or its primary network interface, the instance's public IPv4 address (if it had one) is released back into Amazon's pool of public IPv4 addresses. You cannot reuse a public IPv4 address, and you cannot convert a public IPv4 address to an Elastic IP address. For more information, see Public IPv4 addresses .

You can disassociate an Elastic IP address from a resource, and then associate it with a different resource. To avoid unexpected behavior, ensure that all active connections to the resource named in the existing association are closed before you make the change. After you have associated your Elastic IP address to a different resource, you can reopen your connections to the newly associated resource.

A disassociated Elastic IP address remains allocated to your account until you explicitly release it. We impose a small hourly charge for Elastic IP addresses that are not associated with a running instance.

When you associate an Elastic IP address with an instance that previously had a public IPv4 address, the public DNS host name of the instance changes to match the Elastic IP address.

We resolve a public DNS host name to the public IPv4 address or the Elastic IP address of the instance outside the network of the instance, and to the private IPv4 address of the instance from within the network of the instance.

When you allocate an Elastic IP address from an IP address pool that you have brought to your AWS account, it does not count toward your Elastic IP address limits. For more information, see Elastic IP address quota .

When you allocate the Elastic IP addresses, you can associate the Elastic IP addresses with a network border group. This is the location from which we advertise the CIDR block. Setting the network border group limits the CIDR block to this group. If you do not specify the network border group, we set the border group containing all of the Availability Zones in the Region (for example, us-west-2 ).

An Elastic IP address is for use in a specific network border group only.

The following sections describe how you can work with Elastic IP addresses.

Allocate an Elastic IP address

Describe your elastic ip addresses, tag an elastic ip address, associate an elastic ip address with an instance or network interface, disassociate an elastic ip address, transfer elastic ip addresses, release an elastic ip address, recover an elastic ip address, use reverse dns for email applications.

You can allocate an Elastic IP address from Amazon's pool of public IPv4 addresses, or from a custom IP address pool that you have brought to your AWS account. For more information about bringing your own IP address range to your AWS account, see Bring your own IP addresses (BYOIP) in Amazon EC2 .

You can allocate an Elastic IP address using one of the following methods.

To allocate an Elastic IP address

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ .

In the navigation pane, choose Network & Security , Elastic IPs .

Choose Allocate Elastic IP address .

(Optional) When you allocate an Elastic IP address (EIP), you choose the Network border group in which to allocate the EIP. A network border group is a collection of Availability Zones (AZs), Local Zones, or Wavelength Zones from which AWS advertises a public IP address. Local Zones and Wavelength Zones may have different network border groups than the AZs in a Region to ensure minimum latency or physical distance between the AWS network and the customers accessing the resources in these Zones.

You must allocate an EIP in the same network border group as the AWS resource that will be associated with the EIP. An EIP in one network border group can only be advertised in zones in that network border group and not in any other zones represented by other network border groups.

If you have Local Zones or Wavelength Zones enabled (for more information, see Enable a Local Zone or Enable Wavelength Zones ), you can choose a network border group for AZs, Local Zones, or Wavelength Zones. Choose the network border group carefully as the EIP and the AWS resource it is associated with must reside in the same network border group. You can use the EC2 console to view the network border group that your Availability Zones, Local Zones, or Wavelength Zones are in (see Local Zones ). Typically, all Availability Zones in a Region belong to the same network border group, whereas Local Zones or Wavelength Zones belong to their own separate network border groups.

If you don't have Local Zones or Wavelength Zones enabled, when you allocate an EIP, the network border group that represents all of the AZs for the Region (such as us-west-2 ) is predefined for you and you cannot change it. This means that the EIP that you allocate to this network border group will be advertised in all AZs in the Region you're in.

For Public IPv4 address pool , choose one of the following:

Amazon's pool of IPv4 addresses —If you want an IPv4 address to be allocated from Amazon's pool of IPv4 addresses.

Public IPv4 address that you bring to your AWS account —If you want to allocate an IPv4 address from an IP address pool that you have brought to your AWS account. This option is disabled if you do not have any IP address pools.

Customer owned pool of IPv4 addresses —If you want to allocate an IPv4 address from a pool created from your on-premises network for use with an AWS Outpost. This option is disabled if you do not have an AWS Outpost.

(Optional) Add or remove a tag.

[Add a tag] Choose Add new tag and do the following:

For Key , enter the key name.

For Value , enter the key value.

[Remove a tag] Choose Remove to the right of the tag’s Key and Value.

Choose Allocate .

Use the allocate-address AWS CLI command.

Use the New-EC2Address AWS Tools for Windows PowerShell command.

You can describe an Elastic IP address using one of the following methods.

To describe your Elastic IP addresses

In the navigation pane, choose Elastic IPs .

Select the Elastic IP address to view and choose Actions , View details .

Use the describe-addresses AWS CLI command.

Use the Get-EC2Address AWS Tools for Windows PowerShell command.

You can assign custom tags to your Elastic IP addresses to categorize them in different ways, for example, by purpose, owner, or environment. This helps you to quickly find a specific Elastic IP address based on the custom tags that you assigned to it.

Cost allocation tracking using Elastic IP address tags is not supported.

You can tag an Elastic IP address using one of the following methods.

To tag an Elastic IP address

Select the Elastic IP address to tag and choose Actions , View details .

In the Tags section, choose Manage tags .

Specify a tag key and value pair.

(Optional) Choose Add tag to add additional tags.

Choose Save .

Use the create-tags AWS CLI command.

Use the New-EC2Tag AWS Tools for Windows PowerShell command.

The New-EC2Tag command needs a Tag parameter, which specifies the key and value pair to be used for the Elastic IP address tag. The following commands create the Tag parameter.

If you're associating an Elastic IP address with your instance to enable communication with the internet, you must also ensure that your instance is in a public subnet. For more information, see Internet gateways in the Amazon VPC User Guide .

You can associate an Elastic IP address with an instance or network interface using one of the following methods.

To associate an Elastic IP address with an instance

Select the Elastic IP address to associate and choose Actions , Associate Elastic IP address .

For Resource type , choose Instance .

For instance, choose the instance with which to associate the Elastic IP address. You can also enter text to search for a specific instance.

(Optional) For Private IP address , specify a private IP address with which to associate the Elastic IP address.

Choose Associate .

To associate an Elastic IP address with a network interface

For Resource type , choose Network interface .

For Network interface , choose the network interface with which to associate the Elastic IP address. You can also enter text to search for a specific network interface.

To associate an Elastic IP address

Use the associate-address AWS CLI command.

Use the Register-EC2Address AWS Tools for Windows PowerShell command.

You can disassociate an Elastic IP address from an instance or network interface at any time. After you disassociate the Elastic IP address, you can reassociate it with another resource.

You can disassociate an Elastic IP address using one of the following methods.

To disassociate and reassociate an Elastic IP address

Select the Elastic IP address to disassociate, choose Actions , Disassociate Elastic IP address .

Choose Disassociate .

To disassociate an Elastic IP address

Use the disassociate-address AWS CLI command.

Use the Unregister-EC2Address AWS Tools for Windows PowerShell command.

This section describes how to transfer Elastic IP addresses from one AWS account to another. Transferring Elastic IP addresses can be helpful in the following situations:

Organizational restructuring – Use Elastic IP address transfers to quickly move workloads from one AWS account to another. You don't have to wait for new Elastic IP addresses to be allowlisted in your security groups and NACLs.

Centralized security administration – Use a centralized AWS security account to track and transfer Elastic IP addresses that have been vetted for security compliance.

Disaster recovery – Use Elastic IP address transfers to quickly remap IPs for public-facing internet workloads during emergency events.

There is no charge for transferring Elastic IP addresses.

Enable Elastic IP address transfer

Disable elastic ip address transfer, accept a transferred elastic ip address.

This section describes how to accept a transferred Elastic IP address. Note the following limitations related to enabling Elastic IP addresses for transfer:

You can transfer Elastic IP addresses from any AWS account (source account) to any other AWS account in the same AWS Region (transfer account).

When you transfer an Elastic IP address, there is a two-step handshake between the AWS accounts. When the source account starts the transfer, the transfer accounts have seven days to accept the Elastic IP address transfer. During those seven days, the source account can view the pending transfer (for example in the AWS console or by using the describe-address-transfers AWS CLI command). After seven days, the transfer expires and ownership of the Elastic IP address returns to the source account.

Accepted transfers are visible to the source account (for example in the AWS console or by using the describe-address-transfers AWS CLI command) for three days after the transfers have been accepted.

AWS does not notify transfer accounts about pending Elastic IP address transfer requests. The owner of the source account must notify the owner of the transfer account that there is an Elastic IP address transfer request that they must accept.

Any tags that are associated with an Elastic IP address being transferred are reset when the transfer is complete.

You cannot transfer Elastic IP addresses allocated from public IPv4 address pools that you bring to your AWS account – commonly referred to as Bring Your Own IP (BYOIP) address pools.

If you attempt to transfer an Elastic IP address that has a reverse DNS record associated with it, you can begin the transfer process, but the transfer account will not be able to accept the transfer until the associated DNS record is removed.

If you have enabled and configured AWS Outposts, you might have allocated Elastic IP addresses from a customer-owned IP address pool (CoIP). You cannot transfer Elastic IP addresses allocated from a CoIP. However, you can use AWS RAM to share a CoIP with another account. For more information, see Customer-owned IP addresses in the AWS Outposts User Guide .

You can use Amazon VPC IPAM to track the transfer of Elastic IP addresses to accounts in an organization from AWS Organizations. For more information, see View IP address history . If an Elastic IP address is transferred to an AWS account outside of the organization, the IPAM audit history of the Elastic IP address is lost.

These steps must be completed by the source account.

To enable Elastic IP address transfer

Ensure that you're using the source AWS account.

Select one or more Elastic IP address to enable for transfer and choose Actions , Enable transfer .

If you are transferring multiple Elastic IP addresses, you’ll see the Transfer type option. Choose one of the following options:

Choose Single account if you are transferring the Elastic IP addresses to a single AWS account.

Choose Multiple accounts if you are transferring the Elastic IP addresses to multiple AWS accounts.

Under Transfer account ID , enter the IDs of the AWS accounts that you want to transfer the Elastic IP addresses to.

Confirm the transfer by entering enable in the text box.

Choose Submit .

To accept the transfer, see Accept a transferred Elastic IP address . To disable the transfer, see Disable Elastic IP address transfer .

Use the enable-address-transfer command.

Use the Enable-EC2AddressTransfer command.

This section describes how to disable an Elastic IP transfer after the transfer has been enabled.

These steps must be completed by the source account that enabled the transfer.

To disable an Elastic IP address transfer

In the resource list of Elastic IPs, ensure that you have the property enabled that shows the column Transfer status .

Select one or more Elastic IP address that have a Transfer status of Pending , and choose Actions , Disable transfer .

Confirm by entering disable in the text box.

To disable Elastic IP address transfer

Use the disable-address-transfer command.

Use the Disable-EC2AddressTransfer command.

This section describes how to accept a transferred Elastic IP address.

When accepting transfers, note the following exceptions that might occur and how to resolve them:

AddressLimitExceeded : If your transfer account has exceeded the Elastic IP address quota, the source account can enable Elastic IP address transfer, but this exception occurs when the transfer account tries to accept the transfer. By default, all AWS accounts are limited to 5 Elastic IP addresses per Region. See Elastic IP address quota for instructions on increasing the limit.

InvalidTransfer.AddressCustomPtrSet : If you or someone in your organization has configured the Elastic IP address that you are attempting to transfer to use reverse DNS lookup, the source account can enable transfer for the Elastic IP address, but this exception occurs when the transfer account tries to accept the transfer. To resolve this issue, the source account must remove the DNS record for the Elastic IP address. For more information, see Use reverse DNS for email applications .

InvalidTransfer.AddressAssociated : If an Elastic IP address is associated with an ENI or EC2 instance, the source account can enable transfer for the Elastic IP address, but this exception occurs when the transfer account tries to accept the transfer. To resolve this issue, the source account must disassociate the Elastic IP address. For more information, see Disassociate an Elastic IP address .

For any other exceptions, contact AWS Support .

These steps must be completed by the transfer account.

To accept an Elastic IP address transfer

Ensure that you're using the transfer account.

Choose Actions , Accept transfer .

No tags that are associated with the Elastic IP address being transferred are transferred with the Elastic IP address when you accept the transfer. If you want to define a Name tag for the Elastic IP address that you are accepting, select Create a tag with a key of 'Name' and a value that you specify .

Enter the Elastic IP address that you want to transfer.

If you are accepting multiple transferred Elastic IP addresses, choose Add address to enter an additional Elastic IP address.

Use the accept-address-transfer command.

Use the Approve-EC2AddressTransfer command.

If you no longer need an Elastic IP address, we recommend that you release it using one of the following methods. The address to release must not be currently associated with an AWS resource, such as an EC2 instance, NAT gateway, or Network Load Balancer.

If you contacted AWS support to set up reverse DNS for an Elastic IP (EIP) address, you can remove the reverse DNS, but you can’t release the Elastic IP address because it’s been locked by AWS support. To unlock the Elastic IP address, contact AWS Support . Once the Elastic IP address is unlocked, you can release the Elastic IP address.

To release an Elastic IP address

Select the Elastic IP address to release and choose Actions , Release Elastic IP addresses .

Choose Release .

Use the release-address AWS CLI command.

Use the Remove-EC2Address AWS Tools for Windows PowerShell command.

If you have released your Elastic IP address, you might be able to recover it. The following rules apply:

You cannot recover an Elastic IP address if it has been allocated to another AWS account, or if it will result in your exceeding your Elastic IP address limit.

You cannot recover tags associated with an Elastic IP address.

You can recover an Elastic IP address using the Amazon EC2 API or a command line tool only.

To recover an Elastic IP address

Use the allocate-address AWS CLI command and specify the IP address using the --address parameter as follows.

Use the New-EC2Address AWS Tools for Windows PowerShell command and specify the IP address using the -Address parameter as follows.

If you intend to send email to third parties from an instance, we recommend that you provision one or more Elastic IP addresses and assign static reverse DNS records to the Elastic IP addresses that you use to send email. This can help you avoid having your email flagged as spam by some anti-spam organizations. AWS works with ISPs and internet anti-spam organizations to reduce the chance that your email sent from these addresses will be flagged as spam.

Considerations

Before you create a reverse DNS record, you must set a corresponding forward DNS record (record type A) that points to your Elastic IP address.

If a reverse DNS record is associated with an Elastic IP address, the Elastic IP address is locked to your account and cannot be released from your account until the record is removed.

AWS GovCloud (US) Region

You can't create a reverse DNS record using the console or AWS CLI. AWS must assign the static reverse DNS records for you. Open Request to remove reverse DNS and email sending limitations and provide us with your Elastic IP addresses and reverse DNS records.

Create a reverse DNS record

To create a reverse DNS record, choose the tab that matches your preferred method.

Select the Elastic IP address and choose Actions , Update reverse DNS .

For Reverse DNS domain name , enter the domain name.

Enter update to confirm.

Choose Update .

Use the modify-address-attribute command in the AWS CLI, as shown in the following example:

Remove a reverse DNS record

To remove a reverse DNS record, choose the tab that matches your preferred method.

For Reverse DNS domain name , clear the domain name.

Use the reset-address-attribute command in the AWS CLI, as shown in the following example:

If you receive the following error when you run the command, you can submit a Request to remove email sending limitations to customer support for assistance.

The address with allocation id cannot be released because it is locked to your account .

By default, all AWS accounts have a quota of five (5) Elastic IP addresses per Region, because public (IPv4) internet addresses are a scarce public resource. We strongly encourage you to use an Elastic IP address primarily for the ability to remap the address to another instance in the case of instance failure, and to use DNS hostnames for all other inter-node communication.

To verify how many Elastic IP addresses are in use

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ and choose Elastic IPs from the navigation pane.

To verify your current account quota for Elastic IP addresses

Open the Service Quotas console at https://console.aws.amazon.com/servicequotas/ .

From the navigation bar (at the top of the screen), select a Region.

On the Dashboard, choose Amazon Elastic Compute Cloud (Amazon EC2) .

If Amazon Elastic Compute Cloud (Amazon EC2) is not listed on the Dashboard, choose AWS services , enter EC2 in the search field, and then choose Amazon Elastic Compute Cloud (Amazon EC2) .

On the Amazon EC2 service quotas page, enter IP in the search field. The limit is EC2-VPC Elastic IPs . For more information, choose the limit.

If you think your architecture warrants additional Elastic IP addresses, you can request a quota increase directly from the Service Quotas console. To request a quota increase, choose Request increase at account-level . For more information, see Amazon EC2 service quotas .

Warning

To use the Amazon Web Services Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions.

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.

DEV Community

DEV Community

Kóredé Bashir

Posted on Jun 22, 2022

How to Add a Static IP to an AWS EC2 Instance

Introduction.

AWS Elastic Compute Cloud (EC2) is a popular option for cloud computing services. It offers virtual servers (or instances) as well as security, networking, and storage options. EC2 can launch as many or as few virtual servers as you need, depending on your projects.

Using EC2 offers multiple benefits, including the ability to run your applications in the cloud and to create virtual machines (VMs) with whatever configurations you might need. The infrastructure is scalable, with over 500 instances, and EC2 supports developing macOS and machine learning applications.

EC2 works with static (aka elastic) IP addresses. Whenever a resource on a network is assigned an IP address, that IP address is either dynamic—meaning it’s assigned by the network it’s connected to and changes periodically—or static, meaning it never changes. An elastic IP address in EC2 is public, so it’s reachable from the internet. Because it’s set to your AWS account, an elastic IP address can be remapped to another instance as needed in case of bugs or other issues. A custom IP address can also be added to your account rather than use one from AWS.

Elastic IP addresses are provided via a Dynamic Host Configuration Protocol (DHCP). These IP addresses are persistent, meaning they will not change when the VM is restarted or shut down.

In this tutorial, I'll walk you through how to configure an elastic IP address with an AWS EC2 instance.

Prerequisites

This article doesn't have many prerequisites, it is a tutorial which will assume you already have an AWS EC2 instance provisioned already, that is ready to be associated with an elastic IP address. In case you do not already have an AWS EC2 instance running, please create one before proceeding with the rest of this guide.

Let's dive right in!

Step 1: Choosing Elastic IP

From the AWS console, navigate to EC2 by clicking Compute . This should take you straight to your EC2 dashboard.

Navigate to dashboard

On your dashboard, click on Elastic IPs under Network & Security .

Elastic IPs

Step 2: Creating New IP

Click on Allocate Elastic IP address to create a new static IP address.

Allocate IP

Proceed by clicking Allocate .

IP options

Step 3: Assigning IP to EC2 Instance

Once the allocation request is successful, assign the static IP to your EC2 instance.

On the elastic IP view, select the IP you just allocated and click the Actions dropdown.

Actions menu

Select the View details button to reveal the info page on the elastic IP.

Elastic IP details

On this page, click the Associate Elastic IP address button.

Associate IP address

Step 4: Associating IP to Instance

Search for your instance ID from the Instance field.

Locate instance ID

Select the instance ID and scroll down to click the Associate button.

Associate IP

Step 5: Checking The Instance View

Your elastic IP address has now been associated with your EC2 instance. Head to your instance view by clicking on your instance ID. The address of your static IP is now displayed on the view.

IP associated successfully

Step 6: Connecting to The Instance

Connect to your EC2 instance with the newly associated static IP. On your instance view, click Connect . A view with connection details can now be seen. If you’re using a Linux or Mac system, open up your terminal.

Instance summary

Select SSH on the connect view. This tutorial connects via SSH through PowerShell.

Connect to instance

Set permissions on private key if you haven’t already by pasting one of the below commands in your terminal or CLI:

Option A: Linux

Set permissions on Linux for private key

Option B: Windows (PowerShell)

Set permissions on Windows for private key

You can copy-paste the second command shown on your instance description to connect to your remote instance:

Connect to EC2 instance

Enter Yes to proceed.

CLI connected to instance

The instance is now connected, as shown below, this was validated by confirming the present working directory with the command pwd . Please proceed with building whatever solution you want to deploy on your EC2 instance.

Connected EC2 instance

Limits on Elastic IPs

According to this AWS documentation on service quotas, “Your AWS account has default quotas, formerly referred to as limits, for each AWS service.” The important thing to understand is that static IPs on EC2 instances have a limit of five IPs per region per account, so you can’t allocate more than five static IPs in the same AWS region. If you already have up to five elastic IPs, you can either delete one or select a new AWS region before allocating a new IP.

If you need to confirm your elastic IP address limit, head over to your EC2 dashboard. Select Limits from the left pane and type in IP in the search box. You should immediately see the EC2-VPC Elastic IPs limit. Click on it for more details about the limit quota.

Remember, the good thing about elastic IPs is they don’t change or expire, unless they are disassociated from an instance and released.

Request an increase to your quota from the Service Quotas Console if the need arises.

In this tutorial, you learned how to set up an elastic IP address and connect it remotely with your AWS EC2 instance. As you saw, this is a simple process that gives you more control over your EC2 instance and allows you to choose your own IP address for as long as you need it.

If you have any questions, feel free to reach out to me on Twitter: @ John Doe or LinkedIn

Top comments (0)

pic

Templates let you quickly answer FAQs or store snippets for re-use.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink .

Hide child comments as well

For further actions, you may consider blocking this person and/or reporting abuse

manikandan2347 profile image

Utilize BizMagnets' WhatsApp Marketing Platform for Any Online WhatsApp Business.

Mani - Feb 23

brihaspatiinfotech profile image

The Rise of AI in Ecommerce: How Shopify Stores Can Leverage it for Success

Naveen Sharma - Feb 23

crclearancecenter profile image

Dreamy Deals: Navigating the Best Bedroom Furniture Offers

Corporate Rentals Clearance Center - Feb 23

mattbug3 profile image

Building Interactive Skill Progress Bars with HTML, CSS, and JavaScript

Matt Adil - Feb 23

Once suspended, bashirk will not be able to comment or publish posts until their suspension is removed.

Once unsuspended, bashirk will be able to comment and publish posts again.

Once unpublished, all posts by bashirk will become hidden and only accessible to themselves.

If bashirk is not suspended, they can still re-publish their posts from their dashboard.

Once unpublished, this post will become invisible to the public and only accessible to Kóredé Bashir.

They can still re-publish the post if they are not suspended.

Thanks for keeping DEV Community safe. Here is what you can do to flag bashirk:

bashirk consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy.

Unflagging bashirk will restore default visibility to their posts.

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

  • DevOps Lifecycle
  • DevOps Roadmap
  • Docker Tutorial
  • Kubernetes Tutorials
  • Amazon Web Services [AWS] Tutorial
  • AZURE Tutorials
  • GCP Tutorials
  • Docker Cheat sheet
  • Kubernetes cheat sheet
  • AWS interview questions
  • Docker Interview Questions
  • Ansible Interview Questions
  • Jenkins Interview Questions

Related Articles

  • Amazon Web Services - Using Single SSH Key For all AWS Regions
  • Placement Group Rules and Limitations
  • Amazon Web Services - Creating a User Pool in AWS Cognito
  • Amazon Web Services - Introduction to Amazon FSx
  • Introduction to AWS Batch
  • 6 Strategies for Migrating Applications to AWS Cloud
  • Amazon VPC - IP Addressing in VPC
  • Amazon Web Services - Resolving Server Authorization Error in Amazon EKS API Server
  • What is AWS OpsWorks?
  • Introduction To AWS Glue ETL
  • Amazon Web Services - Introduction to Solutions Constructs
  • Amazon Web Services - Resolving Domain Pending Verification Status in Amazon SES
  • Amazon Web Services - Restricting S3 Access Only From CloudFront
  • Amazon Web Services - Global Accelerator
  • Amazon Web Services - Managing Invalid Keys in Key Management System
  • Introduction to AWS Fargate
  • How to Use AWS Elastic Beanstalk For Scalable Web Application Deployment?
  • Introduction to AWS Organizations
  • Amazon Web Services - Introduction to Amazon CloudWatch Synthetics

AWS Elastic IP Addresses

Pre-requisite: AWS

A Static IPv4 address more suited for dynamic cloud computing is called an Elastic IP (EIP) address. These IPs are mostly used to hide instances or software from your AWS account that fail. The address is mapped to another instance that is as soon as feasible made available in your account in order to accomplish this. Your AWS account receives an IP address automatically, and until you choose to surrender it, it is yours. As an alternative, you can add the IP to a DNS record for your domain. Making sure the supplied domain points to your instance using this will do that.

The internet can be used to access this address just like any other public IPv4 address. If your instance lacks a public IPv4 address that allows communication from the internet to the instance, you can associate this IP address with it. The AWS EIP does not currently support IPv6 addresses.

Elastic Pricing for IP Addresses

In order to ensure that the offered IP addresses are utilized effectively, AWS imposes a small, hourly fee. A business must meet a few requirements in order to obtain the price charges. These are what they are:

  • If you want to give the same instance various IP addresses
  • If the IP-based instances are terminated or stopped
  • If the network interface is not connected to the IP address
  • If over the course of a month, the IPs were remapped more than 100 times,

Elastic IP addresses are weirdly priced by Amazon: There is no cost associated with utilizing them; they are totally free. For unused Elastic IP addresses, on the other hand, which are addresses that aren’t actively assigned to running instances, Amazon charges $.005 per hour. Because Elastic IP addresses are scarce resources, this method encourages users to use them when they request them. Request only as many Elastic IP addresses as you require, and release any extras back to AWS if not needed.

Elastic IP Addresses and the AWS Network’s Reach

  • AWS network scope basically complies with AWS’s geographical boundaries. The public IP addresses allocated to your instance vary by area, but they are universal in nature, which means that, like all public IP addresses, they are all distinct and may be accessed by anybody worldwide. 
  • For instance, if you start an instance in the AWS US East region, it will have a public IP address that comes from one of the IP address ranges that Amazon keeps for US East. With that public IP address, your instance is accessible to all resources in the world (including those in AWS) .
  • Region-scoped IP addresses are also available. Five Elastic IP addresses are the maximum you can have per area by default, and they are all contained within the region-specific address ranges.
  • Region-scoped IP addresses also apply to private ones. Using the private IP address assigned to the instances, instances inside any availability zone in a given region can connect with one another without being charged for network traffic.

Working of AWS Elastic IP

The working of AWS Elastic IP can be explained in the following manner:

1. Allocate an Elastic IP Address: It is easy to assign an IP address to your account. Your IP address may be assigned using either the pool of IP addresses offered by Amazon or the private IP address pool you have added to your account.

There are the following options for the Public IPv4 address pool:

  • IPv4 Addresses are available on Amazon: If you want an IPv4 address assigned from the pool of IPv4 numbers maintained by Amazon.
  • My Collection of Open IPv4 Addresses: If you wish to assign an IPv4 address from a pool of IP addresses you’ve added to your AWS account. If your network does not contain any IP address pools, this option is disabled.
  • The IPv4 Address Pool that belongs to the Customer: If you need to distribute an IPv4 address for use with AWS Outposts from a pool made using your on-premises network. If you don’t have AWS Outposts, this option isn’t available to you.

2. Describe your Elastic IP Address: In this step, one can view all the metadata of the Elastic IP Address by visiting the View Information Portal. Here the metadata includes the name, descriptions, port numbers assigned, and other necessary details.

3. Tag an Elastic IP Address: You can use tags to distinguish between your IP addresses in case you have created multiple IP addresses. 

4. Connect or Disconnect an Elastic IP address from a Network Interface or Instance

5. Release an Elastic IP Address: We advise releasing an Elastic IP address via one of the following procedures if you no longer require it. The IP that needs to be released cannot currently be connected to any EC2 instance, NAT gateway, or Network Load Balancer on AWS.

Features of AWS Elastic IP

  • These IP addresses are static , as was already mentioned, thus they won’t change over time.
  • The principal network interface of the instance for which the IP address is attached is likewise connected to these IPs. As a result, when you link an instance’s network interface to it, the other way around, the instance is also linked to it.
  • If you link an elastic IP to an instance, the instance’s public IPv4 address will also be made available to other instances in the Amazon public IPv4 address pool.
  • The issue with public IPv4 addresses is that they cannot be recycled and cannot be changed to an elastic IP address. Here, you will be able to reassociate them to a different instance and detach them from one. Your connections to the newly connected resource can be resumed. Unless you consciously choose to release it, your account will continue to be assigned the disassociated IP address.
  • If you associate an instance with an elastic IP address even if it has a public IPv4 address, the instance’s public DNS hostname will be updated to reflect the elastic IP address.
  • Either the custom IP pool you added to your AWS account or the pool of IPv4 addresses provided by AWS will provide the Elastic IP address. The used IP address will not be taken into account for elastic IP address limits if it comes from your own IP pool.
  • When an IP address is assigned, the network border group may be linked to it. If a network border group is supplied, AWS will automatically set it to one of the region’s available zones. An Elastic IP cannot be moved across regions because it is intended for use in a specific network border group and region.
  • Elastic IP addresses can be used with any EC2 instance, as long as it’s running in a VPC (Virtual Private Cloud). They can also be used with Amazon’s other services, such as Amazon Elastic Load Balancer, AWS CloudFront, and AWS Elastic Beanstalk.
  • Elastic IP addresses can be reserved and owned by your AWS account, which allows you to retain the same IP address even if you stop or terminate an instance. This is useful if you need to ensure that clients or customers always connect to the same IP address.
  • AWS provides a number of tools to help you manage your Elastic IP addresses, including the ability to view usage reports, monitor IP address changes, and automate IP address allocation and release.
  • Elastic IP addresses are free to use as long as they are attached to a running instance. However, if they are not associated with an instance, you will be charged a small hourly fee.
  • If you need to assign multiple IP addresses to an instance, you can use the AWS Network Interface (ENI) feature to create additional virtual network interfaces and associate each one with a different IP address.
  • Elastic IP addresses can be used to create highly available and fault-tolerant systems by allowing you to quickly and easily switch IP addresses between instances. This can be useful in situations where you need to perform maintenance on an instance or if an instance fails and needs to be replaced.
  • If you need to move an Elastic IP address to a different AWS account or region, you can use the AWS Elastic IP Address Transfer feature. This allows you to transfer ownership of the IP address to another account or region without disrupting your existing services.

Limitation of Elastic IP

Elastic IP is easy to use, but it has several drawbacks.

  • Public IPv4 addresses are a limited resource on the internet.
  • AWS sets a default restriction of five Elastic IP addresses per region.
  • AWS advises utilizing IP addresses for that and other intra-node communication because the major function of these IP addresses is to conceal the failure instances by remapping the addresses to new instances.
  • AWS charges an hourly fee for Elastic IP addresses that are not associated with a running instance. This can make it expensive to reserve IP addresses that are not being actively used.
  • The number of Elastic IP addresses that you can allocate per account is limited by default. AWS imposes a soft limit of 5 Elastic IP addresses per region for each account. If you need more than this, you will need to request a higher limit from AWS support.
  • Public IPv4 addresses are a limited resource on the internet, and there is a finite number of them available. This means that it’s important to use Elastic IP addresses judiciously and only allocate them when they are truly needed.
  • Elastic IP addresses can only be used in the same AWS region where they were allocated. This means that if you need to move an instance to a different region, you will need to release the existing Elastic IP address and allocate a new one in the new region.
  • It’s important to properly manage your Elastic IP addresses to avoid wasting resources and incurring unnecessary costs. This includes releasing unused IP addresses, avoiding over-provisioning, and monitoring usage to ensure that IP addresses are being used effectively.

I hope this blog has helped you better understand AWS Elastic IPs. In the near future, there will be many job openings worldwide in the field of cloud computing. Therefore, it is up to you to seize the chance, gain expertise in the cloud, and make more than you would in other IT positions.

Please Login to comment...

author

  • aws-elastic-beanstalk
  • Cloud-Computing
  • Amazon Web Services
  • chinmaya121221

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Security.org

What Is a Static IP Address?

I f you’ve done any research on internet protocol (IP) addresses, then chances are you’ve run into the term “static IP address.” Static means unchanging, but is that a good or a bad thing for your overall digital security? We’ll break down what a static IP address is and figure out if it’s right for your devices.

A static IP address is an IP address that stays the same. Typically, users create static IP addresses manually; internet service providers, or ISPs, can assign them, as well. Static IP addresses can be either IPv4 or IPv6, although as of now, IPv4 is much more common.

Your private information

My ip address.

20.237.210.148

Unprotected

My IP Information

Internet provider:

MICROSOFT-CORP-MSN-AS-BLOCK

Region/ State:

Hide my IP address

View IP Details

Browser name:

Browser version:

Device brand:

Device type:

Postal code:

  • Better support for DNS
  • Better for voice and video communications that use VoIP
  • Better for geolocation services, like changing your Tinder location
  • Easier to hack
  • Makes you easier to locate and track
  • Higher cost

What Is an IP Address?

If you’re not sure what an IP address is, we’ve got you covered. “IP” stands for “internet protocol,” and it’s a device’s identifying number both within a computer network and outside of that network. Think of an IP address like a street address that lets people send letters to each other, but in this case it’s data. IP addresses reveal the user’s approximate physical location including their city and ZIP code.

» Learn about: How to find your IP address

What Is a Dynamic IP Address?

The opposite of a static IP address is a dynamic IP address, one that changes periodically. A Dynamic Host Configuration Protocol (DHCP) server assigns dynamic IP addresses automatically; after a period of time, they expire and get replaced.

  • Makes you harder to follow online
  • No need to change your IP address manually
  • Bad for DNS servers
  • Less accurate geolocation information
  • Websites won’t remember who you are

Static vs. Dynamic IP Addresses

Now, let’s put static and dynamic IP addresses head to head. Both show a user’s approximate geolocation, but they’re useful for different purposes.

When You Need a Static IP Address

To be blunt, you won’t need a static IP address most of the time, except for websites that need to remember your IP address. If you have a business with your own website or internet service and employees working from home, use a static IP address along with a business VPN . This will help your employees work from home safely .

When You Need a Dynamic IP Address

For everything else, there are dynamic IP addresses, the choice of most consumers. Since dynamic IP addresses make it harder to track you online, they’re the default option the majority of the time.

» Learn more: How to get a US IP address

Which Type of IP Address Do You Have?

Finding your IP address is easy, whether you need to find your printer’s IP address , find your Roku’s IP address , or find your router’s IP address . We’ve included instructions for the major operating systems below.

Follow these steps to check your Mac’s IP address :

  • Open the System Settings…
  • Select Network.
  • Select your Wi-Fi network.
  • Click Details…
  • Your internal IP address should then be listed.

PC (Windows 11)

Find your Windows computer’s IP address:

  • Click on the Taskbar.
  • Click Wi-Fi Network.
  • Click Select Network.
  • Select Properties.
  • Look under IPv4 Address for your IP Address.

To find your Android device’s IP:

  • Open your Android Settings.
  • Click About.
  • Click Status.
  • Click IP Address.

And last but not least, to find your iPhone’s IP address :

  • Open Settings.
  • Click Wi-Fi.
  • Under the lowercase i, click Network.
  • You’ll find your IP address under IPv4 Address.

Is It Hard to Change Your IP Address?

Once you’ve found it, changing your IP address isn’t hard. You can use a number of methods, but installing a VPN is the easiest option. But don’t worry; we’ll get to that soon.

How to Get a Dynamic IP Address

Now, to change your IP address (and change it again and again), we recommend using a VPN with dynamic IP addresses. However, although there are free VPNs as well as free trial VPNs , you’ll probably have to pay for a VPN in the long term. If that doesn’t work for you, we’ve provided some other options.

» Further Reading: Learn how to get a UK IP address

VPNs hide your IP address and change it periodically. Additionally, VPNs hide your browsing history for some added privacy, if that’s your reason for using a VPN .

Look for a VPN with dynamic IP addresses; we suggest ExpressVPN, Private Internet Access, or IPVanish, to name a few. Learn more in our ExpressVPN review , Private Internet Access review , or IPVanish review . Once you’ve picked out a VPN:

  • Download the VPN from your app store.
  • Complete the installation process as guided.
  • Connect to a server. Your IP address will change automatically.

Another way to get dynamic IP addresses is to use Tor as your web browser. Tor is a free and open-source secure browser that isolates each website, clearing the cookies as soon as you move onto the next one. By changing your IP address and device information, Tor makes all users look the same, encrypting their IPs and web activity three times. You can download Tor for macOS, Linux, Android, or PC on the Tor Project website. 2

Proxy Servers

If you want to change your IP address only and don’t care about your web activity being hidden, you can use a proxy server in lieu of a VPN. Here’s how.

  • Open Safari.
  • Click Settings.
  • Click Advanced.
  • Under the Proxies section, click Change Settings.
  • Update your settings with the necessary information that was provided to you.
  • Open your Settings.
  • Click Network & internet.
  • Click Proxy.
  • Click Set up under the automatic or manual section.
  • Enter your proxy information.

Click Save.

  • Select the lowercase i, in the WiFi section.
  • Scroll to HTTP Proxy section.
  • Click Manual.
  • Change the setting from Off to Manual.
  • Enter in the Server and Port information needed.
  • Tap Settings.
  • Tap Connections.
  • Tap Settings next to the network name.
  • Tap View More.
  • Tap Proxy, then select Manual.
  • Enter your proxy port and hostname.
NOTE: Proxy servers encrypt your IP address only; your ISP will still be able to see everything you’ve done online.

How to Set up a DHCP Reservation

If you’ve ever tried to print wirelessly, then you know how hard it can be to connect your computer to your printer. That’s probably because your printer’s IP address keeps changing. So to combat this issue, some people set up DHCP reservations, which tell your Wi-Fi network to assign a device the same IP address every time. How to set up a DHCP reservation depends on the operating system, but if you use Google Home:

  • Open the Google Home app.
  • Click Advanced Networking.
  • Click DHCP IP Reservations.
  • Click the plus sign to add IP reservations.
  • Click the device you want to assign a static IP address.
  • Enter the static IP address.
  • Click Save. 3

How to Protect Your IP Address

The most surefire way to protect your IP address is to use a VPN, but you could also use a proxy server or the Tor browser, as we detailed above. If someone has your IP address along with your personally identifiable information , or PII, they could steal your identity , which is why it’s best to keep your IP addresses hidden .

And there you have it: everything you ever wanted to know about static IP addresses and more. But if we still haven’t answered your burning questions, keep reading below or check out our VPN how-to guides for even more information.

Laptop Computer with Windows

AWS re:Post

How can Client VPN users get a static IP address so that they can access the internet?

I want to allow AWS Client VPN users access to the internet with a static public IP address.

Follow these instructions to create a public NAT gateway and allow a Client VPN user to access the internet.

Note: When you create a NAT gateway, that action results in additional AWS charges. For more information, see  NAT gateway pricing .

Make sure the Amazon Virtual Private Cloud (Amazon VPC) has private and public subnets . To create an Amazon VPC and subnet, see Subnets for your VPC .

Follow the instructions to create a NAT gateway with the public subnet. The NAT gateway is assigned an Elastic IP address. For example:

Associate the Client VPN endpoint with the private subnet. The private subnet has a route to the internet through the NAT gateway. For example:

Add a Client VPN endpoint destination route 0.0.0.0/0 or the destination's public IP address range on the Client VPN route table. For the target VPC subnet ID, select the private subnet from step 3. For more information, see create an endpoint route .

Add an authorization rule to allow access to the internet (0.0.0.0/0), or the specified public network IP address. For more information, see Add an authorization rule to a Client VPN endpoint .

Verify that the security group associated with subnet that you route traffic through allows outbound traffic to the internet. The security group must have an outbound rule that allows all traffic to the internet (0.0.0.0/0).

Related information

Using AWS Client VPN to scale your work from home capacity

AWS OFFICIAL

Relevant content

  • Static IP for AWS Client VPN elbigbadmo lg ... asked 2 years ago lg ...
  • VPN with static public IP to connect to customer's apps rePost-User-2684239 lg ... asked 8 months ago lg ...
  • How to setup a NAT Gateway together with a VPN Accepted Answer rePost-User-9342809 lg ... asked a year ago lg ...
  • I want to assign static ip address to VPN client endpoint Abhishek lg ... asked 8 months ago lg ...
  • VPN client endpoint interfaces have public IP, how to remove? Accepted Answer bchin lg ... asked 3 years ago lg ...

profile picture

IMAGES

  1. How to reserve aws ec2 instance static ip address

    static ip address aws

  2. Configure a static IP address

    static ip address aws

  3. Static IP Addresses with AWS Network Load Balancer (NLB)

    static ip address aws

  4. Using AWS Lambda to enable static IP addresses for Application Load

    static ip address aws

  5. Configure a static IP address

    static ip address aws

  6. How to reserve aws ec2 instance static ip address

    static ip address aws

VIDEO

  1. 12-Static IP address

  2. Configure Static IP address on Windows Server Machine

  3. Setting Openmediavault IP address to static #short

  4. How To Set Static IP and DNS Using Command Prompt in Windows PC

  5. How to map an IP address to a domain name

  6. How to Configure Static IP Address Android

COMMENTS

  1. Elastic IP addresses

    An Elastic IP address is static; it does not change over time. An Elastic IP address is for use in a specific Region only, and cannot be moved to a different Region. An Elastic IP address comes from Amazon's pool of IPv4 addresses, or from a custom IPv4 address pool that you have brought to your AWS account.

  2. Associate a static public IP address with your EC2 instance

    An Elastic IP address is a static public IPv4 address associated with your AWS account in a specific Region. Unlike an auto-assigned public IP address, an Elastic IP address is preserved after you stop and start your instance in a virtual private cloud (VPC). You can use these tools to associate an Elastic IP address with your EC2 instance:

  3. Assign a Windows EC2 static IP address

    To assign a static private IP address for an Amazon EC2 Windows instance, follow these steps: Note: The network interface IP address and Windows adapter IP addresses must match for a successful network connection. Open the Amazon EC2 console, and then choose Instances from the navigation pane. Select your instance.

  4. How to Add a Static IP to an AWS EC2 Instance

    Step 3: Assigning IP to EC2 Instance. Once the allocation request is successful, assign the static IP to your EC2 instance. On the elastic IP view, select the IP you just allocated and click the Actions dropdown. Select the View details button to reveal the info page on the elastic IP. On this page, click the Associate Elastic IP address button.

  5. Application Load Balancer now enables AWS PrivateLink and static IP

    With this feature, you can now use AWS PrivateLink and expose static IP addresses for applications built on ALB. ALB is a managed layer 7 proxy that provides advanced request-based routing. NLB operates at layer 4 and provides support for PrivateLink and zonal static IP addresses. ... like AWS Lambda functions, to manage ALB IP address changes ...

  6. Using static IP address with Amazon EC2

    amazon-ec2 static-ip-address Share Improve this question Follow edited Oct 22, 2017 at 9:35 halfer 20.2k 19 104 193 asked Mar 6, 2012 at 5:49 coure2011 41.1k 85 218 356 Amazon has Elastic IP Addresses like Rick says, and they're also free. You don't need to purchase any.

  7. AWS Elastic IP Addresses

    Pre-requisite: AWS. A Static IPv4 address more suited for dynamic cloud computing is called an Elastic IP (EIP) address. These IPs are mostly used to hide instances or software from your AWS account that fail. The address is mapped to another instance that is as soon as feasible made available in your account in order to accomplish this.

  8. Register an Application Load Balancer behind a Network ...

    You can't assign a static IP address to an Application Load Balancer. If your Application Load Balancer requires a static IP address, then it's a best practice to register it behind a Network Load Balancer.

  9. How to access AWS API Gateway using static IP

    Solution 2: Using NLB with a public elastic IP. Network Load balancer provided by AWS has a host of benefits.One of those benefits is the support for static IP addresses for the load balancer.

  10. Associate an Elastic IP address with a WorkSpace

    To associate an Elastic IP address with a WorkSpace, follow these steps: Open the Amazon WorkSpaces console. Select the WorkSpace, and then choose the Hide or Show details arrow to expand the WorkSpace details. Note the WorkSpace IP address. Open the Amazon Elastic Compute Cloud (Amazon EC2) console, and then choose Network Interfaces from the ...

  11. What Is a Static IP Address?

    A static IP address is an IP address that stays the same. Typically, users create static IP addresses manually; internet service providers, or ISPs, can assign them, as well.

  12. Get a static IP address for Client VPN

    How can Client VPN users get a static IP address so that they can access the internet? 2 minute read 0 I want to allow AWS Client VPN users access to the internet with a static public IP address. Resolution Follow these instructions to create a public NAT gateway and allow a Client VPN user to access the internet.

  13. New

    Effective February 1, 2024 there will be a charge of $0.005 per IP per hour for all public IPv4 addresses, whether attached to a service or not (there is already a charge for public IPv4 addresses you allocate in your account but don't attach to an EC2 instance). Public IPv4 Charge