How to allocate/generate new IP address in ec2 instance in same subnet range?

前端 未结 2 1200
[愿得一人]
[愿得一人] 2021-01-17 08:22

I know I can get new IP address by going to Elastic IPs --> Allocate new address but by doing this I always get IPs in different subnet range.

I want to IPs with sam

相关标签:
2条回答
  • 2021-01-17 09:03

    I Found a solution for my problem:

    While creating new instance itself we can assign IP address within the same subnet range.

    Here are the steps : First have this ready

    • goto VPC --> Create Subnet
    • goto network&security --> create networkinterface

    Then, * Launch Instance --> Choose the AMI --> choose instance type --> configure instance

    Under configure instance :

    *Select the network and subnet you have just created

    • Auto-assign Public IP : Enable

    Then in same Page , downside you see Network interfaces : Here , Add Primary Ip , secondary Ip (you can add as many based on your subscription)

    But for a free tier max 2 you can add !!

    But main thing is you can assign any IP you need from that subnet range you had created.

    Hoping this will help someone.

    0 讨论(0)
  • 2021-01-17 09:05

    Based on the documentation it isn't possible to select the IP from an address range for Elastic IP's unless you own the IP address space.

    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).

    You may be able to hack around this but I don't think AWS would look kindly upon it.

    0 讨论(0)
提交回复
热议问题